2 Replies Latest reply on Apr 17, 2003 6:45 AM by julien

    publishing messages and clusters

    julien

      Hi,

      I'm trying to publish messages from inside a session bean. Everything works fine until I start a second JBoss in cluster (I get only half of my messages).
      I'd like to tell the EJB of the second cluster to publish messages in the first JBoss and I just can't figure out how to do it.
      Does anyone know?

        • 1. Re: publishing messages and clusters

          You have to lookup the connection factory
          in the jndi tree of the jboss instance
          you want to receive the messages.

          One solution would be to only deploy jbossmq
          on one machine and use HAJNDI on port 1100

          Regards,
          Adrian

          • 2. Re: publishing messages and clusters
            julien

            thanks,

            in fact I was looking in JBoss configuration files if I couldn't set somewhere the JMS publisher's destination provider, with your advice, I managed to do it directly into the code:

            java.util.Properties p = new java.util.Properties();
            p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
            p.put("java.naming.provider.url", "hostname:1100");
            p.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
            Logger.dev("JMSCache","getInitialContext","Properties ready");
            //Now use those properties to create
            //a JNDI InitialContext with the server.
            ctx = new InitialContext( p );