Class PatternMatchingMessageHandler

  • All Implemented Interfaces:
    Consumer<Message>

    public class PatternMatchingMessageHandler
    extends Object
    implements Consumer<Message>
    Pattern matching Consumer<Message> for use with Inboxes/Inbox or Outboxes/Outbox
    The PatternMatchingMessageHandler will automatically call methods annotated with the @MessageHandler annotation and where the 1st argument matches the actual Message payload type (contained in the Message.getPayload() provided to the provided Consumer)

    Each method may also include a 2nd argument that of type Message in which case the event that's being matched is included as the 2nd argument in the call to the method.
    The methods can have any accessibility (private, public, etc.), they just have to be instance methods.

    Example:

    {@code
     public class MyMessageHandler extends PatternMatchingMessageHandler {