问题
I have requirement where in I need to read message from a JMS Queue from inside a Component.
But during this process the session variables associated with the message are missing.
But the session variables are available when the same message is read from JMS:inbound-endpoint instead of from inside a component.
Here are my sample flows.
Main flow sets a session-variable into MuleMessage and posts it onto a JMS:outbound-endpoint
<flow name="main-flow" >
<some inbound>
...
< Some processing >
<set-session-variable .... />
...
<jms:outbound-endpoint queue="myQueue1">
</flow>
When the message is read from a JMS:inbound-endpoint the session variable can be seen in the message.
<flow name="second-flow" >
<jms:inbound-endpoint queue="myQueue1" />
<logger level="INFO" />
...
< some processing />
</flow>
But when the message is read from the Component polling the JMS:queue the session variable is missing.
<flow name="third-flow" >
<quartz:inbound-endpoint repeat-interval="5 mins" />
....
<component>
<spring-object bean="MyComponent"/>
</component>
....
</flow>
MyComponent class's onCall method has the following code to read from the JMS queue.
String reqURL = "jms://" + queueName ;
muleMessage = eventContext.requestEvent(reqURL, 1000);
But the session variable is not present in the Mule Message.
来源:https://stackoverflow.com/questions/19368074/mule-session-variable-missing-from-the-message-when-reading-from-jms-queue-insi