Mule session-variable missing from the message, when reading from JMS Queue inside a Component

两盒软妹~` 提交于 2020-01-17 06:41:37

问题


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

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