MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Use 1 queue to send messages to several topics

  • 1.  Use 1 queue to send messages to several topics

    Posted Fri February 24, 2023 08:55 AM

    Good morning all !

    As long-time users of IBM MQ (9.1), we now face a challenge in our messaging system. Our current setup involves using JDE to send messages through a Queue Manager to a remote QM with a simple point-to-point configuration.

    We must now send messages to one more consumer, and we understand that we must use topics + subscriptions to accomplish this. The solution we envision involves using Queue aliases that point to the topic, resulting in two outbound queues. However, a limitation of JDE only allows us to specify one outbound queue.

    Do you know if it is possible to use one queue to send messages to two consumers in a publish/subscribe configuration?

    We have the sensation that this is not possible, and that if you have multiple topics configured, then you are required to have multiple queues as well.

    Thank you in advance for your time and assistance.

    Best regards,

    Philippe



    ------------------------------
    Philippe
    ------------------------------


  • 2.  RE: Use 1 queue to send messages to several topics

    Posted Fri February 24, 2023 09:04 AM

    Hello Philippe
    Check out Streaming queues (https://www.ibm.com/docs/en/ibm-mq/9.2?topic=scenarios-streaming-queues)
    Be careful, MQ 9.1 will go EOS in September.



    ------------------------------
    Luc-Michel Demey
    DEMEY CONSULTING
    lmd@demey-consulting.fr
    #IBMChampion
    ------------------------------



  • 3.  RE: Use 1 queue to send messages to several topics

    Posted Fri February 24, 2023 01:45 PM

    This is the technique, without using streaming queues.

    https://www.ibm.com/support/pages/mq-you-want-put-message-queue-and-you-want-generate-duplicate-messages-other-queues



    ------------------------------
    Tim Zielke
    ------------------------------



  • 4.  RE: Use 1 queue to send messages to several topics

    Posted Fri February 24, 2023 02:01 PM

    Thanks both for the info !

    We are trying Tim's solution. However if we test to publish a message by using the 'Put Test Message' in the Queue alias which points to the topic, we don't receive the message in the corresponding output queue defined in the subscription. So, I am wondering, should this test work, or is this because of something wrong in our setup ?



    ------------------------------
    Philippe
    ------------------------------



  • 5.  RE: Use 1 queue to send messages to several topics

    Posted Sat February 25, 2023 01:36 PM

    Please disregard my previous message. I have successfully followed the procedure outlined in Tim's URL.

    Our next step is to implement a more complex setup by routing messages to subscribers subscribed to a topic based on the message content.
    After consulting the documentation (https://www.ibm.com/docs/en/ibm-mq/9.1?topic=components-topics), I have found that we can use either a content-based or subject-based filter to achieve this.

    However, the use of a content-based filter would require us to adapt our application by implementing topic strings or message properties.
    Alternatively, we could use IIB to implement a full content-based filter.

    I would like to confirm if there are any other alternatives available that would allow us to use filters on the message content without having to adapt our application or use IIB.



    ------------------------------
    Philippe
    ------------------------------



  • 6.  RE: Use 1 queue to send messages to several topics

    Posted Sun February 26, 2023 05:33 PM

    I believe you can write your own content based filtering mechanism to interact with the same queues that IIB uses to provide content based filtering for MQ. I'm not sure this is documented anywhere though, but it was supposed to be an external interface.

    Alternatively, you could have a program between the subscriber queue and the getting application to read and filter out the messages before passing them onto another queue for the getting application to read. This is assuming that the getting application also cannot be changed to disregard any messages that should have been filtered out. This is obviously not as efficient as filtering out the message in the pub/sub process, but unless you are pushing the boundaries of how many messages your queue manager can handle, it could be a solution.

    If you just have fairly simple filtering requirements, there may already be applications that can do such a thing.

    Perhaps you can tell us a little bit about the shape of the content and what you want to filter from that content? If it just required a simple ASCII/EBCDIC or hex string search, then something like QLOAD could do it. Read from the subscriber queue, and only forward on the messages that match the simple search.

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 7.  RE: Use 1 queue to send messages to several topics

    Posted Mon February 27, 2023 04:09 AM

    Qload seems indeed promising, thanks !

     In our case, the application generates flat files. What we need to achieve is to route the messages coming from a single queue on output queues based on simple ASCII text match.

    So, from the documentation (can't test it until license is bought), I understand that it can be simply achieved by something like:

    qload -m <Queue ManagerName> -I <Input Queue Name> -o <Output queue name1> -s AAA

    qload -m <Queue ManagerName> -I <Input Queue Name> -o <Output queue name2> -s BBB

    ....

    Philippe.



    ------------------------------
    Philippe
    ------------------------------



  • 8.  RE: Use 1 queue to send messages to several topics

    Posted Mon February 27, 2023 04:17 AM

    Aaaaah: https://www.ibm.com/docs/en/ibm-mq/9.1?topic=objects-using-dmpmqmsg-utility-between-two-systems

    No need to buy licences, did not know that it was already included. Let me try, thanks !



    ------------------------------
    Philippe
    ------------------------------



  • 9.  RE: Use 1 queue to send messages to several topics

    Posted Mon February 27, 2023 05:22 AM

    I thought you needed to send to multiple recipients? If so, you can specify qload with -o multiple times, or even provide a list of the destinations as a file to save on having lots of parameters - see Loading files to multiple queues (which FYI can be used queue<->queue or file<->queue)

    You can test with a trial license before deciding whether to buy. Be aware QLOAD has more functions than dmpmqmsg - so definitely test out what you need and try before you spend money.

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 10.  RE: Use 1 queue to send messages to several topics

    Posted Mon February 27, 2023 08:18 PM

    If you are looking at different solutions to your problem, then you can also check out MQ Message Replication

    Regards,
    Roger Lacroix
    Capitalware Inc.



    ------------------------------
    Roger Lacroix
    CTO
    Capitalware Inc.
    London ON Canada
    https://capitalware.com
    ------------------------------



  • 11.  RE: Use 1 queue to send messages to several topics

    Posted Tue February 28, 2023 05:12 AM

    Another alternative indeed, thanks for that. With Qload/dmpmqmsg we are happy, as this is doing exactly what we need.

    Thanks all for your helpfull messages !



    ------------------------------
    Philippe
    ------------------------------