We have a need to log all the messages written to different queues to the same table. We are planning to use DB2 stored procedures with MQ Listeners. One of the columns in the log table is used to indicate the source of the message (say Source1, Source2, etc).
know that the DB2 MQ Listener will deliver the message to the Stored Proc as input. I am trying to find out if there is any way to identify the source queue name in the stored procedure.
You can check SYSMQL.LISTENERS but why dont you design multiple SP's for different queue's and each SP does its own task as it should and make a MQ set up that way?
If you want several different message types to be processed by different DB2 stored procedures (i.e., message type A drives an insert to DB2 table X, message type B is input to an update of table Y, etc.), set up several input queues, and associate with each the stored procedure that is to operate on a given message type. Then, have the input-providing application programs direct each message type to its designated queue.
Source1--->Queue name( say 'source1.queue')---> SP name( say source1) and so on...