How to build an outgoing tcp connection gateway that consumes messages?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

How to build an outgoing tcp connection gateway that consumes messages?

Thorsten
Hi all,

I have a problem that I need to solve and I would like to get a few ideas
about the best options on how to do it since I am new to Camel.

So I do need to implement a gateway to consume XML based messages from a
server. Initially I thought that Netty Consumer mode sounds like it would
match but it needs to be an outgoing tcp connection to the server. Here is
how it works:

There is a blackbox style server that is located somewhere performing some
kind of business logic. This server is listening on tcp port XYZ. Now if an
authorized IP address is connecting as a client to this port the server
immediately starts to dump XML debug messages to the connection. The client
doesn't need to do/send anything, just connect and then start to consume
the XML messages.

Now Camel is supposed to be the client consumer and I need to implement a
gateway that connects to the server and read the XML messages from the tcp
session. The gateway should also auto-reconnect in case the blackbox server
was rebooted or crashed or whatever.

Any good ideas about how to get this going? It would be very much
appreciated!

Thanks,

Thorsten
Reply | Threaded
Open this post in threaded view
|

Re: How to build an outgoing tcp connection gateway that consumes messages?

Claus Ibsen-2
Hi

We have some JIRA tickets about adding such functionality to
camel-mina2 and also camel-netty.
This would allow Camel to acts as a client and connect to a remote
server, and receive messages coming in to a route.

Though we haven't had the time yet to implement such functionality.


On Fri, Dec 14, 2012 at 3:34 PM, Thorsten Kunz <[hidden email]> wrote:

> Hi all,
>
> I have a problem that I need to solve and I would like to get a few ideas
> about the best options on how to do it since I am new to Camel.
>
> So I do need to implement a gateway to consume XML based messages from a
> server. Initially I thought that Netty Consumer mode sounds like it would
> match but it needs to be an outgoing tcp connection to the server. Here is
> how it works:
>
> There is a blackbox style server that is located somewhere performing some
> kind of business logic. This server is listening on tcp port XYZ. Now if an
> authorized IP address is connecting as a client to this port the server
> immediately starts to dump XML debug messages to the connection. The client
> doesn't need to do/send anything, just connect and then start to consume
> the XML messages.
>
> Now Camel is supposed to be the client consumer and I need to implement a
> gateway that connects to the server and read the XML messages from the tcp
> session. The gateway should also auto-reconnect in case the blackbox server
> was rebooted or crashed or whatever.
>
> Any good ideas about how to get this going? It would be very much
> appreciated!
>
> Thanks,
>
> Thorsten



--
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
|

Re: How to build an outgoing tcp connection gateway that consumes messages?

Thorsten
Thanks for the info Claus. This functionality would be a great help to my
task at hand.
Do you happen to have the issue ID so I can watch/vote for it?

Thanks

2012/12/15 Claus Ibsen <[hidden email]>

> Hi
>
> We have some JIRA tickets about adding such functionality to
> camel-mina2 and also camel-netty.
> This would allow Camel to acts as a client and connect to a remote
> server, and receive messages coming in to a route.
>
> Though we haven't had the time yet to implement such functionality.
>
>
> On Fri, Dec 14, 2012 at 3:34 PM, Thorsten Kunz <[hidden email]> wrote:
> > Hi all,
> >
> > I have a problem that I need to solve and I would like to get a few ideas
> > about the best options on how to do it since I am new to Camel.
> >
> > So I do need to implement a gateway to consume XML based messages from a
> > server. Initially I thought that Netty Consumer mode sounds like it would
> > match but it needs to be an outgoing tcp connection to the server. Here
> is
> > how it works:
> >
> > There is a blackbox style server that is located somewhere performing
> some
> > kind of business logic. This server is listening on tcp port XYZ. Now if
> an
> > authorized IP address is connecting as a client to this port the server
> > immediately starts to dump XML debug messages to the connection. The
> client
> > doesn't need to do/send anything, just connect and then start to consume
> > the XML messages.
> >
> > Now Camel is supposed to be the client consumer and I need to implement a
> > gateway that connects to the server and read the XML messages from the
> tcp
> > session. The gateway should also auto-reconnect in case the blackbox
> server
> > was rebooted or crashed or whatever.
> >
> > Any good ideas about how to get this going? It would be very much
> > appreciated!
> >
> > Thanks,
> >
> > Thorsten
>
>
>
> --
> 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
|

Re: How to build an outgoing tcp connection gateway that consumes messages?

Christian Mueller
Administrator
It could be this one: https://issues.apache.org/jira/browse/CAMEL-1077

I think only voting for it will not cause in a short time solution... ;-)
You may consider to work on this issue [1]? We love contributions with unit
tests... ;-)

[1] http://camel.apache.org/contributing.html

Best,
Christian

On Sun, Dec 16, 2012 at 7:46 PM, Thorsten Kunz <[hidden email]> wrote:

