Interface MessageHandler


  • public interface MessageHandler
    Dispatchers use the MessageHandler interface to define the listener for their messages. Each Dispatcher can have a single message handler, although the handler can use the incoming message's subject to branch for the actual work.
    • Method Detail

      • onMessage

        void onMessage​(Message msg)
                throws java.lang.InterruptedException
        Called to deliver a message to the handler. This call is in the dispatcher's thread and can block all other messages being delivered.

        The thread used to call onMessage will be interrupted if the connection is closed, or the dispatcher is stopped.

        Parameters:
        msg - the received Message
        Throws:
        java.lang.InterruptedException - if the dispatcher interrupts this handler