Using mulerequester when there are more than one jms or wmq connector

给你一囗甜甜゛ 提交于 2019-12-13 02:14:06

问题


This is continuation from How to use Mule Expression in JMS:selector but a different question. I am using mulerequester to read off the queue as shown below.

<mulerequester:request config-ref="Mule_Requester" resource="wmq://REPLY.QUEUE?selector=JMSCorrelationID%3D'#[sessionVars.myCorrelationId]'" doc:name="Mule Requester" timeout="120000"/>

It works if I have one wmqConnector but I have 2 wmq connectors in my mule project (wmqconnector and wmqconnector1), pointing to different servers. During runtime, when mulerequester resolve the URL given in the "resource", it encounters 2 connectors matching the wmq protocol and I get the following error message "There are at least 2 connectors matching protocol "wmq", so the connector to use must be specified on the endpoint using the 'connector' property/attribute. Connectors in your configuration that support "wmq" are: wmqConnector1, wmqConnector, (java.lang.IllegalStateException)". I am not sure how to tell mulerequester which wmqConnector to use.

I referred to mule documentation for mulerequester but couldnt find any solution. Any suggestions?


回答1:


Pass the connector as a uri Param like this:

<mulerequester:request config-ref="Mule_Requester" resource="jms://input?connector=AMQConnector1" doc:name="Request a message from a queue" />



回答2:


Here is my modified mulerequester as per Ryan's suggestion. It uses both connector and selector as Uri params.

 <mulerequester:request config-ref="Mule_Requester" resource="wmq://REPLY.QUEUE?connector=wmqConnector&amp;selector=JMSCorrelationID%3D'#[sessionVars.myCorrelationId]'" doc:name="Mule Requester" timeout="120000"/>


来源:https://stackoverflow.com/questions/33266088/using-mulerequester-when-there-are-more-than-one-jms-or-wmq-connector

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!