You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "l.muscari" <l....@reply.it> on 2013/10/08 12:59:12 UTC

Getting route info problems

hi, 
i'am a young developer and in this day i have to develop with apache camel
for first time. 
So, i have a simple webapp, with a
org.apache.camel.component.servletlistener.SimpleCamelServletContextListener
listener 
and a servlet that implements  CamelContextLifecycle that manage the
lyfecycle of camel context. 
in this servlet, i load some ROUTES from a properties file. till here all is
ok. 
now i have to do a simple web page (a jsp-page) that make the summary of
routes that have been loaded. 

to do this i need to retrieve the "from " a and "to ". 

till now i try in vain to get these info from CamelContext, by taking it
from the servlet that implements CamelContextLifecycle and i can retrieve
tha camel context. but from this i can't get info i needed. 
 i can retrieve the "from" info by get the endpoint of single route from
camel context, but for "to" info i been not able. 

If you know a way to get this info from camel context (or eventually by
other way) please help me!!! 



Luca



--
View this message in context: http://camel.465427.n5.nabble.com/Getting-route-info-problems-tp5741123.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Getting route info problems

Posted by Christian Mueller <ch...@gmail.com>.
Can you please subscribe to the discussion forum as we describe here [1].
Otherwise all your mails has to be moderate by the Camel team and is may
missed/delayed.

[1] http://camel.apache.org/discussion-forums.html

Thanks in advance,
Christian



--
View this message in context: http://camel.465427.n5.nabble.com/Getting-route-info-problems-tp5741123p5741150.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Getting route info problems

Posted by Christian Posta <ch...@gmail.com>.
Why can't you use the RouteDefinition object that gets returned as Claus
mentioned? It has all of the outputs you're looking for.

http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/model/RouteDefinition.html#getOutputs()


On Tue, Oct 8, 2013 at 9:28 AM, l.muscari <l....@reply.it> wrote:

> yes but this two data structure doesn't resolve the endpoints which are
> associated, getRoute get only the "inbound " endpoint and not the outbound.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Getting-route-info-problems-tp5741123p5741146.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: Getting route info problems

Posted by "l.muscari" <l....@reply.it>.
yes but this two data structure doesn't resolve the endpoints which are
associated, getRoute get only the "inbound " endpoint and not the outbound. 



--
View this message in context: http://camel.465427.n5.nabble.com/Getting-route-info-problems-tp5741123p5741146.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Getting route info problems

Posted by Claus Ibsen <cl...@gmail.com>.
There is API on CamelContext to get route information,

getRoute
getRouteDefinition

This allows you to get the runtime route and the model route.



On Tue, Oct 8, 2013 at 1:10 PM, l.muscari <l....@reply.it> wrote:
> UPDATE:
>
> i'am able to resolve every endpoints loaded in camel context. and in this
> way i get every "from" and "to" information i need.
> the problem now is associate the single endpoints to the relative route. i
> do something like this:
>
> Collection<Endpoint> e ;
> e = context.getEndpoints();
>
> then visit e with iterator, and i get all "from" and "to" info loaded in
> camel context in random order.
> i can't find a way to get the route associate at the endpoints.
>
> Can you help me??
> many thanks
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Getting-route-info-problems-tp5741123p5741128.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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

Re: Getting route info problems

Posted by "l.muscari" <l....@reply.it>.
UPDATE: 

i'am able to resolve every endpoints loaded in camel context. and in this
way i get every "from" and "to" information i need.
the problem now is associate the single endpoints to the relative route. i
do something like this:

Collection<Endpoint> e ;
e = context.getEndpoints();

then visit e with iterator, and i get all "from" and "to" info loaded in
camel context in random order. 
i can't find a way to get the route associate at the endpoints.

Can you help me?? 
many thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Getting-route-info-problems-tp5741123p5741128.html
Sent from the Camel - Users mailing list archive at Nabble.com.