@Target(METHOD) @Retention(RUNTIME) public @interface MessageHandler
Methods annotated with this Annotation will automatically be called when a PatternMatchingQueuedMessageHandler and PatternMatchingMessageHandler receives respectively a QueuedMessage or a Message where the Message.getPayload() matches the type of the first argument/parameter on a method annotated with @MessageHandler

If the class extends PatternMatchingQueuedMessageHandler (when used with a DurableQueues instance) then it allows a second optional argument of type QueuedMessage
If the class extends PatternMatchingMessageHandler (when used with a Inboxes/Inbox or Outboxes/Outbox) then it allows a second optional argument of type Message/OrderedMessage