0

I wonder if is it possible to use the shared consumer with the JMS connector of Quarkus. I would like to make something like this:

final TopicConnection topicConnection = factory.createTopicConnection();
final TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
final MessageConsumer subscriber = topicSession.createSharedConsumer(new MQTopic("mytopic"), "mysubscription");

How to set the subscriber?

May be is it worth to add a 'shared' property in the connector?

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
bdeweer
  • 135
  • 1
  • 14
  • I don't really understand your question. Why can't you do this with Quarkus' JMS connector? What do you mean "set the subscriber?" Please elaborate on what you've tried and why it hasn't worked. Thanks! – Justin Bertram Jun 08 '21 at 16:12
  • I try to use the SharedConsumer jms 2.0 feature as explained here: https://www.oracle.com/technical-resources/articles/java/jms2messaging.html. How to do with the quarkus jms-connector ? – bdeweer Jun 08 '21 at 22:19
  • Why not simply inject your `ConnectionFactory` as described in the [Quarkus JMS documentation](https://quarkus.io/guides/jms) and use the JMS 2.0 API as normal? – Justin Bertram Jun 10 '21 at 01:31
  • Thank you, indeed im able to make it work like that. But it would be nice to propose a "shared" property for the quarkus reactive jms-connector – bdeweer Jun 10 '21 at 10:27

1 Answers1

0

You can inject your ConnectionFactory as described in the Quarkus JMS documentation and use the JMS 2.0 API as normal to create your shared subscriber.

If you want to request a change to the SmallRye Reactive Messaging project (including the JMS connector) then you can do so at their GitHub project.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43