camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bagwell, Allen F" <>
Subject Getting a reference to a processor in a route?
Date Tue, 10 Oct 2017 16:52:07 GMT
I have a route defined in a blueprint. It's lifecycle includes autoStart="false" so that it's
only turned on when needed. At the end of the active period, it's put back into suspended

Prior to starting up again we have to reset some parameters on a processor within this route.
This is a bean processor, meaning we define the java class and have it implement the Processor
interface. The blueprint defines the bean and it is called as

<bean id="fooProcessor" class="example.lib.FooProcessor" />


<process ref="fooProcessor" id="fooProcessor"/>

So I was quite happy to find that my central ServiceSupport object which handles the management
of which messages goes to which routes could easily call

camelContext.getProcessor(String id)

to grab a reference to this bean and from there I would be able do the housekeeping before
the route starts up again.

The problem is that the getProcessor method returns null.

I stepped through what was going on with the debugger down to where it was evaluating the
processor in question and didn't quite understand why the processor definition object had
the id field populated as "fooProcessor", but this is NOT the id field that is used in the
filtering method to find a match.

So my question is... how do I grab my processor reference? I'm a bit puzzled why it ignores
my custom id fields.

Using Camel 2.18.3


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message