1 Reply Latest reply on Oct 25, 2010 12:46 AM by chandras_a

    Issues with org.hornetq.api.core.Interceptor to intercept the Topic subscription

    chandras_a

      Hi,

          I have observed few issues with org.hornetq.api.core.Interceptor to intercept the Topic subscriptions.

      I am trying to monitor the new connections to the topic.

      If I intercept the packet for ‘SessionCreateConsumerMessage’ object, getFilterString to get the Message selector data is always null.

      And getQueueName() doesn’t return topic name properly.

       

      I think this is a bug.

      Sample is:

       

       

      public class SimpleInterceptor implements Interceptor

      {

       

         public boolean intercept(final Packet packet, final RemotingConnection connection) throws HornetQException

         {

       

       

            if(packet instanceof SessionCreateConsumerMessage)

            {

                   SessionCreateConsumerMessage consumerCreateMessage = (SessionCreateConsumerMessage)packet;

                   System.out.println("-----"+conMessage.getFilterString());----This is always null.

                             System.out.println("-----"+conMessage.getQueueName());      }

       

       

            return true;

         }

       

      }

      It returns the Queue name e4f6557a-8893-4c65-b5b3-1233566559d0

       

       

      I have attached the samples.

       

      Thanks,

      Chandra

        • 1. Re: issues with org.hornetq.api.core.Interceptor to intercept the Topic subscription
          chandras_a

          I see Filter string is being returned on intercepting CreateQueueMessage,but i dont see any API to get the consumer id.

          And getQueueName() doesn’t return topic name properly.

           

          if(packet instanceof CreateQueueMessage) {
                    CreateQueueMessage conMessage = (CreateQueueMessage)packet;
                    logger.debug("Filter:"+conMessage.getFilterString());
                    logger.debug("Queue Name:"+conMessage.getQueueName());       
                   
                }