-
1. Re: Your opinion regarding "obtaining JMS Queue directly from JMS QueueSession using Netty connection only and no JNDI"
ataylor Nov 10, 2011 12:01 PM (in response to refon)1 of 1 people found this helpfulim not sure if you will see any difference, the best way would be to map it as a resource, i think you can do this even with remote jndi, or if you have hornetq running locally too simply define it there and use local jndi i.e.
@Resource("queuName")
Queue q;
altho i cant remember the exact syntax
-
2. Re: Your opinion regarding "obtaining JMS Queue directly from JMS QueueSession using Netty connection only and no JNDI"
refon Nov 13, 2011 12:57 PM (in response to ataylor)Dear Andy thank you for your feedback, I am happy to read you think I shall not see any difference (in performance I guess), and agree it would be better to map JMS Queue as resource. But put simply, I could achieve accessing local JMS Queue as resource using the following syntax:
@Resource(mappedName = "queue/myQueueName")
Queue myQueueName;
but did not find a way (configuration or syntax...) to achieve this for remote JMS Queues!
On the other hand I was able to access a remotely located ConnectionFactory using properly defined HornetQ and JMS datasource configurations (using netty) and the following syntax:
@Resource(mappedName = "java:/MyRemoteJmsXA")
ConnectionFactory connectionFactory;
Then I worked around not obtaining the remote Queue resource by using:
queueSession.createQueue("myQueueName");
where the queueSession is obtained throught queueConnection itself obtained from the remote connectionFactory.
-
3. Re: Your opinion regarding "obtaining JMS Queue directly from JMS QueueSession using Netty connection only and no JNDI"
clebert.suconic Nov 13, 2011 8:28 PM (in response to refon)1 of 1 people found this helpfulTo lookuop the queue: I don't remember the method name now.. but there is a createQueue method on the javax.jms.Session that will create the queue object.
JNDI is a bit overkill as it's using a lot of serialization. It's always best to create the object directly.
-
4. Re: Your opinion regarding "obtaining JMS Queue directly from JMS QueueSession using Netty connection only and no JNDI"
refon Nov 15, 2011 1:43 AM (in response to clebert.suconic)Dear Clebert thank you for pointing out avoiding JNDI is positive with regards to performances.
Could it be that the "lookup queue" method you think about is also the "createQueue" method you mention:
javax.jms.Session.createQueue(String queueName)
Or do I overlook the difference between queue look up and queue identity creation ?
Indeed to me, this Session.createQueue() method name was missleading until I finally read the Javadoc:
public Queue createQueue(String queueName) throws JMSException
Creates a queue identity given a Queue name.
This facility is provided for the rare cases where clients need to dynamically manipulate queue identity. It allows the creation of a queue identity with a provider-specific name. Clients that depend on this ability are not portable.
Note that this method is not for creating the physical queue. The physical creation of queues is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary queues, which is accomplished with the createTemporaryQueue method.
(...)Full Javadoc ref.: http://download.oracle.com/javaee/1.4/api/javax/jms/Session.html#createQueue%28java.lang.String%29