> Thanks for the info Claus. This functionality would be a great help to my
> task at hand.
> Do you happen to have the issue ID so I can watch/vote for it?
>
> Thanks
>
> 2012/12/15 Claus Ibsen <[hidden email]>
>
> > Hi
> >
> > We have some JIRA tickets about adding such functionality to
> > camel-mina2 and also camel-netty.
> > This would allow Camel to acts as a client and connect to a remote
> > server, and receive messages coming in to a route.
> >
> > Though we haven't had the time yet to implement such functionality.
> >
> >
> > On Fri, Dec 14, 2012 at 3:34 PM, Thorsten Kunz <[hidden email]> wrote:
> > > Hi all,
> > >
> > > I have a problem that I need to solve and I would like to get a few
> ideas
> > > about the best options on how to do it since I am new to Camel.
> > >
> > > So I do need to implement a gateway to consume XML based messages from
> a
> > > server. Initially I thought that Netty Consumer mode sounds like it
> would
> > > match but it needs to be an outgoing tcp connection to the server. Here
> > is
> > > how it works:
> > >
> > > There is a blackbox style server that is located somewhere performing
> > some
> > > kind of business logic. This server is listening on tcp port XYZ. Now
> if
> > an
> > > authorized IP address is connecting as a client to this port the server
> > > immediately starts to dump XML debug messages to the connection. The
> > client
> > > doesn't need to do/send anything, just connect and then start to
> consume
> > > the XML messages.
> > >
> > > Now Camel is supposed to be the client consumer and I need to
> implement a
> > > gateway that connects to the server and read the XML messages from the
> > tcp
> > > session. The gateway should also auto-reconnect in case the blackbox
> > server
> > > was rebooted or crashed or whatever.
> > >
> > > Any good ideas about how to get this going? It would be very much
> > > appreciated!
> > >
> > > Thanks,
> > >
> > > Thorsten
> >
> >
> >
> > --
> > 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
|

Re: How to build an outgoing tcp connection gateway that consumes messages?

ggalka
In reply to this post by Claus Ibsen-2
Hi,

what do you think, what would be the best/quickest way to implement tcp client message consumer in current Camel version ?

Best regards,
Grzegorz
Reply | Threaded
Open this post in threaded view
|

Re: How to build an outgoing tcp connection gateway that consumes messages?

valdar
One option is using camel-mina component: http://camel.apache.org/mina.html
andr, if necessary, writing your own custom codec.


On Thu, Jan 10, 2013 at 11:59 AM, ggalka <[hidden email]> wrote:

> Hi,
>
> what do you think, what would be the best/quickest way to implement tcp
> client message consumer in current Camel version ?
>
> Best regards,
> Grzegorz
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-build-an-outgoing-tcp-connection-gateway-that-consumes-messages-tp5724102p5725231.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
"In a world without walls and fences who needs Windows and Gates?"
Reply | Threaded
Open this post in threaded view
|

Re: How to build an outgoing tcp connection gateway that consumes messages?

ggalka
camel-mina for consuming messages (from(...)) uses tcp server connection (acts as a listener). I need to consume messages using client connection.
Reply | Threaded
Open this post in threaded view
|

Re: How to build an outgoing tcp connection gateway that consumes messages?

valdar
I think that camel-mina works also as a producer ( e.g. in a .to(...) )

Another option could be camel-netty component:
http://camel.apache.org/netty.html

Andrea.


On Thu, Jan 10, 2013 at 1:34 PM, ggalka <[hidden email]> wrote:

> camel-mina for consuming messages (from(...)) uses tcp server connection
> (acts as a listener). I need to consume messages using client connection.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-build-an-outgoing-tcp-connection-gateway-that-consumes-messages-tp5724102p5725261.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
"In a world without walls and fences who needs Windows and Gates?"
Reply | Threaded
Open this post in threaded view
|

Re: How to build an outgoing tcp connection gateway that consumes messages?

ggalka
Hi Andrea,
you haven't understood me.
Using MINA uri in from() endpoint causes creation of TCP socket server. But I need to work as tcp client in order to consume messages. This is not standard use case, but some applications uses such mode. Please look at first post and response from Claus Ibsen-2, who explains that both MINA and NETTY don't have such functionality.

Best regards,
Grzegorz
Reply | Threaded
Open this post in threaded view
|

Re: How to build an outgoing tcp connection gateway that consumes messages?

valdar
Sorry I missed the Claus Ibsen's post completely.


On Mon, Jan 14, 2013 at 2:12 PM, ggalka <[hidden email]> wrote:

> Hi Andrea,
> you haven't understood me.
> Using MINA uri in from() endpoint causes creation of TCP socket server. But
> I need to work as tcp client in order to consume messages. This is not
> standard use case, but some applications uses such mode. Please look at
> first post and response from Claus Ibsen-2, who explains that both MINA and
> NETTY don't have such functionality.
>
> Best regards,
> Grzegorz
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-build-an-outgoing-tcp-connection-gateway-that-consumes-messages-tp5724102p5725537.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
"In a world without walls and fences who needs Windows and Gates?"