[ 
https://issues.apache.org/jira/browse/CAMEL-10460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15652102#comment-15652102
 ] 

Claus Ibsen commented on CAMEL-10460:
-------------------------------------

Its not entirely correct as on exception is not an route and hence why you dont 
see that. I will work on a different solution where we will grab the last route 
id from the current exchange instead. 

We can use your unit test, however we cannot accept the patch file with such 
license header. Can you remove that, or replace it with the ASF license header, 
and attach the .patch file again?

> MetricsMessageHistoryFactory.java:138 Generate a NPE
> ----------------------------------------------------
>
>                 Key: CAMEL-10460
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10460
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-metrics
>    Affects Versions: 2.18.0
>         Environment: MacOs, JDK 1.8, SpringBoot 1.4.1, Spring Metrics
>            Reporter: Philippe Godot
>             Fix For: 2.18.1, 2.19.0
>
>         Attachments: __CAMEL_10460.patch
>
>
> I'm trying to play with Spring-boot camel and metrics to expose dashboard. 
> Hawtio is a great tools to check what it's going on at runtime but no 
> persistence is done. We would like to persist statistics in prometheus by 
> example. 
> I configure camel context with MetricsMessageHistoryFactory as: 
>     MetricsMessageHistoryFactory metricsMessageHistoryFactory = new 
> MetricsMessageHistoryFactory(); 
>     metricsMessageHistoryFactory.setMetricsRegistry(metricRegistry); 
>     camelContext.setMessageHistoryFactory(metricsMessageHistoryFactory); 
> where metricRegistry is injected with: 
>   /** 
>    * Srping Boot metrics 
>    */ 
>   @Autowired 
>   private MetricRegistry metricRegistry; 
> Everything is ok until I passed in OnExceptionRoute. It seems that the 
> routeId is set to Null in this case and generate a NPE (line 
> MetricsMessageHistoryFactory:138) in the exception route. Route causing the 
> NPE:
> onException(NoAttachmentToProcessException.class) 
>         .routeId(RouteIds.TECHNICAL_ERROR_HANDLING.routeId()) 
>         .log(LoggingLevel.ERROR,"TECHNICAL ERROR: 
> ${exchangeProperty.CamelExceptionCaught}") 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to