1 Reply Latest reply on Jun 24, 2013 3:01 AM by Christian Behrenberg

    HornetQ remoting-incoming-interceptors + POJO subsystem + Interceptor classname + Maven

    Christian Behrenberg Newbie

      Hello,

       

      I am using a JBoss AS 7.2.0.Final "Janus" version with an integrated HornetQ version 2.3.0.CR1; I develop my EAR deployments in Eclipse (Indigo), dependencies are resolved with Maven (pom.xml). My goal is to test the HornetQ incoming interceptor functionality. I would like to reject messages because of their content. --- So I wrote a simple test class "MyInterceptor" which implements the Interceptor interface. In order to use the (required) org.hornetq.api.core.* classes, I added the hornetq-core artifact (version: 2.3.0.BETA1) to the pom.xml of my project.

       

      When deploying on a standalone-full-ha JBoss, I get an error like

       

      Service jboss.pojo.\"org.jboss.netty.internal.LoggerConfigurator\".DESCRIBED is already registered
      

       

      so, as I read here on the forums, I disabled the POJO subsystem and it deployed very well. The class is located inside a package "jms", so I added the following lines into the <hornetq-server>-node of my standalone-full-ha.xml, as follows (and as it is written in the HornetQ manual):

       

      <remoting-incoming-interceptors>
        <class-name>jms.MyInterceptor</class-name>
      </remoting-incoming-interceptors>
      

       

      The intercept-method of MyInterceptor writes out some System.out's and sets a new string property in the message. Inside the deployment there is also a simple MDB, which prints out the TextMessage, but the intercept-method is not triggered. The message is delivered as if there is no interceptor.

       

      Regarding that, there is one line in the manual of HornetQ, which itches me:

       

      The interceptors classes (and their dependencies) must be added to the server classpath to be properly instantiated and called. (http://docs.jboss.org/hornetq/2.3.0.CR1/docs/user-manual/html_single/#d0e13519)

       

      What I don't get is the following:

       

      1. If I deploy an EAR with the class MyInterceptor in it, --- shouldn't the server take that class from there?
      2. Do I really have to put an additional JAR with the class anywhere in my JBoss installation? - That doesn't feel right, but if so (and there is no alternative), where?
      3. Is the method not triggered because I disabled the POJO subsystem?
      4. What is the POJO subsystem anyway? I learned that it is new in 7.2.0, but I didn't found any informative description anywhere. Or maybe I just searched at the wrong places.
      5. Is there any possibility to add HornetQ-core dependencies on 7.2.0.Final without running into JBoss errors? (together with the premise that I use Maven for that dependency)

       

      This is my first post in this community, if the post is placed in the wrong forum, please tell me or please move the post.

       

      Thanks and regards,

      -Christian