You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Alejandro Calbazana <al...@calbazana.com> on 2008/09/24 12:51:34 UTC

Asynch Messaging and Mediators

Hi,

What is the recommended way to perform asynch messaging with a callout 
mediator?  Or is this recommended at all?

Thanks,

Alejandro



Re: Asynch Messaging and Mediators

Posted by Paul Fremantle <pz...@gmail.com>.
Alejandro

We can easily do this model using the callout mediator. The problem is
it will block a thread, which is bad.
What I'm wondering is if we can figure out is a way to do a sort of
continuation. In other words, do an async call and specify which
sequence and maybe some context that should handle the response.

Paul

On Thu, Sep 25, 2008 at 3:01 PM, Asankha C. Perera <as...@wso2.com> wrote:
> Alejandro
>>
>> I'm thinking that a simple event/notification model might work here.
>>  Which leads me back to my question about correlation strategies (possibly a
>> JMS pub/sub model).  Is it a non-trivial task to translate WS-addressing
>> properties to JMS header properties and back again?
>
> Sorry but I haven't followed your full thread since Ruwan was replying..
> however, the JMS transport does and is able to correlate messages on the
> correlation ID.
>
> asankha
>



-- 
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

Re: Asynch Messaging and Mediators

Posted by "Asankha C. Perera" <as...@wso2.com>.
Alejandro
> I'm thinking that a simple event/notification model might work here.  
> Which leads me back to my question about correlation strategies 
> (possibly a JMS pub/sub model).  Is it a non-trivial task to translate 
> WS-addressing properties to JMS header properties and back again?
Sorry but I haven't followed your full thread since Ruwan was replying.. 
however, the JMS transport does and is able to correlate messages on the 
correlation ID.

asankha

Re: Asynch Messaging and Mediators

Posted by Alejandro Calbazana <al...@calbazana.com>.
Hi Ruwan,

True, this could be handled by BPEL.  However, I think BPM might be 
overkill for this scenario as I don't necessarily need the entire 
process "managed".  I am, however, interested in key points in the 
process flow.  Specifically, when fulfillment occurs (or fails) and when 
billing occurs as it relates to an original order and line.

I'm thinking that a simple event/notification model might work here.  
Which leads me back to my question about correlation strategies 
(possibly a JMS pub/sub model).  Is it a non-trivial task to translate 
WS-addressing properties to JMS header properties and back again?  It 
sounds like a correlation and message store solutions are left up to 
each individual implementation.

Thanks,

Al

Ruwan Linton wrote:
> Hi Alejandro,
>
> I think you need BPEL to achieve your requirement, but at the same time you
> can use the synapse message mediation if you do not need to associate the
> order entry request message with the fulfillment agent response message to
> proceed to the billing (i.e. if it is possible to proceed only with the
> response from the fulfillment agent to the billing service without any
> parameters from the order entry request) it is possible to use the
> asynchronous send using the send mediator and get the response back to the
> proxy out flow and invoke the billing service. Then again the response comes
> to the proxy out flow from the billing service and we can do a message
> filtering to differentiate from the earlier response and send back to the
> client.
>
> At the same time it would be good to use the dual channel mode in doing the
> messaging from the client side. (Addressing separate listener or different
> reply-to model)
>
> Thanks,
> Ruwan
>
> On Wed, Sep 24, 2008 at 11:30 PM, Alejandro Calbazana <
> alejandro@calbazana.com> wrote:
>
>   
>> Hi Ruwan,
>>
>> I have a use case that relates to an ordering/fulfillment flow.  The flow
>> contains the following service endpoints:
>>
>> - Fulfillment Service
>> - Fulfillment Agent
>> - Billing Service
>> - Order Entry
>>
>> A simplified use case lays out as follows:
>>
>> Order Entry -> Fulfillment Service -> Fulfillment Agent -> Fulfillment
>> Service (reply) -> Billing Service -> Order Entry (reply)
>>
>> Where:
>>
>> - Order entry submits an order for processing.
>> - The fulfillment service picks up the order and performs content based
>> routing to find the appropriate fulfillment agent
>> - The fulfillment agent performs the fulfillment steps necessary (this may
>> be a long running step)
>> - The fulfillment agent returns control back to the fulfillment service who
>> then prepares a billing request
>> - The fulfillment service then replies back to the order entry system with
>> an reacknowledgment
>>
>> I'd be interested in how async replies are typically managed.  Is it
>> recommended to host a callback endpoint, on one or more transports, and
>> expect this endpoint to perform correlation?  If so, how does correlation
>> work when you have mixed transports?  I'd also be interested in approaches
>> to message tracking and message storage.  If there are long running
>> requests, does this imply that the interested service needs to create a
>> custom message store in order to do correlation?
>>
>> I know this is a pretty broad, but I'm trying to get my head around proper
>> organization and usage patterns :)
>>
>> Thanks!
>>
>> Alejandro
>>
>>
>>
>> Ruwan Linton wrote:
>>
>>     
>>> Hi Alejandro,
>>>
>>> Callout mediator is NOT intended to use for the async messaging it is to
>>> do
>>> blocking calls to an external web service. You could use the send mediator
>>> with the nhttp transport to achieve full async messaging system.
>>>
>>> If you could elaborate more on your exact requirement I can help you to
>>> select the best possible solution....
>>>
>>> Thanks,
>>> Ruwan
>>>
>>> On Wed, Sep 24, 2008 at 4:21 PM, Alejandro Calbazana <
>>> alejandro@calbazana.com> wrote:
>>>
>>>
>>>
>>>       
>>>> Hi,
>>>>
>>>> What is the recommended way to perform asynch messaging with a callout
>>>> mediator?  Or is this recommended at all?
>>>>
>>>> Thanks,
>>>>
>>>> Alejandro
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>         
>>>
>>>
>>>       
>>     
>
>
>   


Re: Asynch Messaging and Mediators

Posted by Ruwan Linton <ru...@gmail.com>.
Hi Alejandro,

I think you need BPEL to achieve your requirement, but at the same time you
can use the synapse message mediation if you do not need to associate the
order entry request message with the fulfillment agent response message to
proceed to the billing (i.e. if it is possible to proceed only with the
response from the fulfillment agent to the billing service without any
parameters from the order entry request) it is possible to use the
asynchronous send using the send mediator and get the response back to the
proxy out flow and invoke the billing service. Then again the response comes
to the proxy out flow from the billing service and we can do a message
filtering to differentiate from the earlier response and send back to the
client.

At the same time it would be good to use the dual channel mode in doing the
messaging from the client side. (Addressing separate listener or different
reply-to model)

Thanks,
Ruwan

On Wed, Sep 24, 2008 at 11:30 PM, Alejandro Calbazana <
alejandro@calbazana.com> wrote:

> Hi Ruwan,
>
> I have a use case that relates to an ordering/fulfillment flow.  The flow
> contains the following service endpoints:
>
> - Fulfillment Service
> - Fulfillment Agent
> - Billing Service
> - Order Entry
>
> A simplified use case lays out as follows:
>
> Order Entry -> Fulfillment Service -> Fulfillment Agent -> Fulfillment
> Service (reply) -> Billing Service -> Order Entry (reply)
>
> Where:
>
> - Order entry submits an order for processing.
> - The fulfillment service picks up the order and performs content based
> routing to find the appropriate fulfillment agent
> - The fulfillment agent performs the fulfillment steps necessary (this may
> be a long running step)
> - The fulfillment agent returns control back to the fulfillment service who
> then prepares a billing request
> - The fulfillment service then replies back to the order entry system with
> an reacknowledgment
>
> I'd be interested in how async replies are typically managed.  Is it
> recommended to host a callback endpoint, on one or more transports, and
> expect this endpoint to perform correlation?  If so, how does correlation
> work when you have mixed transports?  I'd also be interested in approaches
> to message tracking and message storage.  If there are long running
> requests, does this imply that the interested service needs to create a
> custom message store in order to do correlation?
>
> I know this is a pretty broad, but I'm trying to get my head around proper
> organization and usage patterns :)
>
> Thanks!
>
> Alejandro
>
>
>
> Ruwan Linton wrote:
>
>> Hi Alejandro,
>>
>> Callout mediator is NOT intended to use for the async messaging it is to
>> do
>> blocking calls to an external web service. You could use the send mediator
>> with the nhttp transport to achieve full async messaging system.
>>
>> If you could elaborate more on your exact requirement I can help you to
>> select the best possible solution....
>>
>> Thanks,
>> Ruwan
>>
>> On Wed, Sep 24, 2008 at 4:21 PM, Alejandro Calbazana <
>> alejandro@calbazana.com> wrote:
>>
>>
>>
>>> Hi,
>>>
>>> What is the recommended way to perform asynch messaging with a callout
>>> mediator?  Or is this recommended at all?
>>>
>>> Thanks,
>>>
>>> Alejandro
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>


