2015-06-19 161 views
0

我有JMS消息处理JMS在ESB WSO2消息

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
 
<content> 
 
    <entry type="1"> 
 
     <textMessage JMSDeliveryMode="2" JMSDestination="queue:///QUEUE" JMSExpiration="0" JMSMessageID="ID:c3e2d840d8e3c1f14040404040404040cf1eba01c4eff036" JMSPriority="4" JMSRedelivered="false" JMSTimestamp="1434705226223" fromQueue="true" codec="Base64"> 
 
      <text>dGVzdA==</text> 
 
     </textMessage> 
 
    </entry> 
 
</content>

但是当我把它变成WSO2 ESB它进入SOAP信封,我不能够检索在这里的属性,如JMSDestination等
我想读取WSO2 ESB中的这些细节。有没有办法? 从JMS获取消息后,我得到以下SOAP消息,并且正在进行日志记录,或者xPath仅在此消息中起作用。

[2015-06-22 11:08:33,632] INFO - LogMediator To: , WSAction: urn:mediate, SOAPA 
 
ction: urn:mediate, MessageID: ID:c3e2d840d8e3c1f14040404040404040cf224f7f3bbf47 
 
25, Direction: request, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv 
 
:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Bod 
 
y>test1</soapenv:Body></soapenv:Envelope>

感谢

+0

你能告诉我们你从队列中读取的wso2代理吗?然后你可以用这样的XPath表达式访问你的元素:'' – FiveO

回答

0

我在我的发送代理设置JMS标头这样。

在接收代理,然后你可以使用get属性访问属性类似下面的例子。

<log level="custom"> 
     <property name="Autodeploy_TSONL_CreateProxyTarget - Config Params transport intervall " 
        expression="get-property('transport','TRANSPORT_TRANSFERINTERVALL')"/> 

希望有所帮助。

+0

不知何故设置标题的来源没有显示在我的答案。希望这一次它可以工作。

0

您可以选择从邮件正文中(即使是供内部使用SOAP信封),在您的inSequence中下面的代码的任何信息:

<property name="JMSDestination" expression="$body/content/entry/textMessage/@JMSDestination"/> 

验证您的消息正在使用适当的消息生成器进行生成,否则您无法看到消息圣人的内容。看到这个JMS代理示例:

<?xml version="1.0" encoding="UTF-8"?> 
<proxy xmlns="http://ws.apache.org/ns/synapse" name="JMSProxyName" transports="jms" startOnLoad="true" trace="disable"> 
    <target> 
     <inSequence> 
      <log level="custom"> 
       <property name="Log JMSDestination" expression="$body/content/entry/textMessage/@JMSDestination"/> 
      </log> 
      <drop/> 
     </inSequence> 
     <outSequence/> 
     <faultSequence/> 
    </target> 
    <parameter name="transport.jms.ContentType"> 
     <rules> 
      <jmsProperty>contentType</jmsProperty> 
      <default>application/xml</default> 
     </rules> 
    </parameter> 
    <parameter name="transport.jms.Destination">YourQueue</parameter> 
</proxy> 
+0

它不返回任何东西,它只考虑SOAP返回消息,而不是我已经提到的JMS消息 –

+0

在inSequence中放入一个“'作为第一个介体并检查您的内容。 – FiveO

+0

它只会给消息的肥皂信封,谢谢你我已经得到如何访问这些属性 –