无法将数据推送到JMS队列

huangapple go评论67阅读模式
英文:

Unable to push data to JMS queue

问题

我正在尝试将一些数据推送到JMS队列,但当我在队列上看到接收到的消息时,数据是空的。入队消息的数量正在增加,这意味着端点被正确调用,但数据没有正确传递。我附上我的代码如下:

<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>

日志记录如下:

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

请告诉我这里是否有什么问题。

英文:

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.

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

The log is logging below:

MockApi = After payload, Payload = &lt;prov&gt;&lt;Name&gt;wajih&lt;/Name&gt;&lt;/prov&gt;&lt;prov&gt;&lt;Name&gt;Ali&lt;/Name&gt;&lt;/prov&gt;

Please let me know if something wrong here.

答案1

得分: 0

尝试以下内容。

<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>
英文:

Try the following.

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

huangapple
  • 本文由 发表于 2023年6月26日 21:11:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76557028.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定