You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by GERARD Vincent AWL-IT <vi...@atosorigin.com> on 2009/09/08 17:09:30 UTC
Question on Message writing
Hi everyone,
(I hope this time my post will appear in the list :-))
I'm implementing the network layer of an application, using Mina 1.1.7.
I have 2 questions for you:
1)Is it possible to add another information to a message we want to send
(using IoSession.write) that will be echoed in the reply ? ( I think to
some sort of header/footer like in JMS or MQSeries).
2)Does Mina keeps the order of the messages sending when replies are
dispatched? In another words: if I do multiple IoSession.write(), do I
receive the messageSent() in the same order I do the write ?
Thanks for your help,
Vincent Gerard
Software Engineer
O&D - Atos Worldline SA/NV
Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg
- 1130 Brussels - Belgium
RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872
Bankrekening-Compte Bancaire-Bank Account 310-0269424-44
BIC BBRUBEBB - IBAN BE55 3100 2694 2444
"The information contained in this e-mail and any attachment thereto is confidential and may contain information which is protected by intellectual property rights.
This information is intended for the exclusive use of the recipient(s) named above.
This e-mail does not constitute any binding relationship or offer toward any of the addressees.
If you are not one of the addressees , one of their employees or a proxy holder entitled to hand over this message to the addressee(s), any use of the information contained herein (e.g. reproduction, divulgation, communication or distribution,...) is prohibited.
If you have received this message in error, please notify the sender and destroy it immediately after.
The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorized amendment, for which we accept no liability."
Re: Question on Message writing
Posted by Emmanuel Lecharny <el...@apache.org>.
In any case, I would gather all the elements inorder to send only one
message instead of many. It's more efficient.
On Mon, Sep 14, 2009 at 7:28 AM, Christopher Popp
<ch...@yahoo.com> wrote:
>
>
>
>>> 2)Does Mina keeps the order of the messages sending when replies are
>>> dispatched? In another words: if I do multiple IoSession.write(), do I
>>> receive the messageSent() in the same order I do the write ?
>>
>>I am really not sure on this, but I think it will, unless you have a
>>Executor down in the Chain.
>>
>>Anyone?
>
>
> For each session, the order of messages being received should be the same as they are sent. The default behavior of the ExecutorFilter is to provide an OrderedThreadPoolExecutor, which will continue to maintain the order of events per session. Setting up the ExecutorFilter with an UnorderedThreadPoolExecutor would result in things possibly getting out of order.
>
> Chris Popp
>
>
>
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: Question on Message writing
Posted by Christopher Popp <ch...@yahoo.com>.
>> 2)Does Mina keeps the order of the messages sending when replies are
>> dispatched? In another words: if I do multiple IoSession.write(), do I
>> receive the messageSent() in the same order I do the write ?
>
>I am really not sure on this, but I think it will, unless you have a
>Executor down in the Chain.
>
>Anyone?
For each session, the order of messages being received should be the same as they are sent. The default behavior of the ExecutorFilter is to provide an OrderedThreadPoolExecutor, which will continue to maintain the order of events per session. Setting up the ExecutorFilter with an UnorderedThreadPoolExecutor would result in things possibly getting out of order.
Chris Popp
Re: Question on Message writing
Posted by Ashish <pa...@gmail.com>.
On Tue, Sep 8, 2009 at 8:39 PM, GERARD Vincent AWL-IT
<vi...@atosorigin.com> wrote:
> Hi everyone,
> (I hope this time my post will appear in the list :-))
>
> I'm implementing the network layer of an application, using Mina 1.1.7.
> I have 2 questions for you:
> 1)Is it possible to add another information to a message we want to send
> (using IoSession.write) that will be echoed in the reply ? ( I think to
> some sort of header/footer like in JMS or MQSeries).
Yup, using the ProtocolEncoder or Filters
> 2)Does Mina keeps the order of the messages sending when replies are
> dispatched? In another words: if I do multiple IoSession.write(), do I
> receive the messageSent() in the same order I do the write ?
I am really not sure on this, but I think it will, unless you have a
Executor down in the Chain.
Anyone?
--
thanks
ashish
Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal