I need to implement a consumer to an XML-RPC based service over TCP. Upon establishing a connection to the server, it requires that
- Authentication credentials be sent by the client
- An event subscription request be sent by the client, and finally
- The client is to switch into a "receiving" mode where messages will be sent asynchronously
- When the client is no longer interested in receiving more events, the client ought to "unwind" steps 1-3.
So, I would like to use Apache Camel to implement the client, with an obvious entry endpoint of a Mina Component ("mina:tcp://host:_port_?textline=true&decoderMaxLineLength=10240&sync=true"). My question is, how would I go about implementing steps 1, 2, and 4 above? How would I go about performing those "handshake" steps before the processor in my RouteBuilder gets call? Is this even possible with Camel or will I have to write a straight Mina client to handle this. Are there better options for dealing with this type of integration scenario?
Thank you.
-Santi