Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dynamic destination in tMomOutput

Is it possible to control in runtime (on row level) destination queue name used in tMomOutput component (ActiveMQ event bus)?
I need to build a "router" which will route dynamically incoming messages by different queues.
Target queue name can be found in one of row attributes (got from database along with data for message contents)

Labels (2)
5 Replies
Anonymous
Not applicable
Author

Hi,
Could you please elaborate your case with an example with input and expected output values? Are you referring to context vaule?
Best regards
Sabrina
Anonymous
Not applicable
Author

I have one input ActiveMQ queue which holds all incoming messages to process (namely "Event.Q")
Trying to build "Dispatcher" Job which will "route" incoming messages on set of different AMQ queues (namely "Proc_xxx.Q") based on incoming JMS property (event_type) to paralellize further processing on multiple threads in separate jobs. 
To simplify case, let's stick on random value generated on each incoming row to build a suffix part of destination queue.
In tMomOutput i can observe 2 places where JMSDestination can be set:
1. Basic Settings - To
 - Can't obtain here row-based value to set destination. It is  null in run-time and causing NullPointer Exception
2. Advanced Settings - Set JMS Header - JMSDestination
 - Expect Destination type instead of String
0683p000009MHE2.png 0683p000009MH5K.png 0683p000009MHEW.png
0683p000009MHEb.png
Anonymous
Not applicable
Author

Hi,
Did you even manage to solve this issue? I have a similar business case.
Kind Regads.
Anonymous
Not applicable
Author

I also have a similar scenario--has anyone figured out how to do this?
Jeeva
Contributor
Contributor

As the queue initialization is done before tMomOutput we have to explicitly add the following line to update the queue in case if we need to pass the message the dynamic queues. The following line has to be added one step before the to tMomOutput. The tMomOutput  To field can be set with the dummy queue name. 


javax.jms.Destination des_tMomOutput_1;
des_tMomOutput_1 = session_tMomOutput_1.createQueue("DestinationQueueName");

producer_tMomOutput_1 = session_tMomOutput_1.createProducer(des_tMomOutput_1);