Generate GUID for header (X-Correlation-ConversationID) in wso2

47 views Asked by At

Hi guys can anyone please guide me how can I generate a guid for sending it in header before calling an endpoint. I am working in wso2 MI 7.2 Is the below line correct ? or what can be changed ?

<property name="X-Correlation-ConversationID" expression="uuid()" scope="transport" type="STRING"/>

Incase it should be done some other way please do let me know.

Thanks

1

There are 1 answers

2
tmoasz On

Maybe you can try use get-property('MessageID') exprssion.

<property name="X-Correlation-ConversationID" expression="get-property('MessageID')" scope="transport" type="STRING"/>

or extract only UUID using xpath substring function:

<property name="X-Correlation-ConversationID" expression="substring(get-property('MessageID'),10,36)" scope="transport" type="STRING"/>