-
Bug
-
Resolution: Done
-
Major
-
2.12.0.redhat-61379
-
None
-
None
If a Camel component throws an exception during creation of its endpoint, when that component is invoked by a routing slip, the exchange that led to the endpoint's being created remains permanently in-flight – it is considered neither succeeded nor failed. This problem is not immediately visible, but the bogus in-flight exchanges show up in JMX statistics for the Camel route, and consume memory.
Consider the createProducer() method of the org.apache.camel.component.file.FileEndpoint class, for example. It can throw an IllegalArgumentException if its attributes are incompatible. If it does so, however, all exchanges passing through the route remain permanently in-flight, even though an exception is thrown and can be handled by the route.
This problem affects Camel 2.12.0 but does not affect 2.10.0 – it seems that there is some subtle variation in the way that exception handling is done during endpoint creation.
Although I've used the File component for illustration, this problem affects any component that throws an exception during endpoint creation, if the component is created as a result of a routing slip invocation. Nothing in the documentation suggests that it is not appropriate to throw an exception here.