You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Michael Bauroth <mi...@falcom.de> on 2006/09/06 16:42:41 UTC

MINA design question

Hi,

I have only a small question:

I want to implement a behaviour of a command queue. This means, that I 
want to send sequentially a lot of commands one by one. Each of the 
commands should be sent only, if a response from the other side comes in 
for the previous command.

For this part the trafficmask would be the best choice, or?

But what is, when I want additionally store the commands in an internal 
queue, so that if a timeout occurs, I can send the same command once 
more or if the response says all is correct I can delete this command 
and process with the next send?

Do you have an idea, how can I solve this behaviour in a Mina correct 
way? Any help is very appreciated!!!

Regards
Michael

Re: MINA design question

Posted by Michael Bauroth <mi...@falcom.de>.
Thanx Trustin! :)

Regards
Michael

Trustin Lee wrote:
> Hi Michael,
> 
> On 9/6/06, Michael Bauroth <mi...@falcom.de> wrote:
> 
>>
>> Hi,
>>
>> I have only a small question:
>>
>> I want to implement a behaviour of a command queue. This means, that I
>> want to send sequentially a lot of commands one by one. Each of the
>> commands should be sent only, if a response from the other side comes in
>> for the previous command.
>>
>> For this part the trafficmask would be the best choice, or?
> 
> 
> 
> You don't need to use traffic mask in this case.  You can simply want for
> the response of the previous request in messageReceived, and write another
> request there.  The only exception is that you have to write the first
> request in sessionOpened().  That's all.
> 
> But what is, when I want additionally store the commands in an internal
> 
>> queue, so that if a timeout occurs, I can send the same command once
>> more or if the response says all is correct I can delete this command
>> and process with the next send?
> 
> 
> 
> Then you have to implement a special queue that handles response timeout.
> Actually we are trying to provide a solution for your problem:
> 
> http://issues.apache.org/jira/browse/DIRMINA-92
> 
> Please stay tuned, or you could borrow the idea of the patches.
> 
> Trustin

Re: MINA design question

Posted by Trustin Lee <tr...@gmail.com>.
Hi Michael,

On 9/6/06, Michael Bauroth <mi...@falcom.de> wrote:
>
> Hi,
>
> I have only a small question:
>
> I want to implement a behaviour of a command queue. This means, that I
> want to send sequentially a lot of commands one by one. Each of the
> commands should be sent only, if a response from the other side comes in
> for the previous command.
>
> For this part the trafficmask would be the best choice, or?


You don't need to use traffic mask in this case.  You can simply want for
the response of the previous request in messageReceived, and write another
request there.  The only exception is that you have to write the first
request in sessionOpened().  That's all.

But what is, when I want additionally store the commands in an internal
> queue, so that if a timeout occurs, I can send the same command once
> more or if the response says all is correct I can delete this command
> and process with the next send?


Then you have to implement a special queue that handles response timeout.
Actually we are trying to provide a solution for your problem:

http://issues.apache.org/jira/browse/DIRMINA-92

Please stay tuned, or you could borrow the idea of the patches.

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6