camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aritz Bastida (JIRA)" <j...@apache.org>
Subject [jira] [Reopened] (CAMEL-5844) Camel Tracer not showing some EIP names
Date Wed, 12 Dec 2012 11:21:22 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Aritz Bastida reopened CAMEL-5844:
----------------------------------


Sorry for the inconvenience. I reopen the issue, because I am afraid that the current solution
only solves this issue partially. After digging into it a bit more, I think that the root
cause of the problem is related to the {{InstrumentationProcessor}} class (which is used when
the *JMX agent* is enabled).

Given the following example route:

{code:title=Example Route}
  from("vm:start")
    .process(new Processor() {
       @Override
       public void process(Exchange exchange) throws Exception {
          System.out.println(exchange.getIn().getBody());
       }
    })
    .setBody(constant("Camel"))
    .to("mock:result");	
{code}

With JMX disabled:
* the .process() step is handled by {{WrapProcessor}} class.
* the .setBody() step is handled by {{AsyncProcessorConverterHelper.ProcessorToAsyncProcessorBridge}}
class.

None of these classes is Traceable in camel-core 2.10.3. As a result, in the *DefaultRouteNode.getLabel()*
method, the following statement is executed:

{{return processorDefinition.getLabel()}}

...and we get the same output as in your original unit test:

{noformat}
26:51,150 [Camel (camelProcess) thread #0] INFO  (org.apache.camel.processor.interceptor.Tracer:96)
- ID-ES-CNU2113RXH-58064-1355308005213-0-3 >>> (route2) from(vm://start) --> net.atos.camel.routes.BusinessRoutes$1@14c9066
<<< Pattern:InOnly
26:51,152 [Camel (camelProcess) thread #0] INFO  (org.apache.camel.processor.interceptor.Tracer:96)
- ID-ES-CNU2113RXH-58064-1355308005213-0-3 >>> (route2) net.atos.camel.routes.BusinessRoutes$1@14c9066
--> setBody[{Camel}] <<< Pattern:InOnly
26:51,152 [Camel (camelProcess) thread #0] INFO  (org.apache.camel.processor.interceptor.Tracer:96)
- ID-ES-CNU2113RXH-58064-1355308005213-0-3 >>> (route2) setBody[{Camel}] --> mock://result
<<< Pattern:InOnly
{noformat}

However, if we enable JMX, the processors mentioned above (and probably others I am not aware
of) are wrapped up by {{InstrumentationProcessor}} class, which is Traceable. So, in the DefaultRouteNode.getLabel()
method, the following statement is executed:

{{return trace.getTraceLabel();}}

...even if the enclosed processors are _not_ themselves Traceable (which results in printing
an empty string).

Note that, in camel-core 2.10.4-SNAPSHOT, with JMX enabled, the processor is now printed (with
an additional "wrap[]" prefix), but setBody() still is not.

{noformat}
49:55,689 [Camel (camelProcess) thread #1] INFO - ID-ES-CNU2113RXH-57168-1355305756898-0-3
>>> (route2) from(vm://start) --> wrap[net.atos.camel.routes.BusinessRoutes$1@67ba82]
<<< Pattern:InOnly
49:56,420 [Camel (camelProcess) thread #1] INFO - ID-ES-CNU2113RXH-57168-1355305756898-0-3
>>> (route2) wrap[net.atos.camel.routes.BusinessRoutes$1@67ba82] -->  <<<
Pattern:InOnly
49:57,121 [Camel (camelProcess) thread #1] INFO - ID-ES-CNU2113RXH-57168-1355305756898-0-3
>>> (route2)  --> mock://result <<< Pattern:InOnly
{noformat}

----
PROPOSAL:

For consistency, I think that the Tracer component should print the same log whether the JMX
agent is enabled or not. In order to achieve this, I guess that some rework in DefaultRouteNode.getLabel()
is necessary. 

Currently, the "traceable" check in DefaultRouteNode.getLabel() is made on the InstrumentationProcessor
class, but the trace message is based on the enclosed class (e.g. WrapProcessor). So, maybe,
we could just make {{InstrumentationProcessor}} not Traceable, or make the "traceable" check
on the enclosed class...


                
> Camel Tracer not showing some EIP names
> ---------------------------------------
>
>                 Key: CAMEL-5844
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5844
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.10.1
>            Reporter: Aritz Bastida
>            Assignee: Christian Müller
>            Priority: Minor
>             Fix For: 2.9.6, 2.10.4, 2.11.0
>
>         Attachments: tracer-empty-error.jpg
>
>
> In order to debug Camel routes, I have enabled the Tracer as follows:         getContext().setTracing(true);
> However, I have observed that some EIP names and routes are not being printed on console,
making it a bit confusing to follow. As far as I know, this happens with:
> * process(): the processor is not printed in the tracer; it's just empty (see below)
> * marshall(): the marshaller name is not printed in the tracer; it's just empty (see
below)
> * setBody(): this step is also printed empty
> * from("activiti:..."): this route step is not printed altogether
> For simplicity, I only provide the examples for process() and marshall(), bit I can provide
more information if needed.
> {panel:title=Route2 Config}
> from("vm:processIncomingOrders")
>   .process(new IncomingOrdersProcessor())
>   .split(body())	// iterate list of Orders
>   .to("log:incomingOrder1?showExchangeId=true")
>   .process(new ActivitiStarterProcessor())
>   .to("log:incomingOrder2?showExchangeId=true")			
>   .to("activiti:activiti-camel-example");
> {panel}
> {panel:title=Route2 Tracer}
> INFO  03-12 12:09:31,899 (MarkerIgnoringBase.java:info:96)  -ID-ES-CNU2113RXH-51211-1354532898719-0-3
>>> (route2) from(vm://processIncomingOrders) -->  <<< Pattern:InOnly,
[...]
> INFO  03-12 12:09:34,899 (IncomingOrdersProcessor.java:process:39)  -Processing incoming
orders (from Web Services)
> [ORDER id:120 partName: wheel amount: 2 customerName: Honda Mechanics]
> [ORDER id:121 partName: engine amount: 4 customerName: Volvo]
> [ORDER id:122 partName: steering wheel amount: 3 customerName: Renault]
> INFO  03-12 12:09:34,900 (MarkerIgnoringBase.java:info:96)  -ID-ES-CNU2113RXH-51211-1354532898719-0-3
>>> (route2)  --> split[body] <<< Pattern:InOnly, [...]
> {panel}
> {panel:title=Route6 config}
> from("direct:ordercsv")
>   .marshal().bindy(BindyType.Csv, "net.atos.camel.entities")
>   .to("file:d://cameldata/orders?fileName=orders-$\{date:now:yyyyMMdd-hhmmss}.csv");
> {panel}
> {panel:title=Route6 Tracer}
> INFO  03-12 12:09:37,313 (MarkerIgnoringBase.java:info:96)  -ID-ES-CNU2113RXH-51211-1354532898719-0-8
>>> (route6) direct://ordercsv -->  <<< Pattern:InOnly, [...]
> INFO  03-12 12:09:37,320 (MarkerIgnoringBase.java:info:96)  -ID-ES-CNU2113RXH-51211-1354532898719-0-8
>>> (route6)  --> file://d://cameldata/orders?fileName=orders-%24%7Bdate%3Anow%3AyyyyMMdd-hhmmss%7D.csv
<<< Pattern:InOnly,  [...]
> {panel}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message