Marian
Marian

Reputation: 387

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.

Upvotes: 5

Views: 4963

Answers (3)

Muralidharan.rade
Muralidharan.rade

Reputation: 2346

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.

Upvotes: 0

Vladimir Klevko
Vladimir Klevko

Reputation: 181

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.

Upvotes: 4

Ragavan
Ragavan

Reputation: 997

Yes, you can get the message ID using property mediator,

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

Upvotes: 1

Related Questions