3

I am using below configurations:

<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-requester</artifactId>
<version>1.6</version>
<spring:bean id="MQGatewayConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory" name="MQGatewayConnectionFactory" scope="singleton">
<spring:property name="transportType" value="1"></spring:property>
<spring:property name="connectionNameList" value="${mqm.gw.connectionNameList}"></spring:property>
<spring:property name="channel" value="${mqm.gw.channel}"></spring:property>
<spring:property name="queueManager" value="${mqm.gw.name}"></spring:property>
</spring:bean>

<jms:connector
name="WebsphereMQConnector_GW"
doc:name="WebsphereMQConnector_GW"
connectionFactory-ref="MQGatewayConnectionFactory"
username="${mqm.user}"
numberOfConsumers="4"
validateConnections="true"
maxRedelivery="-1"
cacheJmsSessions="false"
disableTemporaryReplyToDestinations="true"
persistentDelivery="true"
specification="1.1">
<reconnect-forever frequency="10000"></reconnect-forever> 
</jms:connector>


<mulerequester:request resource="jms://QUEUE.NAME?connector=WebsphereMQConnector_GW" timeout="10000" doc:name="Mule Requester"/>

This results into below error:

Endpoint              : UnregistrableEndpoint{endpointUri=jms://EIS_P2_CALL_CONTEXT?connector=WebsphereMQConnector_GW, connector=JmsConnector
                    {
                      name=WebsphereMQConnector_GW
                      lifecycle=start
                      this=299786b1
                      numberOfConcurrentTransactedReceivers=4
                      createMultipleTransactedReceivers=true
                      connected=true
                      supportedProtocols=[jms]
                      serviceOverrides=<none>
                    }
                    ,  name='endpoint.jms.QUEUE.NAME', mep=ONE_WAY, properties= 
{connector=WebsphereMQConnector_GW}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, 
 timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, 
 endpointEncoding=UTF-8, disableTransportTransformer=false}

I also tried providing a selector as mentioned below, and it still errors

&amp;selector=JMSCorrelationID%3D'#[message.outboundProperties.MULE_CORRELATION_ID]

It errors if I either mention the connector or don't mention the connector.

Error trace when using connector:

Root Exception stack trace:
org.mule.transaction.IllegalTransactionStateException: Only a single resource can be bound to this type of transaction
    at org.mule.transaction.AbstractSingleResourceTransaction.bindResource(AbstractSingleResourceTransaction.java:128)
    at org.mule.transport.jms.JmsTransaction.bindResource(JmsTransaction.java:54)
    at org.mule.transport.jms.JmsConnector.getSession(JmsConnector.java:669)
    at org.mule.transport.jms.JmsMessageRequester.doRequest(JmsMessageRequester.java:81)
    at org.mule.transport.AbstractMessageRequester.request(AbstractMessageRequester.java:94)
    at org.mule.transport.AbstractConnector.request(AbstractConnector.java:2270)
    at org.mule.endpoint.DefaultInboundEndpoint.request(DefaultInboundEndpoint.java:80)
    at org.mule.client.DefaultLocalMuleClient.requestMessage(DefaultLocalMuleClient.java:215)
    at org.mule.client.DefaultLocalMuleClient.request(DefaultLocalMuleClient.java:205)
    at org.mule.module.MuleRequesterModule.request(MuleRequesterModule.java:60)

Please could you suggest why this is causing error even though i have done exactly how defined in mule documents

Sambit Swain
  • 131
  • 1
  • 13

1 Answers1

1

UnregistrableEndpoint seems to indicate that there was a problem trying to create the endpoint. Try to use the same JMS endpoint to start a flow normally, without using the Mule Requester, to see if there is a connectivity issue or some other problem.

You didn't provide the complete example and error for the selector issue, but the syntax for using the expression inside a string seems incorrect.

aled
  • 21,330
  • 3
  • 27
  • 34
  • I have used both below, and couldn't connect: 1. resource="#['jms://QUEUE.NAME?connector=WebsphereMQConnector_GW']" 2. resource="#['jms://QUEUE.NAME?connector=WebsphereMQConnector_GW&selector=CID%3D'+message.outboundProperties.MULE_CORRELATION_ID]" Used the same connector and queue in jms:inbound-endpoint and it connects fine – Sambit Swain Aug 05 '20 at 19:14
  • Please add the full flow (in XML) to the description. – aled Aug 05 '20 at 21:22
  • I managed to get this working, seems like the issue was only if I use a JMS connector for Cluster queue manager. But when I changed the JMS connector to refer a Local queue manager, it worked absolutely fine... – Sambit Swain Aug 13 '20 at 12:23
  • Did it work without Mule requester with the cluster queue? – aled Aug 13 '20 at 13:43
  • Yes, jms:inbound-endpoint (i.e. without mulerequester) works fine with cluster queue. But with mulerequester, i was only able to connect to local queue. – Sambit Swain Aug 14 '20 at 07:47
  • It may be a limitation of the method the Mule Requester uses, which is not fully the same as using an inbound endpoint. The JMS connector for Mule 4 has a built in consume operation that implements it natively. – aled Aug 14 '20 at 14:03
  • We have a jms:selector to filter the message from the queue, but I cannot use this in middle of my flow. That's why I preferred mulerequester. But, thanks a lot for you help, your clue about unregistered endpoint actually helped – Sambit Swain Aug 14 '20 at 17:14