Very odd Issue in Mule WMQ and JMS flows
I am getting a weird issue on Mule 3.4. I basically setup a very simple
flow MsgRewards with a private flow msgPrivateFlow call. The reason I must
use private flow instead of subflow is I need a specific catch exception
strategy on the private flow, msgPrivateFlow.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:management="http://www.mulesoft.org/schema/mule/management"
xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
xmlns:client="http://www.mulesoft.org/schema/mule/client"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/jms
http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd
http://www.mulesoft.org/schema/mule/ee/wmq
http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/3.4/mule.xsd
http://www.mulesoft.org/schema/mule/vm
http://www.mulesoft.org/schema/mule/vm/3.4/mule-vm.xsd
http://www.mulesoft.org/schema/mule/stdio
http://www.mulesoft.org/schema/mule/stdio/3.4/mule-stdio.xsd
http://www.mulesoft.org/schema/mule/management
http://www.mulesoft.org/schema/mule/management/3.4/mule-management.xsd
http://www.mulesoft.org/schema/mule/scripting
http://www.mulesoft.org/schema/mule/scripting/3.4/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/client
http://www.mulesoft.org/schema/mule/client/3.4/mule-client.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<context:property-placeholder
location="classpath:maf.properties"></context:property-placeholder>
<spring:beans>
<spring:import resource="classpath:spring.xml"></spring:import>
</spring:beans>
<!-- WMQ -->
<spring:bean id="ptiMsgMqFactoryBean1" name="ptiMsgMqFactory1"
class="com.ibm.mq.jms.MQConnectionFactory">
<spring:property name="channel" value="${pti.msg.mq.channel.1}"/>
<spring:property name="queueManager"
value="${pti.msg.mq.queueManager.1}"/>
<spring:property name="hostName" value="${pti.msg.mq.hostName.1}"/>
<spring:property name="port" value="${pti.msg.mq.port.1}"/>
</spring:bean>
<wmq:connector name="ptiMsgMqConnector.1"
connectionFactory-ref="ptiMsgMqFactory1"
numberOfConsumers="5"
maxRedelivery="-1"
targetClient="JMS_COMPLIANT"
transportType="CLIENT_MQ_TCPIP"
specification="1.1"
validateConnections="true"
cacheJmsSessions="true"
doc:name="WMQ Connector"
>
</wmq:connector>
<catch-exception-strategy name="Catch_Exception_Strategy">
<set-payload value="BBBBBB" doc:name="Set Payload"/>
</catch-exception-strategy>
<flow name="msgPrivateFlow" doc:name="msgPrivateFlow">
<set-payload value="AAAAAA"></set-payload>
<component class="com.Test1"/>
<exception-strategy ref="Catch_Exception_Strategy" />
</flow>
<!-- WMQ -->
<flow name="MsgRewards" doc:name="MsgRewards"
processingStrategy="synchronous">
<wmq:inbound-endpoint queue="${pti.msg.mq.inbound.rewards.queue}"
connector-ref="ptiMsgMqConnector.1"
doc:name="WMQ"></wmq:inbound-endpoint>
<flow-ref name="msgSubFlow" doc:name="Flow Reference"></flow-ref>
</flow>
<flow name="SimulatedResponseConsumerFlow"
doc:name="SimulatedResponseConsumerFlow">
<wmq:inbound-endpoint queue="${pti.msg.mq.outbound.rewards.queue}"
connector-ref="ptiMsgMqConnector.1"
doc:name="WMQ"></wmq:inbound-endpoint>
<logger message="Response: [#[payload]]" level="INFO"
doc:name="Logger"></logger>
</flow>
</mule>
com.Test1 is a component that I can kick Exception to trigger the catch
exception strategy. I then send a message (any characters) to the inbound
mq (without exception thrown in Test1). I got duplicated responses with
the same correlation id in the reply queue (I got 2 "AAAAAA" responses).
See the log below. The
com.mulesoft.mule.transport.wmq.transformers.ObjectToWMQJmsMessage was
executed twice before the resopnse messages are ready to drop to the reply
queue.
2013-09-05 16:48:03,324 INFO [DispatchThread: 1] [DispatchingLogger]
Loading default outbound transformer:
com.mulesoft.mule.transport.wmq.transformers.ObjectToWMQJmsMessage
2013-09-05 16:48:03,403 INFO [DispatchThread: 1] [DispatchingLogger]
Reply Message sent to: queue://DINTS1/LEI.TEST.2?targetClient=1 with
correlationID:ID:414d512044494e545331202020202020d614265208a7c020
2013-09-05 16:48:03,465 INFO [SimulatedResponseConsumerFlow.stage1.02]
[DispatchingLogger] Response: [AAAAAA]
2013-09-05 16:48:03,481 INFO [DispatchThread: 1] [DispatchingLogger]
Loading default outbound transformer:
com.mulesoft.mule.transport.wmq.transformers.ObjectToWMQJmsMessage
2013-09-05 16:48:03,496 INFO [DispatchThread: 1] [DispatchingLogger]
Reply Message sent to: queue://DINTS1/LEI.TEST.2?targetClient=1 with
correlationID:ID:414d512044494e545331202020202020d614265208a7c020
2013-09-05 16:48:03,496 INFO [SimulatedResponseConsumerFlow.stage1.02]
[DispatchingLogger] Response: [AAAAAA]
I changed the exchange-pattern to "request-response", and then I got only
one response "AAAAAA". However, it's not over yet!!!
if Test1 throws an exception in the private flow, I got 2 responses with
"BBBBBB" this time. ODD!! My questions are,
Is this a known issue OR a bug?
Can anyone let me know how to resolve this?
I really appreciate it.
-Lei
No comments:
Post a Comment