0

I have a Red Hat AMQ (which is based on ActiveMQ Artemis) broker and I would like to make use of durable subscription (or equivalent) feature, so that I will have multiple OpenWire JMS subscribers subscribing to the events of our application which will be delivered to them reliably.

I would like to pre-configure subscribers, so to save me trouble in initial application startup. I want to avoid the case for initial application start up where the main application starts running and publishing events before our durable subscribers perform their initial subscription.

I also wants to avoid explicitly ordering start up sequence of my processes.

Is there any way I can pre-configure durable subscribers? In ordinary ActiveMQ (not Artemis), there is feature like Virtual Topics which (kind of) solve the problem.

What is the preferred solution for ActiveMQ Artemis?

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
Adrian Shum
  • 38,812
  • 10
  • 83
  • 131
  • What kind of client are you using? – Justin Bertram Nov 23 '18 at 18:21
  • Just wonder how this is related to the question? – Adrian Shum Nov 23 '18 at 23:37
  • Because the name of the queue created for a "durable subscription" may be different depending on which client is being used. Also, did you read the [Artemis documentation on this](https://activemq.apache.org/artemis/docs/latest/address-model.html#advanced-address-configuration)? – Justin Bertram Nov 24 '18 at 02:13
  • FYI - the [STOMP chapter in the Artemis documentation](https://activemq.apache.org/artemis/docs/latest/stomp.html#durable-subscriptions) also discusses this. – Justin Bertram Nov 26 '18 at 03:56
  • I am going to use it with JMS (ah... I should have mentioned it in the question). Lemme keep STOMP in my broker config and try if this works, thanks. – Adrian Shum Nov 26 '18 at 08:39
  • Can you be more specific about your JMS client? Will you be using the core protocol, OpenWire, or AMQP? Artemis supports JMS implementations using each of those protocols. – Justin Bertram Nov 26 '18 at 14:13
  • Seems our clients are using Openwire. I was originally thinking of enabling STOMP (though not used) with the configuration you mentioned should cause the durable subscription be created and is available for other protocols. May I know if it may work? – Adrian Shum Nov 27 '18 at 02:25

1 Answers1

1

It is possible to pre-configure durable subscriptions since the OpenWire implementation creates the queue used for the durable subscription in a deterministic way (i.e. using the format of client-id.subscription-name). For example, if you wanted to configure a durable subscription on the address myAddress with a client-id of myclientid and a subscription name of mysubscription then configure the durable subscription:

<addresses>
   <address name="myAddress">
       <multicast>
        <queue name="myclientid.mysubscription"/>
      </multicast>
   </address>
</addresses>
Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • Thanks a lot. It works as expected. Sorry for the belated acceptance as I didn't have chance to test that out till now :) – Adrian Shum Dec 10 '18 at 09:39