简体   繁体   中英

WSO2 ESB message id

Do I have any possibility to find message on WSO2 ESB by MessageId, like urn:uuid:e11893c5-b033-4e99-9473-a43d66b65fbb ? For example if some flow failed and server logged such ID.

Maryan,

ESB itself doesn't log messages anywhere until you tell it to.

a) The first approach is to write incoming and outgoing messages into the log using log mediator:

<proxy xmlns="http://ws.apache.org/ns/synapse" name="YourProxyService" transports="https http" startOnLoad="true">
<target>
    <inSequence>
        <log level="full">
           <property name="MESSAGE_ID" expression="get-property('MessageID')"/>
        </log>
         ...
    </inSequence>
    <outSequence>
        <log level="full">
           <property name="MESSAGE_ID" expression="get-property('MessageID')"/>
        </log>
         ...
    </outSequence>
</target>
</proxy>

Then you'll be able to find your incoming and outgoing messages in log files as the logs would contains something like following:

 INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://localhost:9763/services/YourProxyService, From: 127.0.0.1, WSAction: urn:mediate, SOAPAction: urn:mediate, Direction: request, MESSAGE_ID = urn:uuid:e11893c5-b033-4e99-9473-a43d66b65fbb , Envelope:  <ENVELOPE_GOES_HERE>

b) Another approach would be to create table in the database and store message id and envelope to it.

Hope this helps. Vladimir.

UPD: You can also use built in SOAP tracer, but enable it with caution - it hits ESB performance. So I suggest use it only for short term debugging activities.

是的,您可以使用属性介体获取消息ID,

<property name="MessageID" expression="get-property('MessageID')"/>

As others pointed out, you can use log statements in WSO2 ESB to log the messages and search and find later.

But it becomes complex when the message flow fails at some point, as the message IDs will be different across different message flows. A simple approach would be to read the incoming messagID and use it till the final response message.

Have a look here for detailed explanation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM