简体   繁体   中英

How to understand the reason of no messages from IBM MQ on client side?

I have a very strange problem - sometimes (~8% of all messages) our microservice, which sends and receives messages from IBM MQ, doesn't receive a message from the queue, but this message exists in the queue, service just waits 50 sec (it's our time out) and that's all. Nothing about exceptions in the log...

The main question not about the reason for the problem, this one about why IBM MQ client(com.ibm.mq.allclient version 9.1.1.0) doesn't throw an exception?

Update For more details: We have client which try to get message from queue during 50 seconds. The code below is very simple:

private fun receiveMessage(messageId: String, properties: ApplicationProperties): String {
    val routeId = route.id
    val responseQueue = properties.client.responseQueue
    val response = jmsTemplates[routeId]?.receiveSelectedAndConvert(responseQueue, "JMSCorrelationID='$messageId'")

    return response?.let {
        RequestContext.getCurrentContext().responseStatusCode = 200
        it.toString()
    } ?: throw ZuulRuntimeException(ZuulException("Forwarding error", 500, "No response message has been received for : "
                + "routeId=" + routeId
                + "; messageId=" + messageId
                + "; responseQueue=" + responseQueue))
}

Unfortunately I don't have direct access for queue but I can get some logs files and as I can see messages have appeared in reply queue for 8-9 seconds. It looks like everything is fine, but I don't know why ibm client couldn't pick up message from queue for 50 seconds. I increased timeout and see that these suspended jsm client requests pick up messages from reply queue for 57-61 seconds. And for me is unclear two things: 1) What the reason for delay 2) And why implementation of ibm jms client doesn't throw any exceptions only forward null like response.

About version of com.ibm.mq.allclient: I've used versions: 9.1.0, 9.1.1, 9.1.5

Could this be the classic problem where you forgot to initilise which messages you want for example

  • Get message... returns message 99

  • Get message 99... not found, because you have already processed it.

make sure you clear/use_new structures when getting the messages

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM