You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mtkilbay <ar...@optonline.net> on 2015/12/15 15:18:38 UTC

Create endpoints in java to use in xml routes

I've been trying to create endpoints in java and have those endpoints
referenced in my xml routes but have been unsuccessful. I can do this in
xml:
<endpoint id="kafkatopic" uri="kafka:..."/>
and have the endpoint referenced in the routes:
<route id="eventflow">
    <from ref="kafkatopic" ...>

What i want to do is replace the xml endpoint declaration using java. I've
tried something like:
Endpoint kafkaep = camelCtx.getEndpoint(kafkaUri);
however i'm stumped on how i can create a key "kafkatopic" to refer to the
endpoint such that the xml route is able to find it. Please help. 



--
View this message in context: http://camel.465427.n5.nabble.com/Create-endpoints-in-java-to-use-in-xml-routes-tp5775092.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Create endpoints in java to use in xml routes

Posted by Claus Ibsen <cl...@gmail.com>.
No that is not possible. There is a JIRA ticket to improve this in the
future. Its not an easy change.



On Wed, Dec 16, 2015 at 5:38 PM, mtkilbay <ar...@optonline.net> wrote:
> My question may not have been clear enough so let me ask a specific question:
>
> Does anyone know whether i can use the EndpointRepository to add an endpoint
> with a reference name, e.g., "kafkatopic" that i can then refer to in my xml
> route like below:
> <from ref="kafkatopic" ...>
>
> Thanks.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Create-endpoints-in-java-to-use-in-xml-routes-tp5775092p5775183.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Create endpoints in java to use in xml routes

Posted by mtkilbay <ar...@optonline.net>.
My question may not have been clear enough so let me ask a specific question:

Does anyone know whether i can use the EndpointRepository to add an endpoint
with a reference name, e.g., "kafkatopic" that i can then refer to in my xml
route like below:
<from ref="kafkatopic" ...>

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/Create-endpoints-in-java-to-use-in-xml-routes-tp5775092p5775183.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Create endpoints in java to use in xml routes

Posted by mtkilbay <ar...@optonline.net>.
Claus, thank you for responding. I think you know i meant EndpointRegistry.



--
View this message in context: http://camel.465427.n5.nabble.com/Create-endpoints-in-java-to-use-in-xml-routes-tp5775092p5775190.html
Sent from the Camel - Users mailing list archive at Nabble.com.