Have a Queue subscribed to multiple Queues, programmaticaly

47
January 09, 2019, at 03:20 AM

I have two Virtual Topics: T1, T2. I have a consumer named FOO.

session.createTopic("VirtualTopic.T1");
session.createTopic("VirtualTopic.T2");

With this I can get messages for every one of the queues using this:

destination = session.createQueue("Consumer.FOO.VirtualTopic.T1");
consumer = session.createConsumer(destination);
Message msg = consumer.receiveNoWait();
destination = session.createQueue("Consumer.FOO.VirtualTopic.T2");
consumer = session.createConsumer(destination);
Message msg = consumer.receiveNoWait();

Is there a way I can "subscribe" a new Queue (let's name it "FOOqueue") to the previous queues Consumer.FOO.VirtualTopic.T1 and Consumer.FOO.VirtualTopic.T2?

This way I could create a consumer pointing only at "FOOQueue" and get all the messages (and in future I could subscribe to other queues from "FOOQueue" and get messages from other queues as well).

Answer 1

What you are asking for sounds like Composite Destinations as defined in the ActiveMQ broker configuration. You would define a composite destination that consist of messages forwarded from some other queues. This of course requires broker reconfiguration if you need to add more forwards later on.

READ ALSO
Java get keyboard key typed in a function

Java get keyboard key typed in a function

So I am making a game in java, and I am currently working with keyboard inputI have a keylistener class setup called KeyboardManager and in it a static function that detects if a key is being held down

13
PHP Date Format returning incorrect suffix ('S')

PHP Date Format returning incorrect suffix ('S')

I have a Unix Timestamps such as 1423389830 and 1511367992I'm using a simple date() function: date( 'M nS, Y', $timestamp ); and it seems like it's returning the wrong date, with the appropriate suffix - which output some rather silly results

40
Need Dynamic PHP Variable help setting variable name that points to another query result

Need Dynamic PHP Variable help setting variable name that points to another query result

I have a php page that loops over a list of parts from the database

32
Regular expression for 8 to 10 letter words

Regular expression for 8 to 10 letter words

I need a regular expression that matches either 8 letter words ending in "tion" or 10 letter words ending in "able"

33