0

I want to build a logger that logs all incoming requests and their response to a database. For this I created an axis2 module that should do this in the Inflow and the Outflow - I do not want to trigger the logging from the sequences, because then I would need to put the logger in all my services.

My problem is: how can I relate the incoming message in ESB to the return message? I think this is where Synapse comes in, but I cannot find the right properties to link the messages together: there is no messageId or correlationid that I can use to do this.

Is there a way to access the Synapse properties of the message in the axis2 handler?

Community
  • 1
  • 1
  • check this question which is similar to yours http://stackoverflow.com/questions/28900053/wso2-esb-tracking-request-response – Jenananthan Mar 09 '15 at 12:08

1 Answers1

1

Axis2 module is a right option. To identify request and responses, you can check the messageIDs. And if you want to access request messagecontext in the relavant responsemessage context try following code block;

MessageContext requestMessageCtx = responseMessageCtx.getOperationContext()
      .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

Here is a blog post

Ratha
  • 9,434
  • 17
  • 85
  • 163