开发者

Apache ActiveMQ 5.3 - How to configure a queue to reject duplicate messages?

开发者 https://www.devze.com 2022-12-13 08:55 出处:网络
I need the queue to enforce no-duplicate policy. Is it possible? If so , how? (I\'ve been googling for hours... )

I need the queue to enforce no-duplicate policy. Is it possible? If so , how? (I've been googling for hours... )

Edit:

The ActiveMQSession implementation has this lines:

        // transform to our own message format here
            ActiveMQMessage msg = ActiveMQMessageTransformation.transformMessage(message, connection);

        // Set the message id.
        if (msg == message) {
            msg.setMessageId(ne开发者_如何学运维w MessageId(producer.getProducerInfo().getProducerId(), sequenceNumber));
        } else {
            msg.setMessageId(new MessageId(producer.getProducerInfo().getProducerId(), sequenceNumber));
            message.setJMSMessageID(msg.getMessageId().toString());
        }

The ActiveMQMessageTransformation is plugable (you can set it) , but the following if statement is a rather incontrovertible .

Any ideas , except changing their code?


ActiveMQ has duplicate message detection built in - how are you defining a duplicate ? If the duplicate has the same messageId - it should be discarded

0

精彩评论

暂无评论...
验证码 换一张
取 消