Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 39559200BDE for ; Thu, 10 Nov 2016 10:34:02 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 383D6160B10; Thu, 10 Nov 2016 09:34:02 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6C93C160B16 for ; Thu, 10 Nov 2016 10:34:01 +0100 (CET) Received: (qmail 32354 invoked by uid 500); 10 Nov 2016 09:34:00 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 32220 invoked by uid 99); 10 Nov 2016 09:34:00 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Nov 2016 09:34:00 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 3A6522C0059 for ; Thu, 10 Nov 2016 09:34:00 +0000 (UTC) Date: Thu, 10 Nov 2016 09:34:00 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CAMEL-10460) MetricsMessageHistoryFactory.java:138 Generate a NPE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 10 Nov 2016 09:34:02 -0000 [ https://issues.apache.org/jira/browse/CAMEL-10460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen resolved CAMEL-10460. --------------------------------- Resolution: Fixed Assignee: Claus Ibsen Thanks > 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 > Assignee: Claus Ibsen > Fix For: 2.18.1, 2.19.0 > > Attachments: __CAMEL_10460_2.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)