Ruwan,
 I agree. That works for synchronous call 

All request and response messages I will send to same queue.

In Asynchronous call , we wont wait for response in ESB, we can set property 
for request message before sending to the queue. The response we wont get 
immediate from the back end so the flow terminates there.

Example: Asynchronous call I have 2 flows one for request processing and 
another for response processing.
Request flow once I received message from client I will save req message to 
queue and I will send message to back end service and I wont wait for response 
in request flow ,I will send response to client says that I received your 
request it is under process.

In response flow , assume after 2 days I got response from back end to my 
ESB,my response flow will pick up and send to the client that response. So in 
this case how we handle UUID for both request and response.


For audit purpose I need to take request message + response message and put 
under one SOAP message.


Thanks
basher


-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Ruwan Linton
Sent: Tuesday, March 31, 2009 10:21 AM
To: [email protected]
Subject: Re: [esb-java-dev] Logging

Kattubadi Basher Ahamed wrote:
> Thanks.
> I agree I can set UUID for the property but..
>
> Once I receive response from the back end to message flow how I know that, 
> that response is for the 1st request-response or 2nd request-response.
>   
So basically you send the response message to the same queue right? so when the 
other flow fetches the messages and tries to merge them (request and the 
response), you can check the equivalence of this property.

Synapse copies all the properties from the request to the response so that this 
property will be copied back to the response from the request.

Did you get the point? So basically you set the value for the property (for 
instance lets say "correlator"), then send the request message to the queue and 
invoke the back end service. Then once the response from the back end service 
arrives synapse, it copies all the properties in the request message to the 
response message, so that the property named "correlator" will also be copied 
and the value will be the same UUID that you set for the request. Then you put 
the response message to the queue. So, by looking at the messages where the 
property with key "correlator" have the same value, you can associate the 
request with the response. If there are messages which doesn't have a mapping 
another message, the response has not yet been arrived.

Thanks,
Ruwan
>
> -basher
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Ruwan Linton
> Sent: Tuesday, March 31, 2009 9:57 AM
> To: [email protected]
> Subject: Re: [esb-java-dev] Logging
>
> Hi Basher,
>
> You should be adding a UUID for the property with a given Key... and it 
> should be the same value for the response as well, and since it is a UUID no 
> tow different requests have the same value for the property. 
> This way you can correlate the request and the response.
>
> Thanks,
> Ruwan
>
> Kattubadi Basher Ahamed wrote:
>   
>> Ruwan,
>>   Assume we client1 and client2 sends request to ESB, I will add property in 
>> message context or in header in request flow before sending to queue.
>> If I receive response first for the client2-response instead of 
>> client1-response.how I need to correlate which response message need to set 
>> which request property.
>>
>>
>> thanks
>>  
>>
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of Ruwan Linton
>> Sent: Tuesday, March 31, 2009 8:52 AM
>> To: [email protected]
>> Subject: Re: [esb-java-dev] Logging
>>
>> Hi Basher,
>>
>> I think usage of the message id for this purpose is not the correct approach 
>> for this scenario. Assuming that this queue is an internal Java queue which 
>> stores the message context object you could use a property with a given name 
>> to associate the request and the response, so in the response flow these 
>> properties will be copied to the response.
>>
>> If you are storing these messages as SOAP or XML messages in a JMS queue or 
>> any other external queue I propose you to use a custom SOAP header to keep 
>> the information about the request / response association. In this particular 
>> case you will need to add the value for the response message before 
>> reporting to the queue, well same with the request I guess. You could still 
>> use a property to correlate the request and the response in the synapse flow.
>>
>> Thanks,
>> Ruwan
>>
>> Kattubadi Basher Ahamed wrote:
>>   
>>     
>>> HI,
>>>  I am designing Logging frame work in ESB. 
>>> My requirement is from ESB I will send request and reply to one Queue, and 
>>> another flow called audit flow  picks the request and response from that 
>>> Queue for particular client request/response and merge together and put 
>>> into Audit queue.
>>> For synchronous call I can provide same message id for request and reply   
>>> and audit flow can picks the message from the queue with similar messageid 
>>> messages and merge together.
>>> In case of Asynchronous message how we will maintain similar messageid for 
>>> both request and reply.
>>>
>>> Or is there any  suggestion to handle this or any  other design  you 
>>> propose.
>>>
>>> Please reply .
>>>
>>> Thanks in advance
>>> Basher
>>> _______________________________________________
>>> Esb-java-dev mailing list
>>> [email protected]
>>> https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
>>>
>>>   
>>>     
>>>       
>> --
>> Ruwan Linton
>> Senior Software Engineer & Product Manager; WSO2 ESB; 
>> http://wso2.org/esb
>> WSO2 Inc.; http://wso2.org
>> email: [email protected]; cell: +94 77 341 3097
>> blog: http://ruwansblog.blogspot.com
>>
>>
>> _______________________________________________
>> Esb-java-dev mailing list
>> [email protected]
>> https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
>>
>> _______________________________________________
>> Esb-java-dev mailing list
>> [email protected]
>> https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
>>
>>   
>>     
>
>
> --
> Ruwan Linton
> Senior Software Engineer & Product Manager; WSO2 ESB; 
> http://wso2.org/esb
> WSO2 Inc.; http://wso2.org
> email: [email protected]; cell: +94 77 341 3097
> blog: http://ruwansblog.blogspot.com
>
>
> _______________________________________________
> Esb-java-dev mailing list
> [email protected]
> https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
>
> _______________________________________________
> Esb-java-dev mailing list
> [email protected]
> https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
>
>   


--
Ruwan Linton
Senior Software Engineer & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: [email protected]; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com


_______________________________________________
Esb-java-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

_______________________________________________
Esb-java-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to