I was using the start() method to instantiate the connection to the feed I was using and then stop() to tear it down, but after creating the Endpoint, Camel proceeds to call start() twice in a row on it
while obviously easy to work around by either checking whether its been started once already, or (as I did) just moving the starting code into the constructor of Endpoint – it’s making me think I don’t understand what the start() method is trying to achieve (the documentation helpfully suggests: start() starts a service … grrreat
why would this happen twice?
incidentally createEndpointUri() gets called too… which makes me rather suspicious since this is a ‘lazy loader for when a uri hasn’t been supplied’ … except that one has been supplied … so I wonder if some secondary instantiation is occuring for some reason
You should extend ServiceSupport which has doStart | doStop methods, and can keep track of the state of your class. Then Camel knows the state and wont invoke doStart twice.