简体   繁体   English

如何理解客户端没有来自 IBM MQ 的消息的原因?

[英]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.我有一个非常奇怪的问题 - 有时(约占所有消息的 8%)我们的微服务,它从 IBM MQ 发送和接收消息,没有从队列中接收消息,但是这个消息存在于队列中,服务只是等待 50秒(这是我们的时间),仅此而已。 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?主要问题不是关于问题的原因,而是关于为什么 IBM MQ 客户端(com.ibm.mq.allclient 版本 9.1.1.0)不抛出异常?

Update For more details: We have client which try to get message from queue during 50 seconds.更新有关更多详细信息:我们有客户端尝试在 50 秒内从队列中获取消息。 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.不幸的是,我没有直接访问队列的权限,但我可以获得一些日志文件,并且我可以看到消息在回复队列中出现了 8-9 秒。 It looks like everything is fine, but I don't know why ibm client couldn't pick up message from queue for 50 seconds.看起来一切都很好,但我不知道为什么 ibm 客户端在 50 秒内无法从队列中获取消息。 I increased timeout and see that these suspended jsm client requests pick up messages from reply queue for 57-61 seconds.我增加了超时,看到这些暂停的 jsm 客户端请求从回复队列中提取消息 57-61 秒。 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.对我来说,不清楚两件事:1)延迟的原因是什么 2)为什么 ibm jms 客户端的实现不会抛出任何异常,只转发 null 之类的响应。

About version of com.ibm.mq.allclient: I've used versions: 9.1.0, 9.1.1, 9.1.5关于 com.ibm.mq.allclient 的版本:我使用的版本: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获取消息...返回消息 99

  • Get message 99... not found, because you have already processed it.获取消息 99... 未找到,因为您已经处理了它。

make sure you clear/use_new structures when getting the messages确保在收到消息时清除/使用_new 结构

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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