0

I am not familiar with MQ so forgive me if I'm not explaining myself properly. We have received a message on a queue that is failing when being read with a 2110 MQRC_FORMAT_ERROR. It would seem that the problem is it doesn't have a 'Format' specified, e.g. we are expecting 'MQSTR'. The client code (C#) is catching the MQException and doing a MQQueueManager.Backout() however the message is just going back onto the queue and being read and rejected again by the client.

Looking at the queue I saw that it did not have a backout queue or backout threshold set. The queue manager also did not have a dead letter queue set. So what I've done is setup the DLQ and set the queue's backout queue to it with a backout threshold of 5. However the message is still stuck on the queue being continually read and put back. The backout count for the message is currently approaching 20 million.

I would like to get the backout and DLQ working but if there is another method to just manually delete or move this message that would help for now. It is just a test message so it doesn't matter if we lose it.

EDIT: I've had to clear the queue to get things moving so unfortunately might not be able to test any solutions until it happens again.

4

1 回答 1

6

MQ 本机客户端不会自动将错误消息移动到BackoutQDLQ。应用程序必须编写额外的代码才能将消息移动到DLQBackout queue。但是 XMS .NET 和 JMS 客户端可以完成这项工作。XMS .NET 是 C# 语言的 JMS 规范实现。XMS .NET 与 MQ 客户端包捆绑在一起。

谈到你的情况:

MQRC_FORMAT_ERROR 实际上并不是一个错误,它是一个警告,告诉应用程序 MQ 客户端无法转换传入的消息,并且它向应用程序传递了一条未转换的消息。应用程序必须处理此异常并且不应回滚此类消息。您将需要调查发送此类消息的应用程序并修复任何问题。

请在此处查看文档。

于 2013-10-28T04:41:05.157 回答