You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lmanchanda75 <lm...@gmail.com> on 2013/04/07 13:25:45 UTC

How to get Id of an Endpoint

Hi,

I have created a context using camel context xml. I have set the id of an
endpoint while configuring,

       <from
uri="jetty:http://localhost:8888/ussdService?sessionSupport=true"
id="ussd-1">

          I need to get this value during execution. I tried the following
code to get the id in processor of the endpoint

        DefaultEndpoint endpoint = (DefaultEndpoint)
exchange.getFromEndpoint();
    	System.out.println("Endpoint ID:"+endpoint.getId());

but i get endpoint1 as the id but not what I configured in the context. I am
using fuse 7.1.

Thanks in anticipation.

Regds
Lalit




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-get-Id-of-an-Endpoint-tp5730470.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to get Id of an Endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Sounds like a little bug in the <from>.
I logged a ticket
https://issues.apache.org/jira/browse/CAMEL-6250

If you define the endpoint as

<endpoint id="ussd-1"
uri="jetty:http://localhost:8888/ussdService?sessionSupport=true"/>

And then refer to it from the rotues
<from ref="ussd-1"/>

Then it ought to work.

On Sun, Apr 7, 2013 at 1:25 PM, lmanchanda75 <lm...@gmail.com> wrote:
> Hi,
>
> I have created a context using camel context xml. I have set the id of an
> endpoint while configuring,
>
>        <from
> uri="jetty:http://localhost:8888/ussdService?sessionSupport=true"
> id="ussd-1">
>
>           I need to get this value during execution. I tried the following
> code to get the id in processor of the endpoint
>
>         DefaultEndpoint endpoint = (DefaultEndpoint)
> exchange.getFromEndpoint();
>         System.out.println("Endpoint ID:"+endpoint.getId());
>
> but i get endpoint1 as the id but not what I configured in the context. I am
> using fuse 7.1.
>
> Thanks in anticipation.
>
> Regds
> Lalit
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-get-Id-of-an-Endpoint-tp5730470.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen