Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10460

MetricsMessageHistoryFactory.java:138 Generate a NPE

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.18.0
    • 2.18.1, 2.19.0
    • camel-metrics
    • None
    • MacOs, JDK 1.8, SpringBoot 1.4.1, Spring Metrics

    • Unknown

    Description

      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}")

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            PhilG Philippe Godot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment