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:
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