-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
Describe the bug
When using the IBM MQ Golang library, I have two mainframe queues configured on the same channel and connection. With WaitInterval
set to -1
, my consumer is able to retrieve all 10 messages from the first queue. However, when I put 15 messages on the second queue, the consumer only retrieves 10 messages, even though 15 were sent.
To Reproduce
Steps to reproduce the behavior:
- Set up two mainframe queues on the same channel and connection.
- Use the IBM MQ Golang library to consume messages with
WaitInterval = -1
. - Put 10 messages on Queue 1 and observe that all 10 are consumed.
- Put 15 messages on Queue 2 and observe that only 10 are consumed.
same logic is for both queue consumer
for {
// Message Descriptor
msg := ibmmq.NewMQMD()
// Get Message Options
gmo := ibmmq.NewMQGMO()
gmo.Options = ibmmq.MQGMO_WAIT | ibmmq.MQGMO_NO_SYNCPOINT | ibmmq.MQGMO_CONVERT
gmo.WaitInterval = ibmmq.MQWI_UNLIMITED // Wait indefinitely for a message
logger.Debug("Listening WIVS...")
msg.CodedCharSetId = 37
// Buffer to store the message
buffer := make([]byte, 1024) // Adjust size based on expected message size
// Get the message
dataLen, err := MQObject.Get(msg, gmo, buffer)
if err != nil {
// Handle specific MQ errors
mqErr, ok := err.(*ibmmq.MQReturn)
if ok && mqErr.MQRC == ibmmq.MQRC_NO_MSG_AVAILABLE {
// No message available, continue listening
logger.Debug("No message available, continuing to listen...wivs1")
continue
}
if mqErr.MQCC == ibmmq.MQRC_HOBJ_ERROR {
logger.Error("MQ object Closed WIVS")
break
}
logger.Error("Error getting message: ", zap.Error(err))
break
}
}
Metadata
Metadata
Assignees
Labels
No labels