Spring Integration with JMS backed channels - "Dispatcher has no subscribers" -


i newbie spring integration , trying execute basic producer/consumer application si , activemq.

i see messages being produced , stored on queue, when consumer ( service activator in case) processes message , tries returning new message output channel, keep getting below warning messages :

11:28:14.425 warn [defaultmessagelistenercontainer-1][org.springframework.jms.listener.defaultmessagelis tenercontainer] execution of jms message listener failed, , no errorhandler has been set. org.springframework.integration.messagedeliveryexc eption: dispatcher has no subscribers jms-channel jsonresponsechannel. @ org.springframework.integration.jms.subscribablejm schannel$dispatchingmessagelistener.onmessage(subs cribablejmschannel.java:159)  below snapshot of context xmls :  common-context.xml --------------------- .............. <bean id="requestqueue" class="org.apache.activemq.command.activemqqueue"> <constructor-arg value="input_msg_queue" /> </bean> <bean id="responsequeue" class="org.apache.activemq.command.activemqqueue"> <constructor-arg value="output_msg_queue" /> </bean> <int-jms:channel id="jsongreetingrequests" queue-name="input_msg_queue" message-driven="true"/> <int-jms:channel id="jsonresponsechannel" queue-name="output_msg_queue" message-driven="true"/> <bean name="connectionfactory" class="org.apache.activemq.activemqconnectionfacto ry"> <property name="brokerurl" value="tcp://localhost:61616" /> </bean> ..............  consumer-context.xml --------------------- .............  <int-jms:message-driven-channel-adapter id="newrequestsinchanneladapter" destination="requestqueue" channel="jsongreetingrequests"/> <!-- <int-jms:inbound-gateway request-channel="jsongreetingrequests" reply-channel="jsonresponsechannel" request-destination="requestqueue" />-->  <int:chain input-channel="jsongreetingrequests" output-channel="jsonresponsechannel"> <int:json-to-object-transformer type="com.periscope.samples.service.message"/> <int:service-activator method="greethello"> <bean class="com.periscope.samples.service.impl.hellowor ldserviceimpl"/> </int:service-activator> <int:object-to-json-transformer /> </int:chain>  <stream:stdout-channel-adapter id="greetingsstdout" channel="jsonresponsechannel"/> .....................  producer-context.xml ----------------------- ..... <int:gateway id="greetings" default-request-channel="greetingrequests" service-interface="com.periscope.samples.service.greetings "/> <int:channel id="greetingrequests"/>  <int:chain input-channel="greetingrequests" output-channel="jsongreetingrequests"> <int:object-to-json-transformer /> </int:chain>  <int-jms:outbound-channel-adapter id="jmsgreetingsoutchanneladapter" channel="jsongreetingrequests" destination="requestqueue"/> ....... 

this msg string being wrapped in user defined object , sent on input_msg_queue. consumer reads msg , processes , returns new message on output_msg_queue. these activemq backed channels , queues.

can please throw light how rid of these warnings since in particular use case, not expect other subscriber listening on output_msg_queue ?

thanks.  

you don't need both jms channel adapters , jms-backed queues.

with current config have 2 consumers on input_msg_queue (the channel , channel adapter).

jms-backed channels needed message persistence. sending messages different application, use adapters.

simply change these

<int-jms:channel id="jsongreetingrequests" queue-name="input_msg_queue" message-   driven="true"/> <int-jms:channel id="jsonresponsechannel" queue-name="output_msg_queue" message-driven="true"/> 

to simple <int:channel/>s.

also, given using request/response semantics, starting <gateway/> need use jms in/out gateways, not adapters (which one-way integration).


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -