RESTEasy MOM Configuration
RESTEasy MOM has only been used/tested with JBoss MQ on JBoss 4.2.2. It should work with other JMS providers and on other application servers, but you may have to do some tweaking. RESTEasy MOM is deployed as a WAR file. To configure you will have to modify its web.xml file.
ConnectionFactory setup
By default, RESTEasy MOM will try to lookup and use a ConnectionFactory stored under the JNDI name "java:/ConnectionFactory". You can configure it to look into another JNDI location by setting the context param:
resteasy.mom.connection.factory
Dead Letter Queue is requred!
When RESTEasy MOM cannot deliver a message it tries to send the message to a dead letter queue. It looks for this in JNDI, by default, under "queue/DLQ". You can configure this setting via
resteasy.mom.dlq.jndi
Default JBoss queue/topic destination Lookup
Every RESTEasy MOM URI path is prefaced with
/queues/{queue-name}
or
/topics/{topic-name}
By default, RESTEasy MOM will try and lookup destinations as follows:
Destination dest = (Destination)jndi.lookup("queue/" + {queue-name});
or
Destination dest = (Destination)jndi.lookup("topic/" + {topic-name});
If you are using JBoss MQ and you have not defined a specific JNDIName for your queue or topic, then this will just work, if not, read further.
Configured queue/topic JNDI locations
You can use the resteasy.mom.queues.jndi or resteasy.mom.topics.jndi web.xml context-params to specify a name/jndiName mapping of the form:
name ':' jndi-name
As many as these as you want separate by a ','. For example:
<context-param> <param-name>resteasy.mom.queues.jndi</param-name> <param-value> queueA : java:comp/env/jms/MyQueue, queueB : jboss/queues/B </param-value> </context-param>
Manual configuration
If you cannot obtain JMS ConnectionFactory or destinations from JNDI, then you must write your own RestasyMomBootstrap class. Download the RESTEasy MOM src and checkout the implementation of this class. Its pretty straightforward.
Comments