10 Replies Latest reply: Mar 7, 2012 8:59 AM by Patrick Refondini RSS

Remote JMS client with JBoss 7?

Sergey Zhigunov Newbie

What is the target JBoss 7 release which would support remote JNDI lookup for JMS queues / factories? I am porting JRun based system to JBoss and it has remote JMS Spring clients.

  • 1. Re: Remote JMS client with JBoss 7?
    Andy Taylor Master

    thats really a question for the AS7 guys, its not really anything to do with HornetQ

  • 2. Re: Remote JMS client with JBoss 7?
    Patrick Refondini Newbie

    FYI I successfully tested JBOSS AS 7.0.2 as JMS server with remote clients connecting using Netty.

    HornetQ configurations are found in the now single centralised JBOSS AS configuration file in section (XML tag):

    <subsystem xmlns="urn:jboss:domain:messaging:1.0"> ... </subsystem>

    But be aware remote JNDI tree look up seem to be scheduled for JBOSS AS 7.1.0 as far as I understood.

  • 3. Re: Remote JMS client with JBoss 7?
    Sergey Zhigunov Newbie

    Yes, I was able to connect remotely using core API, but the app I am porting is going through JNDI, so will wait for 7.1

     

    Thanks

  • 4. Re: Remote JMS client with JBoss 7?
    Erhard Siegl Newbie

    The signals that are sent by the jboss community are a little confusing regarding that topic. In http://community.jboss.org/message/634952#634952 Sergey asked the question about JNDI and JBoss 7.1.0 and in http://community.jboss.org/message/635111#635111 the option of not supporting JNDI was argued with "There is nothing in the Java EE platform specification about remote JNDI access from standalone clients."

     

    Looking at the examples in Chapter 9 of the JMS specification (JSR 914) I wonder wether this applies to JMS, but I don't want to argue about specs. Fact is that I have enterprise applications that uses remote EJB-calls and JMS and that we tried without success to configure HermesJMS to manage the queues in AS7 and that I have no idea how to connect e.g. Camel or a JMS-bridge from other systems without the JNDI-thing. All these things work in other application servers including JBoss 4, 5 and 6. I don't think not supporting these tools and applications is really an option, especially since JBoss plays a major role in the enterprise market, where compatibility with older versions is a big issue.

     

    It would be great, if someone could clarify the JMS question similar to the EJB/RMI question in http://community.jboss.org/thread/174414

  • 5. Re: Remote JMS client with JBoss 7?
    henk de boer Master

    Erhard Siegl wrote:

     

    It would be great, if someone could clarify the JMS question similar to the EJB/RMI question in http://community.jboss.org/thread/174414

     

    I also wonder about this. Anyone already has an answer to this?

  • 6. Re: Remote JMS client with JBoss 7?
    Andy Taylor Master

    Im not sure its a question for us, the guys on the AS7 forums will be able to answer when remote jndi will be available. until then youy can create connection factories using the HornetQConnectionFactory classes directly and look up the queu etc using the jms api.

  • 7. Re: Remote JMS client with JBoss 7?
    Ed Keen Newbie

    Patrick, can you give me a pointer on what you did in order to connect remotely using Netty?  Did you have to make any config changes to standalone.xml?  Also, is there an example in the hornetq distribution that shows how to do this?  Any pointers would be greatly appreciated.

  • 8. Re: Remote JMS client with JBoss 7?
    Patrick Refondini Newbie

    Hi Ed,

    I tested JBoss 5.1.0.GA with standard messaging replaced by HornetQ 2.2.5.Final implementation on "client" side (both for messages senders and listeners) and JBoss 7.0.2 as messaging server.

     

    In 7.0.2 you had to use the standalone-preview.xml located in jboss-as-7.0.2.Final/standalone/configuration/ in order to have messaging defined.

    In 7.1.0.CR1b you should use standalone-full.xml located in jboss-as-7.1.0.CR1b/standalone/configuration/ in order to have messaging defined.

     

    The first configuration change you might want to perform is adding your custom queues/topics, look for "jms-destinations" element to find out the existing test queue/topic.

     

    To have the server accessible on something else than the loopback I started it with:

    ./standalone.sh -b 0.0.0.0 -bmanagement=0.0.0.0 --server-config=standalone-preview.xml

     

    On the "client" side I configured:

     

    1) A JMS data source for outbound JMS connections located in $JBOSS_HOME/server/default-with-hornetq/deploy/jms-remote-ds.xml

    2) The resource-adapter properties found in $JBOSS_HOME/server/default-with-hornetq/deploy/hornetq-ra.rar/META-INF/ra.xml for inbound connections (Message Driven Beans):

     

    The content of these files depend on the type of netty communication you perform (host based, autodiscovery,...). Feel free to contact me directly I can send you a couple of examples but I have no time to compile something relevant for the current thread.

     

    In addition, the "secret" to use netty connection only with JMS API yet being able to access Queue / Topic object (usually done with JNDI) is by using the JMS QueueSession object createQueue("myQueueName") method as I described in Your opinion regarding "obtaining JMS Queue directly from JMS QueueSession using Netty connection only and no JNDI." :  http://community.jboss.org/thread/174708

     

    That's about it...

  • 9. Re: Remote JMS client with JBoss 7?
    tc7 Newbie

    I've tried to bring some of this all together in a single post - see https://community.jboss.org/message/721977#721977.

  • 10. Re: Remote JMS client with JBoss 7?
    Patrick Refondini Newbie

    Thanks a lot for the single post wrap up.