Skip to main content

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

This is (beside e.g. JAX-RS) another good example, where MicroProfile acts as a sandbox or incubator for new ideas coming from the "Cloud Native" universe, but it makes more sense to add some of it into the actual standard instead of having yet another pseudostandard that deviates from how others do it ;-)

Werner 




On Fri, Nov 9, 2018 at 12:31 PM Gordon Hutchison <gordon_hutchison@xxxxxxxxxx> wrote:

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
_______________________________________________
jms-dev mailing list
jms-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jms-dev

Back to the top