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

Use exceptionHandler on Xmpp Consumer

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.12.1
    • 2.14.0
    • camel-xmpp
    • None
    • all

    • Novice

    Description

      Hi!

      What do you think about adding a call to the exceptionHandler in the doStart() method of XmppConsumer class ?

      It would looks like :

      try

      { connection = endpoint.createConnection(); }

      catch (XMPPException e) {
      if (endpoint.isTestConnectionOnStartup())

      { throw new RuntimeException("Could not connect to XMPP server.", e); }

      else

      { final String xmppExceptionLogMessage = XmppEndpoint.getXmppExceptionLogMessage(e); LOG.warn(xmppExceptionLogMessage); getExceptionHandler().handleException(xmppExceptionLogMessage,e); scheduleDelayedStart(); return; }

      }

      This allowed an exceptionHandler to be notified of failure connection.
      The testConnectionOnStartup doesn't call exceptionHandler because the exception is thrown while starting the consumer.

      Attachments

        Activity

          People

            njiang Willem Jiang
            tiboun bounkong khamphousone
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: