6 Replies Latest reply on Oct 13, 2009 9:09 AM by Tim Fox

    InVM connector not being used when sending messages

    Ross Nicholson Apprentice

      Should hornetq be using the InVM connector when sending messages to a local queue?

      I'm just using a simple servlet to send messages. I need to have both the local netty acceptor and connector enabled to be able to send anything. I would have thought that the InVM connector would be used in this case.

        • 1. Re: InVM connector not being used when sending messages
          Ross Nicholson Apprentice

          If both the acceptor and connector are disabled:

          javax.naming.NameNotFoundException: ConnectionFactory not bound
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
           at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
           at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
           at javax.naming.InitialContext.lookup(InitialContext.java:392)
          


          If only the acceptor is disabled:

          javax.jms.JMSException: Unable to connect to server using configuration org-hornetq-integration-transports-netty-NettyConnectorFactory?hornetq-remoting-netty-port=5445&hornetq-remoting-netty-host=localhost
           at org.hornetq.core.client.impl.ConnectionManagerImpl.createSession(ConnectionManagerImpl.java:290)
           at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:976)
           at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:721)
           at org.hornetq.jms.client.HornetQConnection.authorize(HornetQConnection.java:710)
           at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:729)
           at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:307)
           at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:302)
          


          • 2. Re: InVM connector not being used when sending messages
            Tim Fox Master

            It uses whatever connector/acceptor you configure it to use.

            How are you creating connections? Are you looking up a connection factory from JNDI? If so, which one?

            • 3. Re: InVM connector not being used when sending messages
              Tim Fox Master

              If you are using JNDI to lookup a connection factory on the client side, then, on the server side there will be a file called hornetq-jms.xml in which your connection factory is defined.

              That connection factory will reference a connector via the connector-ref attribute. The connector with that name is defined in hornetq-configuration.xml.

              In the connector definition for that connector, it will define which transport it uses. That can be invm, netty or whatever you choose.

              • 4. Re: InVM connector not being used when sending messages
                Ross Nicholson Apprentice

                Yes, I'm using JNDI, the same connection factory I've always used "/ConnectionFactory".

                Should I be using something else? Out of the box, HornetQ tries to use the netty connector/acceptor for this connection factory.

                • 5. Re: InVM connector not being used when sending messages
                  Ross Nicholson Apprentice

                  Ah, yes.

                  Is there a reason the default is netty?

                  Are there performance gains to be had by using netty over InVm? If it's better to use netty I'll leave it as that.

                  The reason I'm bringing this up is I'm trying to find out why memory size never decreases on server when I send messages using a bridge. I thought that maybe this might interfere with acknowledgements being sent.

                  • 6. Re: InVM connector not being used when sending messages
                    Tim Fox Master

                    If you are looking up /ConnectionFactory that's in the global JNDI space - so it should us Netty - since the invm transport's not going to work when the client is in a different process.

                    If you are looking up java:/ConnectionFactory - that's the local invm JNDI namespace (that's what java: means), so it should use invm by default. That connection factory definition is currently missing from the config., but I've just added it in TRUNK (see my last commit).

                    You could add the same definition to your config file if you like.