You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Craig Taylor <ct...@ctalkobt.net> on 2022/04/19 14:29:15 UTC

Internal logging of routes

I've found it useful in the past to internally log the route definition /
attributes in its hierarchical form (eg: endpoint uri, list of
corresponding steps etc) to diagnose issues during route construction (eg:
forgot missing .end() etc).

I've lost the source for being able to do this.  Looking at the
CamelContext I see the getRoutes() however it doesn't look like I can
easily obtain the processors or steps beneath the route so I can log them.

Specifically looking for step uri / component type (eg: to() / body() /
process() / aggregate() etc and the definitions of each (eg: to(where),
body(? what addtl parameters) etc).

Note that a route.toString() is not ideal in this situation.
-- 
-------------------------------------------
Craig Taylor
ctalkobt@ctalkobt.net

Re: Internal logging of routes

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

There is a dumpRoutes option you can turn on camel context that dumps
them on startup in XML output with all details.

Otherwise you need to go via ModelCamelContext where you can get the
model definitions (adapt from camel contexT).


On Tue, Apr 19, 2022 at 4:29 PM Craig Taylor <ct...@ctalkobt.net> wrote:
>
> I've found it useful in the past to internally log the route definition /
> attributes in its hierarchical form (eg: endpoint uri, list of
> corresponding steps etc) to diagnose issues during route construction (eg:
> forgot missing .end() etc).
>
> I've lost the source for being able to do this.  Looking at the
> CamelContext I see the getRoutes() however it doesn't look like I can
> easily obtain the processors or steps beneath the route so I can log them.
>
> Specifically looking for step uri / component type (eg: to() / body() /
> process() / aggregate() etc and the definitions of each (eg: to(where),
> body(? what addtl parameters) etc).
>
> Note that a route.toString() is not ideal in this situation.
> --
> -------------------------------------------
> Craig Taylor
> ctalkobt@ctalkobt.net



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