Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.0.0
-
None
-
Unknown
Description
The org.apache.camel.processor.Pipeline eagerly computes the size of the pipeline and converts the Processors to AsyncProcessors in construction. It also allows access to the processors field via List<Processor> getProcessors method, through which the list of processors in a pipeline can be mutated without recalculating the size or converting any added Processors to AsyncProcessors, leading to inconsistency.
e.g. if I have code like:
Pipeline pipeline = Pipeline.newInstance(context, processor1, processor2); pipeline.getProcessors().add(processor3);
processor3 will never be executed.
I see two possible solutions:
- disallow processors list mutation, or
- don't eagerly compute size and convert Processors to AsyncProcessors on demand