org.springframework.integration.message.MessageDeliveryException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • *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); } }
    via by Dave Syer,
  • *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); } }
    via by Dave Syer,
    • 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)
    No Bugmate found.