-- 
Ruwan Linton
http://wso2.org - "Oxygenating the Web Services Platform"
http://ruwansblog.blogspot.com/

Re: Asynch Messaging and Mediators

Posted by Alejandro Calbazana <al...@calbazana.com>.
Hi Ruwan,

I have a use case that relates to an ordering/fulfillment flow.  The 
flow contains the following service endpoints:

- Fulfillment Service
- Fulfillment Agent
- Billing Service
- Order Entry

A simplified use case lays out as follows:

Order Entry -> Fulfillment Service -> Fulfillment Agent -> Fulfillment 
Service (reply) -> Billing Service -> Order Entry (reply)

Where:

- Order entry submits an order for processing.
- The fulfillment service picks up the order and performs content based 
routing to find the appropriate fulfillment agent
- The fulfillment agent performs the fulfillment steps necessary (this 
may be a long running step)
- The fulfillment agent returns control back to the fulfillment service 
who then prepares a billing request
- The fulfillment service then replies back to the order entry system 
with an reacknowledgment

I'd be interested in how async replies are typically managed.  Is it 
recommended to host a callback endpoint, on one or more transports, and 
expect this endpoint to perform correlation?  If so, how does 
correlation work when you have mixed transports?  I'd also be interested 
in approaches to message tracking and message storage.  If there are 
long running requests, does this imply that the interested service needs 
to create a custom message store in order to do correlation?

I know this is a pretty broad, but I'm trying to get my head around 
proper organization and usage patterns :)

Thanks!

Alejandro


Ruwan Linton wrote:
> Hi Alejandro,
>
> Callout mediator is NOT intended to use for the async messaging it is to do
> blocking calls to an external web service. You could use the send mediator
> with the nhttp transport to achieve full async messaging system.
>
> If you could elaborate more on your exact requirement I can help you to
> select the best possible solution....
>
> Thanks,
> Ruwan
>
> On Wed, Sep 24, 2008 at 4:21 PM, Alejandro Calbazana <
> alejandro@calbazana.com> wrote:
>
>   
>> Hi,
>>
>> What is the recommended way to perform asynch messaging with a callout
>> mediator?  Or is this recommended at all?
>>
>> Thanks,
>>
>> Alejandro
>>
>>
>>
>>     
>
>
>   


Re: Asynch Messaging and Mediators

Posted by Ruwan Linton <ru...@gmail.com>.
Hi Alejandro,

Callout mediator is NOT intended to use for the async messaging it is to do
blocking calls to an external web service. You could use the send mediator
with the nhttp transport to achieve full async messaging system.

If you could elaborate more on your exact requirement I can help you to
select the best possible solution....

Thanks,
Ruwan

On Wed, Sep 24, 2008 at 4:21 PM, Alejandro Calbazana <
alejandro@calbazana.com> wrote:

> Hi,
>
> What is the recommended way to perform asynch messaging with a callout
> mediator?  Or is this recommended at all?
>
> Thanks,
>
> Alejandro
>
>
>


-- 
Ruwan Linton
http://wso2.org - "Oxygenating the Web Services Platform"
http://ruwansblog.blogspot.com/