camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlo Camerino <carlo.camer...@gmail.com>
Subject Re: Question On Camel Mina - Multiple Messages With One IOSession
Date Wed, 03 Mar 2010 18:31:22 GMT
i used sync =true, i'm still got replies from another thread....

On Thu, Mar 4, 2010 at 2:20 AM, anandsk <skusma@arccorp.com> wrote:
>
> when you use from it becomes the consumer and listens on that port if your
> app is running on host.
>
> If you are trying to identify the corresponding reply to a request, I
> beleive you need to have something in message to identify it uniquely. other
> alternative is using synchronus request/reply by setting sync flag to true.
>
> Thanks,
> Anand
>
>
>
> carlo c wrote:
>>
>> i was able to use codec successfully,
>>
>> however, i am having problems with the replies,
>>
>> sometimes i get the reply of another thread using the camel mina
>> component.
>>
>> how do i ensure that i am getting the proper reply
>>
>> i used the following
>>
>> mina:tcp://host:port?codec=#codecFactory
>>
>> how can i ensure that the reply is for me?
>>
>> what i did was to limit the number of consumers to 1 however i don't
>> wnt to do this in the future,
>>
>> the alternative that i could think is to set a separate
>>
>> from("mina:tcp://host:port?codec=#codecFactory") thread, is this the
>> correct way to handle this  and set sync to false....
>>
>> On Wed, Mar 3, 2010 at 5:04 AM, anandsk <skusma@arccorp.com> wrote:
>>>
>>> If I understand your question correctly, you may want to look at codec
>>> option
>>> of camel-mina component.
>>>
>>> Thanks,
>>> Anand
>>>
>>>
>>> carlo c wrote:
>>>>
>>>> hi there,
>>>>
>>>> thanks a lot!!
>>>> i'm trying to understand the code in camel-mina and it seems that you
>>>> can configure it to signify that it is a textline? correct?
>>>> but what if the message returning isn't a text line.
>>>> In our case for example, the sample code that i use is
>>>>
>>>> dis.available() to determine if a message arrived,
>>>> afterwards, i configure a new byte[] in order to be able to read the
>>>> message
>>>>
>>>> Here is my source code using native java.io api
>>>> // input stream declaration coming from Socket
>>>> DataInputStream dis = **/
>>>> // i'm checking this method (dis.available()) --> this returns the
>>>> number of bytes that an incoming message contains
>>>> byte[] responseByte = new byte[dis.available()];
>>>> //
>>>> dis.readFully(responseByte);
>>>>
>>>> i somehow do it like this,
>>>> is there anyway that i can do this in camel mina?
>>>>  i need to be able to get a response via the size of the input stream
>>>> coming back.
>>>>
>>>> thanks
>>>> carlo
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Question-On-Camel-Mina---Multiple-Messages-With-One-IOSession-tp27756509p27761139.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Question-On-Camel-Mina---Multiple-Messages-With-One-IOSession-tp27756509p27771764.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Mime
View raw message