You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by James Bradt <gm...@xoxy.net> on 2006/09/21 21:21:56 UTC

TCP socket binding component

Hello all,

Another simple question.

Does anyone know if a simple tcl socket binding component exists?  I have 
the requirement to talk to some low-level devices that only communicate at 
this level (open connection, send data, receive data, close connection).

What I was thinking of is something that would just takes the body of the 
normalized message and send it out the tcp socket.

Thanks,
James 




Re: TCP socket binding component

Posted by James Bradt <gm...@xoxy.net>.
"Bruce Snyder" <br...@gmail.com> wrote 
in message 
news:7b3355cb0609220326g5a888e11y64d6f1ae817d3048@mail.gmail.com...


Bruce,

Thanks for the information.

> There was a message about a basic TCP component back in May here:
>
> http://www.nabble.com/Re%3A-Basic-TCP-component-p4360825.html

I did try to do a search for information on this subject but I somehow 
missed the previous conversation.

I will review the thread and see if I can capture any thing useful.

> FWIW, implementing a comprehensive component that speaks TCP sounds
> easier than it really is. Consider the fact that dealing with a
> protocol as well as proxies and security alone can be quite difficult.
> When considering these issues alone, it makes much more sense to just
> use something like the servicemix-http component because there's
> already a protocol there (HTTP) and it can negotiate proxies and
> handle security. But it doesn't mean that a TCP component could not be
> created.
>

I figured that creating a general component isn't easy.  That's why I was 
asking before feeling the pain of the various gotcha's :)  Luckily, I don't 
need to worry about alot of the headaches (proxy, firewalls, etc) because my 
application will be only running on an internal network where I have some 
degree of control.

> If/When I ever have enough time to work on this, I would start looking
> at the OpenWire protocol from ActiveMQ
> (http://www.activemq.org/site/openwire.html). OpenWire is an open,
> multi-language, binary protocol so it already handles all the low
> level marshalling. That will handle the wire format, then you need to
> handle the TCP level. For this I'd start looking at the ActiveMQ TCP
> transport layer here:
>
> http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/

I took a quick look at this info.  I'm not sure that it would be helpful in 
my situation.  Granted, I am by no means an expert in ActiveMQ (how do you 
spell it again? :), so I am not sure of how I could take advantage of these 
capabilites.

Basically, I need to communicate with micro-plc's that capture and send 
various pieces of information to my application.  The way that I communicate 
with these devices is via normal tcp operations.  (open a socket, send some 
information, receive some information, close the socket).  The issue with 
these devices is that they don't have full-fledge OS and the functionality 
that one would expect.  They can be set up to open a socket and send some 
data, but I can't change/extend the format of the data being sent.

>
> And I'm sure I've left out some items as I just threw together these
> ides in the span of writing this email.
>
> Bruce
> -- 

I do appreciate the response.  Of various projects that I've tried to use in 
the past, this group has been one of the best in supporting us newbies.

Thanks,
James




Re: TCP socket binding component

Posted by Bruce Snyder <br...@gmail.com>.
On 9/21/06, James Bradt <gm...@xoxy.net> wrote:
> Hello all,
>
> Another simple question.
>
> Does anyone know if a simple tcl socket binding component exists?  I have
> the requirement to talk to some low-level devices that only communicate at
> this level (open connection, send data, receive data, close connection).
>
> What I was thinking of is something that would just takes the body of the
> normalized message and send it out the tcp socket.

James,

There was a message about a basic TCP component back in May here:

http://www.nabble.com/Re%3A-Basic-TCP-component-p4360825.html

But I'm not sure if this guy ever finished it as there was never any
contribution to the ServiceMix project. Also note that the example
code that was posted was far from being comprehensive - it was very
basic. I encourage you to read the whole thread, especially the points
made be Guillaume.

FWIW, implementing a comprehensive component that speaks TCP sounds
easier than it really is. Consider the fact that dealing with a
protocol as well as proxies and security alone can be quite difficult.
When considering these issues alone, it makes much more sense to just
use something like the servicemix-http component because there's
already a protocol there (HTTP) and it can negotiate proxies and
handle security. But it doesn't mean that a TCP component could not be
created.

If/When I ever have enough time to work on this, I would start looking
at the OpenWire protocol from ActiveMQ
(http://www.activemq.org/site/openwire.html). OpenWire is an open,
multi-language, binary protocol so it already handles all the low
level marshalling. That will handle the wire format, then you need to
handle the TCP level. For this I'd start looking at the ActiveMQ TCP
transport layer here:

http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/

Basically most of what is needed is already there in ActiveMQ, we just
need to be implement a JBI component. This is not even very difficult
with the portable JBI component helper classes:

http://servicemix.org/site/component-helper-classes.html

And I'm sure I've left out some items as I just threw together these
ides in the span of writing this email.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://incubator.apache.org/activemq/
Apache ServiceMix - http://incubator.apache.org/servicemix/
Castor - http://castor.org/