0
votes

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

1
Can you show some code where the "lack of exception" occurs? If you see messages on the queue are you sure they are committed? To answer your question will require more understanding of what your application does. What call do you use to receive the messages from the queue? Are you using IBM MQ classes for Java or IBM MQ classes for JMS? Have you tried a more up to date version, in the 9.1 CDS stream they are up to 9.1.5.JoshMc
I assume you display the queue to see whether the message is there? Next time, use DISPLAY QSTATUS(qname) ALL and see what value is shown for the UNCOM attribute.Morag Hughson
@JoshMc I've updated my postBllakus

1 Answers

0
votes

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