Thursday, April 3, 2014

Spring-integration-mqtt development and resolve MessageDispatchingException Dispatcher has no subscribers

Removed
I was using Spring-Integration-Mqtt in order to get messages from the mqtt Broker.


 

But while testing my application, I got this exception:

 org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:107) [spring-integration-core-4.0.0.M4.jar:]
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97) [spring-integration-core-4.0.0.M4.jar:]
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77) [spring-integration-core-4.0.0.M4.jar:]
... 10 more

Although the sent messages were received, I got the error. After some investigation, I have found that the problem don't come from spring-mqtt but from my side.
In fact by error, I have declared the service-activator and another bean  with the same Id.

So, If you have this error, make sure that your integration.xml (or applicationContext.xml) is correct.

Now, in order to take benefit from mqtt using Spring, you need to use spring-integration-mqtt and just configure few lines.

The Pom looks like this (if you have problem to locate the remote repository, see this post) :





And the intergration.xml:



No comments :

Post a Comment

Articles les plus consultés