You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by ivan <iv...@dhousestudio.com> on 2008/08/07 15:49:28 UTC

Sync / async NMR

   Hi!

How can I send asynchronously NornilizedMessages in JBI-env of ServiceMix?

Should I use InOnly MEP as well as io.send() instead of io.sendSync()?

   Thanks,
   Ivan Pryvalov.


Re: Sync / async NMR

Posted by Lars Heinemann <la...@compart.net>.
When sending a InOut with send() your endpoint should be prepared to process 
the response message (will run through the process(MessageExchange exchange) 
method in the endpoint). In other words, the response will arrive on the same 
way in your endpoint as the request did, only the role will maybe switch 
between provider and consumer.

Lars



Am Donnerstag 07 August 2008 16:04:37 schrieb ivan:
> Lars Heinemann пишет:
> > Ivan,
> >
> > the MEP is not important as far as I know.
> > The only difference is the sending method.
> >
> > send() will send the message async
> > sendSync() as the name says sends sync
>
> What about if we have send() and MEP InOut? What is behaviour or 2
> services?
>
>
>    Thanks,
>    Ivan Pryvalov.
>
> > Lars
> >
> > Am Donnerstag 07 August 2008 15:49:28 schrieb ivan:
> >>    Hi!
> >>
> >> How can I send asynchronously NornilizedMessages in JBI-env of
> >> ServiceMix?
> >>
> >> Should I use InOnly MEP as well as io.send() instead of io.sendSync()?
> >>
> >>    Thanks,
> >>    Ivan Pryvalov.


Re: Sync / async NMR

Posted by Gert Vanthienen <ge...@skynet.be>.
Ivan,

Regardless of sync/async, the InOut MEP will always be handled as 
outlined in the 'invocation example' paragraph on 
http://servicemix.apache.org/5-jbi.html.

The only difference is that if you use sendSync on the consumer 
component side, the method call will not return before the entire 
invocation is finished.  Right after the method call, you have the full 
response message available.  However, this also means that the component 
thread, while waiting for the reponse, is unable to do anything else.

If you use a plain send(), the method call will return immediately and 
processing continues in the background.  The consumer component thread 
is available to do other work.  However, we still need to be able to 
find out about the reponse message.  Therefore, the consumer component 
will most likely implement the ExchangeProcessor interface, which has a 
process(MessageExchange) method that will be invoked on step4/5 to 
signal the availability of the reponse message.  It's the consumer 
reponsibility to send the DONE message to finish the Exchange.

Regards,

Gert


ivan wrote:
> Lars Heinemann пишет:
>> Ivan,
>>
>> the MEP is not important as far as I know.
>> The only difference is the sending method.
>>
>> send() will send the message async
>> sendSync() as the name says sends sync
>
> What about if we have send() and MEP InOut? What is behaviour or 2 
> services?
>
>
>   Thanks,
>   Ivan Pryvalov.
>
>>
>> Lars
>>
>>
>> Am Donnerstag 07 August 2008 15:49:28 schrieb ivan:
>>>    Hi!
>>>
>>> How can I send asynchronously NornilizedMessages in JBI-env of 
>>> ServiceMix?
>>>
>>> Should I use InOnly MEP as well as io.send() instead of io.sendSync()?
>>>
>>>    Thanks,
>>>    Ivan Pryvalov.
>>
>>
>
>


Re: Sync / async NMR

Posted by ivan <iv...@dhousestudio.com>.
Lars Heinemann пишет:
> Ivan,
> 
> the MEP is not important as far as I know.
> The only difference is the sending method.
> 
> send() will send the message async
> sendSync() as the name says sends sync

What about if we have send() and MEP InOut? What is behaviour or 2 services?


   Thanks,
   Ivan Pryvalov.

> 
> Lars
> 
> 
> Am Donnerstag 07 August 2008 15:49:28 schrieb ivan:
>>    Hi!
>>
>> How can I send asynchronously NornilizedMessages in JBI-env of ServiceMix?
>>
>> Should I use InOnly MEP as well as io.send() instead of io.sendSync()?
>>
>>    Thanks,
>>    Ivan Pryvalov.
> 
> 


Re: Sync / async NMR

Posted by Lars Heinemann <la...@compart.net>.
Ivan,

the MEP is not important as far as I know.
The only difference is the sending method.

send() will send the message async
sendSync() as the name says sends sync

Lars


Am Donnerstag 07 August 2008 15:49:28 schrieb ivan:
>    Hi!
>
> How can I send asynchronously NornilizedMessages in JBI-env of ServiceMix?
>
> Should I use InOnly MEP as well as io.send() instead of io.sendSync()?
>
>    Thanks,
>    Ivan Pryvalov.