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

Improve SJMS Batch Logging

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.3
    • 3.7.0
    • camel-sjms
    • None
    • Unknown

    Description

      When there are multiple SJMS-Batch consumers in a camel context it is currently very difficult to work out which one some of the log messages apply to because many don't include the URI or queue name and happen outside the context of a route (so route MDC logging doesn't help).

      Suggested improvements:

      • Thread names should include the destination name.  The standard jms component consumers already do this.
      • Most log messages (especially error messages) should include the destination name.

      It may be appropriate to use the consumer URI without query parameters instead of the destination name - I'm not sure if there is a standard approach used by other components.

       

      Examples of current log messages from a spring boot app:

      2020-10-08 10:38:31.313 WARN ||| 12468 --- [Camel (camel-1) thread #21 - AsyncStartStopListener] o.a.c.c.sjms.batch.SjmsBatchConsumer     : Error starting consumer after 1 attempts. Will try again in 5000 millis.. Caused by: [org.apache.qpid.jms.exceptions.JMSSecuritySaslException - Client failed to authenticate using SASL: PLAIN]
      
      
      2020-10-07 14:11:44.351 INFO ||| 27720 --- [Camel (camel-1) thread #15 - SjmsBatchConsumer] o.a.c.c.sjms.batch.SjmsBatchConsumer     : Shutdown signal received - rolling back batch
       

       

      Example of current thread name from SJMS-Batch consumer: "Camel (camel-1) thread #13 - SjmsBatchConsumer"

       

      Queue name in AsyncStartStopListener might be helpful too - currently: "Camel (camel-1) thread #6 - AsyncStartStopListener"

       

      In contrast, the standard JMS component includes the queue name in the thread name and in error messages:

      2020-10-08 10:38:35.245 WARN ||| 12468 --- [Camel (camel-1) thread #12 - JmsConsumer[myQueueName]] c.c.j.DefaultJmsMessageListenerContainer : Setup of JMS message listener invoker failed for destination 'myQueueName' - trying to recover. Cause: The transport is not running.
       

       

      Attachments

        1. sjmsbatchloggingpatch.txt
          9 kB
          Brad Harvey

        Activity

          People

            vrlgohel Viral Gohel
            bradhgbst Brad Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: