Does any one have any documentation on the lifecycle of a camel component and
it's associated entities (Endpoint, 
Consumer, Producer).  I am attempting to write a component for a
event-driving wireline protocol.  I understand the basics of:
0. Component is created.
1. URI in DSL gets passed to to component.
2. Component creates Endpoint for each unique URI (if using a singleton)
3. Endpoint creates Consumers and Producers.

But I'm looking for a little more detail as to what triggers the creation
and removal of say Consumers. Specifically, 
- Is a single Consumer around for the life of the CamelContext?  
- Does an Endpoint get notified if a Consumer it created is stop()'d?
- What is Consumer.stop() used for?  Only during shutdown of the
CamelContext?  Or is it more like a "pause" than a stop?
- Is there a way (say in the case of a loss of network connection) to stop()
an Endpoint and all associated Consumers and Producers? Then later restart
them after connection has been regained?
- Is there a general example/recommendation on how to handle connections to
unreliable external entities?

I've been using the IRC component as somewhat of a model, but my glance
through the code doesn't really indicate how the component deals with
connection loss or net-splits and other networking pit-falls.

Here's a short outline of the wire protocol I have to implement if it helps:

1. Open TWO TCP connections with Server
2. Register Myself with Server, twice, once as a SENDER, once as a RECEIVER.
Both connections are bi-directional, but the functions I can do on each
connection is limited by how I register myself.  
3. At this point I will receive data packets (messages) for some length of
time over the Receiver connection.
4. At some point in the future the Server will send me an "ALL DONE"
message.  At which point I must un-register my sender and receiver, but the
TCP connections remail open.
5. After the unregister I need to notify Consumers that there is no more
messages coming and stop Producers from attempting to send more messages.
6. After waiting X seconds (X in most cases is 180) I will attempt to
re-register myself and if successful need to re-activate Consumers and
Producers.
7. I also need to account for the fact that at any time, I may lose a
network connection to the Server, and will need to stop all Consumers and
Producers until connection is restored.

Thanks for any help
-p
-- 
View this message in context: 
http://old.nabble.com/Lifecycle-of-a-Camel-Component-tp26522808p26522808.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to