1 Reply Latest reply on Nov 4, 2003 4:47 PM by Adrian Brock

    JMS with Standalone Tomcat as consumer

    duelin_markers Newbie

      I'm working on getting a bunch of standalone Tomcat servers to subscribe to a topic on a JBoss server. I've read numerous threads here about configuring a client to use JBoss' JNDI context (by specifying java.naming.factory.initial, java.naming.factory.url.pkgs, and java.naming.provider.url in jndi.properties) to allow them to get at JBoss' ConnectionFactory. The added complication here is that each Tomcat instance already has its own local JNDI context, which we need.

      The generic solution I can see to this is to create my own javax.naming.spi.ObjectFactory implementation to use in Tomcat, whose getObjectInstance method will create an InitialContext for the remote JBoss server (using the properties mentioned above) and return whatever it gets from that Context for the JNDI name that was used to get the ObjectFactory locally. (So, looking for java:comp/env/topic/myLittleTopic on Tomcat will cause the ObjectFactory implementation to open up JBoss' context and return whatever it returns from a lookup of java:comp/env/topic/myLittleTopic.)

      Does this seems sensible?

      Also, this seems like something that has probably been dealt with before. Am I reinventing the wheel?

      Any comments are appreciated. Thanks.

      -john.

        • 1. Re: JMS with Standalone Tomcat as consumer
          Adrian Brock Master

          This is a Tomcat question not a JBoss question
          and definitely not a messaging question.

          Last time I looked, Tomcat did some funny things with naming,
          including using <ejb-link> as the actual jndi name.
          At least for ejbs you can specify jnp:/remotehost:1099/ejbs/MyEJB

          I won't be answering anymore questions about Tomcat
          in this thread.

          Regards,
          Adrian