org.springframework.messaging.MessageDeliveryException: Failed to handle message to ExecutorSubscribableChannel[brokerChannel] in SimpleBroker[DefaultSubscriptionRegistry[cache[2 destination(s)], registry[2 sessions]]]; nested exception is java.util.ConcurrentModificationException

Spring JIRA | Piotr Leśniak | 2 years ago
  1. 0

    During invocation of SimpMessageSendingOperations::convertAndSend method ConcurrentModificationException occures. It happens very rarely (I found out about this bug by checking logs from production, I haven't seen it in application), probably when invocation of this method happens simultaneously with closing webSocket on a client. Here's a stack: {code} org.springframework.messaging.MessageDeliveryException: Failed to handle message to ExecutorSubscribableChannel[brokerChannel] in SimpleBroker[DefaultSubscriptionRegistry[cache[2 destination(s)], registry[2 sessions]]]; nested exception is java.util.ConcurrentModificationException at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:180) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.support.ExecutorSubscribableChannel.sendInternal(ExecutorSubscribableChannel.java:93) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:107) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:94) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.simp.SimpMessagingTemplate.sendInternal(SimpMessagingTemplate.java:185) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.simp.SimpMessagingTemplate.doSend(SimpMessagingTemplate.java:160) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.simp.SimpMessagingTemplate.doSend(SimpMessagingTemplate.java:47) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:95) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:133) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:113) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:108) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at .... [our application stack leading to convertAndSend on SimpMessageSendingOperations object] Caused by: java.util.ConcurrentModificationException: null at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:394) ~[na:1.7.0_55] at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:405) ~[na:1.7.0_55] at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.sendMessageToSubscribers(SimpleBrokerMessageHandler.java:227) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.handleMessageInternal(SimpleBrokerMessageHandler.java:183) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:180) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:172) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] ... 24 common frames omitted {code} Can it be related to this SPR-11755 bug?

    Spring JIRA | 2 years ago | Piotr Leśniak
    org.springframework.messaging.MessageDeliveryException: Failed to handle message to ExecutorSubscribableChannel[brokerChannel] in SimpleBroker[DefaultSubscriptionRegistry[cache[2 destination(s)], registry[2 sessions]]]; nested exception is java.util.ConcurrentModificationException
  2. 0

    During invocation of SimpMessageSendingOperations::convertAndSend method ConcurrentModificationException occures. It happens very rarely (I found out about this bug by checking logs from production, I haven't seen it in application), probably when invocation of this method happens simultaneously with closing webSocket on a client. Here's a stack: {code} org.springframework.messaging.MessageDeliveryException: Failed to handle message to ExecutorSubscribableChannel[brokerChannel] in SimpleBroker[DefaultSubscriptionRegistry[cache[2 destination(s)], registry[2 sessions]]]; nested exception is java.util.ConcurrentModificationException at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:180) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.support.ExecutorSubscribableChannel.sendInternal(ExecutorSubscribableChannel.java:93) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:107) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:94) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.simp.SimpMessagingTemplate.sendInternal(SimpMessagingTemplate.java:185) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.simp.SimpMessagingTemplate.doSend(SimpMessagingTemplate.java:160) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.simp.SimpMessagingTemplate.doSend(SimpMessagingTemplate.java:47) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:95) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:133) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:113) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:108) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at .... [our application stack leading to convertAndSend on SimpMessageSendingOperations object] Caused by: java.util.ConcurrentModificationException: null at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:394) ~[na:1.7.0_55] at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:405) ~[na:1.7.0_55] at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.sendMessageToSubscribers(SimpleBrokerMessageHandler.java:227) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.handleMessageInternal(SimpleBrokerMessageHandler.java:183) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:180) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:172) ~[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE] ... 24 common frames omitted {code} Can it be related to this SPR-11755 bug?

    Spring JIRA | 2 years ago | Piotr Leśniak
    org.springframework.messaging.MessageDeliveryException: Failed to handle message to ExecutorSubscribableChannel[brokerChannel] in SimpleBroker[DefaultSubscriptionRegistry[cache[2 destination(s)], registry[2 sessions]]]; nested exception is java.util.ConcurrentModificationException
  3. 0

    Configure External Broker(RabbitMQ) In Spring4+STOMP+SockJS Application

    Stack Overflow | 3 years ago | Gurminder Singh
    org.springframework.messaging.MessageDeliveryException: Message broker is not active.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring 4.0.5 websockt integration apollo with the exception "Message broker is not active"

    Stack Overflow | 3 years ago | user3686861
    org.springframework.messaging.MessageDeliveryException: Message broker is not active.
  6. 0

    theotherian's blog: using spring boot, spring websockets and stomp to create a browser chat service

    theotherian.com | 1 year ago
    org.springframework.messaging.MessageDeliveryException: Message broker is not active.

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.messaging.MessageDeliveryException

      Failed to handle message to ExecutorSubscribableChannel[brokerChannel] in SimpleBroker[DefaultSubscriptionRegistry[cache[2 destination(s)], registry[2 sessions]]]; nested exception is java.util.ConcurrentModificationException

      at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run()
    2. Spring Messaging
      AbstractMessageSendingTemplate.convertAndSend
      1. org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:180)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      2. org.springframework.messaging.support.ExecutorSubscribableChannel.sendInternal(ExecutorSubscribableChannel.java:93)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      3. org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:107)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      4. org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:94)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      5. org.springframework.messaging.simp.SimpMessagingTemplate.sendInternal(SimpMessagingTemplate.java:185)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      6. org.springframework.messaging.simp.SimpMessagingTemplate.doSend(SimpMessagingTemplate.java:160)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      7. org.springframework.messaging.simp.SimpMessagingTemplate.doSend(SimpMessagingTemplate.java:47)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      8. org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:95)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      9. org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:133)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      10. org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:113)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      11. org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:108)[spring-messaging-4.1.0.RELEASE.jar:4.1.0.RELEASE]
      11 frames