Reputation: 307
Is this possible?
<bean id="camelCustomComponent" class="x.y.z.CustomComponent" />
Below is the camel route
<to uri="camelCustomComponent:someThing?SomeParams=someValues" />
This is to leverage the camel component user/developer to use their name whatever they want.
I understand their should be a file with name camelCustomComponent which will have the Custom Component's class name. Can we make dynamic. Is it possible to initialise the component dynamically?
Thanks.
Regards Senthil Kumar Sekar
Upvotes: 1
Views: 4889
Reputation: 56082
Yes as bgossit posted, see the documentation about writing a component
And the options in the uris, are just getter/setter in the endpoint class. That is all you need to do.
You can for example copy an existing component and use that for creating your own, for example if the component is similar to yours.
But better yet, maybe use the maven archetype to create a new component as documented here
Upvotes: 1
Reputation: 1086
I see two options.
Create a full component as per the Writing Components guide, the important point being that you will need to create a file under META-INF/services for your camelCustomComponent: URI to be detect by Camel.
Use the Bean Component which has some support for setting method parameter values. See the section titled Parameter binding using method option
Upvotes: 2