Quantcast

Netty - two way communication

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Netty - two way communication

alireza

Hi,

I have a question in using Netty component, let me explain the scenario:

1- We have a tcp server(consumer endpoint, using netty listening on port 1234)
2- A tcp client connects to the server (port 1234)
3- Once tcp client is connected, server should be able to send messages to the client through the connected channel(and also receives reply), and the same for the client(send/receive).

In fact the purpose is to have a two-way(bi-directional) async messaging between two peers.

As far as I see in Camel Netty component, producer will always create a new connection, is it possible to re-use
an already established connection(on a consumer endpoint) to send a message?

Would appreciate your help.

Thanks
Alireza

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Netty - two way communication

Claus Ibsen-2
On Sat, Sep 22, 2012 at 1:10 AM, alireza <[hidden email]> wrote:

>
> Hi,
>
> I have a question in using Netty component, let me explain the scenario:
>
> 1- We have a tcp server(consumer endpoint, using netty listening on port
> 1234)
> 2- A tcp client connects to the server (port 1234)
> 3- Once tcp client is connected, server should be able to send messages to
> the client through the connected channel(and also receives reply), and the
> same for the client(send/receive).
>
> In fact the purpose is to have a two-way(bi-directional) async messaging
> between two peers.
>

This is not currently supported. There is a number of JIRA tickets
about this, for the camel-mina2 component.
But when done should be able to port that logic to netty as well.



> As far as I see in Camel Netty component, producer will always create a new
> connection, is it possible to re-use
> an already established connection(on a consumer endpoint) to send a message?
>
> Would appreciate your help.
>
> Thanks
> Alireza
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Netty-two-way-communication-tp5719736.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Netty - two way communication

alireza
Hi Claus,

Thanks for your feedback. For the meantime i have implemented a temporary solution which based on that updated Netty component in order to get a reference to an existing Consumer object(attached to an endpoint) from inside Producer object. Then will be able to access active channel created in consumer from inside producer to send message over the channel. Not sure if this the right way of doing that :)

--alireza
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Netty - two way communication

bhavin.mehta
Hi Alireza,

Do you mind to share some more information about how did you achieve this?

Did you update Netty component itself or some other means?

I need to do same thing and looks like I am not able to find the solution.

Regards

Bhavin
Loading...