ibm-messaging/mq-golang

Multiple Queue Mgr

2020testuser opened this issue · 4 comments

Hi,
Can anyone provide some details on the below?
I want to use the best design so I don't run into issues later.

I want to connect to two different Queue Managers (each Queue Manager with 5 queues each) programmatically using the mq-golang package?

Which option below is the best option that would be easy for troubleshooting and performance? I get approximately 40 million messages (all 5 queue messages in total ) per second in the queues and want to process all messages quickly before they get deleted from the queue.

  1. One Queue Mgr Connection for EACH Queue Mgr - > 5 queues

  2. One Queue Mgr Connection for both Queue Mgr -> 10 queues ( I don't think this is possible, but want to confirm)

Thanks in advance!

A connection is only ever to a single queue manager.

I don't understand what you mean by "process all messages before they get deleted from the queue." Either your program is removing them , or some other program is. Or they have been set with an expiry, in which case the sender has already determined that they may not be useful after a while.

@ibmmqmet - Thanks! Yes, you are correct. I had another app. consuming the message (which I was unaware of). So, in IBM MQ, can I have many consumers (say, 5 consumers) consuming the same message? Once all consumers consumed, the message must be removed. So, is this possible?
Sorry. New to MQ and trying to compare this with Kafka. Thanks!

An MQ message can be destructively read by only one program. Any number of programs can BROWSE the message while it's still on the queue, but once someone's removed it, it's gone. That's a fundamental point of MQ, with it's once-and-once-only delivery design.

If you want to have multiple consumers of the same data, then you should be looking at the publish/subscribe model using topics instead of queues.

@ibmmqmet - Thanks Much! This really helps.