0
私はJAVAアプリケーションを持っています。作成コンシューマですべてのエンキュー・メッセージをパージする必要があります。私はエンキューされたメッセージを削除してから処理されてからキューに入れられたメッセージを防ぐために、消費者を作成するにはどうすればよい作成者のActiveMQパージ・エンキュー・メッセージ
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(messageBrokerUrl);
try {
connection = connectionFactory.createConnection();
connection.start();
this.session = connection.createSession(this.transacted, ackMode);
Destination adminQueue = this.session.createQueue(messageQueueName);
this.replyProducer = this.session.createProducer(null);
this.replyProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
//Set up a consumer to consume messages off of the admin queue
MessageConsumer consumer = this.session.createConsumer(adminQueue);
consumer.setMessageListener(this);
} catch (JMSException e) {
log.error("Error al configurar servicio de colas MQ. " + e.getMessage());
}
:
は、私は次のコードを持っています。