Search code examples
xmlwso2

Unable to push data to JMS queue


I am trying to push some data to a JMS queue, however, the data is blank when I see the message received on the queue. The number on enqueued message is increasing which means endpoint is being called correctly, but the data is not going through properly. I'm attaching my code below. Please let me know what can be corrected here.

<log level="custom">
    <property name="MockApi" value="After payload"/>
    <property expression="$ctx:XML" name="Payload"/>
</log>
<property name="messageType" scope="axis2" type="STRING" value="text/xml"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<call>
    <endpoint>
        <address format="soap11" uri="jms:/Check?transport.jms.ConnectionFactory=myQueueSender">
            <suspendOnFailure>
                <initialDuration>-1</initialDuration>
                <progressionFactor>1</progressionFactor>
            </suspendOnFailure>
            <markForSuspension>
                <retriesBeforeSuspension>0</retriesBeforeSuspension>
            </markForSuspension>
        </address>
    </endpoint>
</call>

The log is logging below:

MockApi = After payload, Payload = <prov><Name>wajih</Name></prov><prov><Name>Ali</Name></prov>

Please let me know if something wrong here.


Solution

  • Try the following.

    <log level="custom">
        <property name="MockApi" value="After payload"/>
        <property expression="$ctx:XML" name="Payload"/>
    </log>
    <enrich>
      <source clone="false" type="property" property="XML"/>
      <target action="replace" type="body"/>
    </enrich>
    <property name="messageType" scope="axis2" type="STRING" value="text/xml"/>
    <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
    <call>
        <endpoint>
            <address format="soap11" uri="jms:/Check?transport.jms.ConnectionFactory=myQueueSender">
                <suspendOnFailure>
                    <initialDuration>-1</initialDuration>
                    <progressionFactor>1</progressionFactor>
                </suspendOnFailure>
                <markForSuspension>
                    <retriesBeforeSuspension>0</retriesBeforeSuspension>
                </markForSuspension>
            </address>
        </endpoint>
    </call>