-
1. Re: Using Hornetq within the same JBOSS AS.
jbertram Aug 29, 2013 10:28 AM (in response to billhmoore)First off, if you're doing a JNDI look-up from within the application server for a resource that exists locally then you shouldn't pass any properties to the InitialContext. Just use an empty InitialContext. It will be much faster and the code will be simpler.
Second, it looks like the error you're hitting is due to a classloading problem. Does your application have a dependency on the "org.hornetq" module? If not, it should.
-
2. Re: Using Hornetq within the same JBOSS AS.
billhmoore Aug 29, 2013 11:45 AM (in response to jbertram)Justin,
Thanks for the quick reply. I will try what you have provided.
I am assuming that I have the org.hornetq module in the JBOSS AS as this is the same server that I used with an test application, which uses the code from above, to connect the app to the server during development and unit testing.
-
3. Re: Using Hornetq within the same JBOSS AS.
billhmoore Aug 29, 2013 12:14 PM (in response to billhmoore)Okay, I can get the context. But what is the name of the TopicConnectionFactory. I was using jms/RemoteConnectionFactory?
-
4. Re: Using Hornetq within the same JBOSS AS.
jbertram Aug 29, 2013 12:21 PM (in response to billhmoore)If you're sending messages the I recommend you use "java:/JmsXA" (since it is pooled) and if you're consuming messages I recommend you use "java:/ConnectionFactory" or an MDB.
-
5. Re: Using Hornetq within the same JBOSS AS.
ataylor Aug 29, 2013 12:22 PM (in response to billhmoore)you need to use the managed connections inside the AS, this is done via the pooled connection factories. take a look at one of the JEE examples shipped with HQ or the AS7 quick starts
-
6. Re: Using Hornetq within the same JBOSS AS.
billhmoore Aug 29, 2013 12:25 PM (in response to jbertram)1 of 1 people found this helpfulAgain thanks for the quick reply!!
I had used the "java:/ConnectionFactory" and that worked but now I have a problem getting the topic.
With the remote, I did a lookup using "jms/topic/whm_dev_ATRInboundTopic" but that is not working?
-
7. Re: Using Hornetq within the same JBOSS AS.
ataylor Aug 29, 2013 12:30 PM (in response to billhmoore)I had used the "java:/ConnectionFactory" and that worked but now I have a problem getting the topic.
you should use the pooled cf, java:/JmsXA
-
8. Re: Using Hornetq within the same JBOSS AS.
billhmoore Aug 29, 2013 12:32 PM (in response to ataylor)I switched to java:/JmsXA. Do I need to change the string which I am using to get the topic?
-
9. Re: Using Hornetq within the same JBOSS AS.
ataylor Aug 29, 2013 12:43 PM (in response to billhmoore)I cant say since i dont know what you configured it under, take a look at one of the many JEE examples, they all do something similar i.e.hornetq/examples/javaee/mdb-tx-send/src/main/java/org/hornetq/javaee/example/server/MDBMessageSendTxExample.java at Horn…
-
10. Re: Using Hornetq within the same JBOSS AS.
billhmoore Aug 29, 2013 12:59 PM (in response to ataylor)I changed "jms/topic/whm_dev_ATRInboundTopic" to "topic/whm_dev_ATRInboundTopic".
Now I can publish the message.
Thanks for the help