Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jms-dev] MicroProfile Reactive Messaging: Message Driven Beans Redux


For those interested in JMS 3.0, I would draw their attention to
https://github.com/eclipse/microprofile-reactive-messaging/blob/master/spec/src/main/asciidoc/architecture.asciidoc

Where an annotation based message driven bean specification is forming.

To whet your appetite, it here is an example:

@Incoming( "myTopic" )
public CompletionStage<Void> processMessage(Message<IncomingMessage> msg) {
 System.out.println("Got message " + msg.getPayload());
 return msg.ack();
}


Versus I recent JMSnext presentation I saw from David Blevins and Richard Monson-Haefel (paraphrased  here)

@MessageDriven
@MaxSessions(3)
@MaxMessagesPerSession(1)
public class BuildTaskMessageListener {

   @Destination( value = "TASK_QUEUE" )                   // this could of course be @Destination( TASK_QUEUE )
   @DestinationType( Queue.class )
   @MessageType( ObjectMessage.class)
   public void process( Tazk t ) throw JMS Exception {
        t.doSomething();  
   }
}


Personally for JMSnext I would propose:
1 - discuss having seperate annotations for each of {send-que, receive-que, send-topic, receive-topic} to enable the first two lines to be one line.
2 - I would explore if it is possible to infer the @MessageType from the parameter to the annotated method.
but that is a seperate topic. :-)

Gordon

Gordon Hutchison
IBM Systems Middleware
Websphere Application Server Development
IBM Hursley Lab, UK.
gordon_hutchison@xxxxxxxxxx
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Back to the top