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

use exceptionHandler on XmppConsumer

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Duplicate
    • None
    • None
    • camel-xmpp
    • None
    • 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

            Unassigned Unassigned
            tiboun bounkong khamphousone
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: