org.springframework.integration.message.MessageDeliveryException: Dispatcher has no subscribers.

Spring JIRA | Dave Syer | 8 years ago
  1. 0

    *AnnotationPostProcessor creates an endpoint but doesn't activate it (assuming wrongly that the MessageBus will activate it at some point in the future). This means that beans whch are added to the ApplicationContext after the refresh event (the normal trigger for activation) are never activated. Simple steps to reproduce: create a Spring integration test case that itself is a @MessageEndpoint. If you try to send to the input channel there will be an exception org.springframework.integration.message.MessageDeliveryException: Dispatcher has no subscribers. at org.springframework.integration.dispatcher.SimpleDispatcher.dispatch(SimpleDispatcher.java:39) at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:56) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:116) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:94) ... Example test case: @ContextConfiguration(locations = "/integration-context.xml") @RunWith(SpringJUnit4ClassRunner.class) @MessageEndpoint public class SmokeTests { @Autowired @Qualifier("smokein") private MessageChannel smokein; @Autowired @Qualifier("smokeout") private PollableChannel smokeout; // This has to be static because the MessageBus registers the handler // more than once (every time a test instance is created), but only one of // them will get the message. private volatile static int count = 0; @ServiceActivator(inputChannel = "smokein", outputChannel = "smokeout") public String process(String message) { count++; String result = message + ": " + count; return result; } @Test public void testDummyWithSimpleAssert() throws Exception { assertTrue(true); } @Test public void testVanillaSendAndReceive() throws Exception { smokein.send(new GenericMessage<String>("foo")); @SuppressWarnings("unchecked") Message<String> message = (Message<String>) smokeout.receive(100); String result = (String) (message == null ? null : message.getPayload()); assertEquals("foo: 1", result); assertEquals(1, count); } }

    Spring JIRA | 8 years ago | Dave Syer
    org.springframework.integration.message.MessageDeliveryException: Dispatcher has no subscribers.
  2. 0

    *AnnotationPostProcessor creates an endpoint but doesn't activate it (assuming wrongly that the MessageBus will activate it at some point in the future). This means that beans whch are added to the ApplicationContext after the refresh event (the normal trigger for activation) are never activated. Simple steps to reproduce: create a Spring integration test case that itself is a @MessageEndpoint. If you try to send to the input channel there will be an exception org.springframework.integration.message.MessageDeliveryException: Dispatcher has no subscribers. at org.springframework.integration.dispatcher.SimpleDispatcher.dispatch(SimpleDispatcher.java:39) at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:56) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:116) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:94) ... Example test case: @ContextConfiguration(locations = "/integration-context.xml") @RunWith(SpringJUnit4ClassRunner.class) @MessageEndpoint public class SmokeTests { @Autowired @Qualifier("smokein") private MessageChannel smokein; @Autowired @Qualifier("smokeout") private PollableChannel smokeout; // This has to be static because the MessageBus registers the handler // more than once (every time a test instance is created), but only one of // them will get the message. private volatile static int count = 0; @ServiceActivator(inputChannel = "smokein", outputChannel = "smokeout") public String process(String message) { count++; String result = message + ": " + count; return result; } @Test public void testDummyWithSimpleAssert() throws Exception { assertTrue(true); } @Test public void testVanillaSendAndReceive() throws Exception { smokein.send(new GenericMessage<String>("foo")); @SuppressWarnings("unchecked") Message<String> message = (Message<String>) smokeout.receive(100); String result = (String) (message == null ? null : message.getPayload()); assertEquals("foo: 1", result); assertEquals(1, count); } }

    Spring JIRA | 8 years ago | Dave Syer
    org.springframework.integration.message.MessageDeliveryException: Dispatcher has no subscribers.
  3. 0

    MessageDeliveryException: Dispatcher has no subscribers - Spring Forum

    spring.io | 5 months ago
    org.springframework.integration.message.MessageDeliveryException: Dispatcher has no subscribers.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Rolled back messages never get redelivered

    activemq-users | 7 years ago | chudak
    org.springframework.integration.message.MessageDeliveryException: failed to send Message to request channel

    Root Cause Analysis

    1. org.springframework.integration.message.MessageDeliveryException

      Dispatcher has no subscribers.

      at org.springframework.integration.dispatcher.SimpleDispatcher.dispatch()
    2. Spring Integration Core
      AbstractMessageChannel.send
      1. org.springframework.integration.dispatcher.SimpleDispatcher.dispatch(SimpleDispatcher.java:39)
      2. org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:56)
      3. org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:116)
      4. org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:94)
      4 frames