English 中文(简体)
Apache ActiveMQ 5.3 - How to configure a queue to reject duplicate messages?
原标题:
  • 时间:2009-12-08 17:01:23
  •  标签:
  • activemq

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(new 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





相关问题
Geronimo vs Glassfish

For a production environment, is Apache Geronimo better for applications that uses ActiveMQ, Derby, Solr?

Anyone using multicast with ActiveMQ

I m having trouble setting up multicast transport using ActiveMQ. I noticed with version 5.2 there is a bug that prevents it from even building the correct factory (fixed in 5.3). The fact this bug ...

How to optimize activemq

I m using ActiveMQ on a simulation of overloading servers in Java. And mainly it goes ok, but when I get over 600 requests the thing just go WTF! I think the bottleneck is my Master Server which is ...

ActiveMQ Consumer / Producer Connection Listener

I can t seem to find a way to listen for new producer and consumer connections (or connection interrupts) in ActiveMQ (Java Version). I want to be able to tell the consumers (or they can find out ...

热门标签