activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Altounisi <>
Subject put a message in queue using
Date Mon, 08 Jun 2015 15:49:11 GMT

I was trying to implement an interceptor to log some events happening in the
broker. I want the events to be logged as messages in queue. Thus, the
monitoring client could access the log by consuming messages from that

(I didn't uses advisory topics because I want to dequeue treated messages so
that they will not be treated many times).

So I used interceptors as described  here
<>  .
This example worked correctly for me. However when I do this modification
(to put the log as messages in a queue), I doesn't work any more. (The
modification is in Bold)

public class MyBroker extends BrokerFilter {
     public MyBroker(Broker next) {
    public void addConnection(ConnectionContext context, ConnectionInfo
info) throws Exception {       
        *factory = new
        connection = factory.createConnection();
        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        destination = session.createQueue("monitoring.notifications");
        producer = session.createProducer(destination);
        TextMessage message = session.createTextMessage();
        message.setText("addConnection "+info.getConnectionId()+"  
        super.addConnection(context, info);

This seemed logic for me since my modification passes throw the interceptor
witch makes infinite calls for this class.
For this reason, I thought to take profit of the object "next" in this
implementation which is of type to put a
message in the queue.

Could you please help me ?


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message