Get all messages from topic

899 views Asked by At

How can I get all messages from a JMS topic in Tibco?

I know that I can use a topic subscriber, but it wouldn't fit exactly my needs. I want to start a process only once a day that will read all messages from a topic and process them. I cannot have both a timer and a topic subscriber in the same process.

I tried with "Wait for JMS Topic Message", but it seems that it gets only one message, no matter how many I have in the topic.

3

There are 3 answers

3
Chukwuemeka Onyenezido On BEST ANSWER

I think the best solution will be to bridge the JMS topic to a queue and use the "JMS Queue Receiver" activity at the start of your process.

Once you start the instance once a day, it will connect and process all the messages in the queue.

0
jens walter On

I would try going a different direction. You could implement this using 2 separate processes.

One process, a topic subscriber (with a durable) which receives all messages. This process starter should be disabled by default (so the listener is not active).

The second process is a timer, which will activate the first process through Hawk (Engine Command). So every time the subscriber gets activated, it will start processing events.

The problematic part here is the deactivation of the topic subscriber after it is done. For that you need a separate logic, when to deactivate the subscriber. This could also be done by a separate timer or some Hawk Rule which fires, when the subscriber has no more messages.

0
trankas On

A much more natural solution (if it can be implemented) is to just implement a Topic Subscriber (or a Queue subscriber if the Topic is bridged to a Queue) and let the BusinessWorks Engine spawn Job instances whenever a message gets published.

This allows to spread the workload much more evenly than to get all the messages from either a Topic or a Queue.