SeamFramework.orgCommunity Documentation
Seam JMS can be used by including a few libraries in your application's library folder:
seam-jms-api.jar
seam-jms.jar
solder-api.jar
solder-impl.jar
solder-logging.jar
If you are using Maven as your build tool use the following dependency, which will bring in both API and Implementation for Seam JMS:
<dependency>
<groupId>org.jboss.seam.jms</groupId>
<artifactId>seam-jms</artifactId>
<version>${seam.jms.version}</version>
</dependency>
Define or replace the property ${seam.jms.version} with a valid version of Seam JMS.
The runtime of Seam JMS is defined in two sections. The first section is related to creating observers, which happens within the Seam JMS CDI Extension. Observers need to be defined prior to starting up the container, and cannot be created once the application is running. This part happens automatically. The second section is related to creating listeners. This is managed in the component org.jboss.seam.jms.bridge.RouteBuilder.
In order to start any listeners, you may need to inject an instance of the RouteBuilder in to your class.
If you are running within a Servlet Container, and include the Solder, RouteBuilder will automatically start up.
The default implementation expects to find a ConnectionFactory at the JNDI location /ConnectionFactory
. This
can be changed by using Solder Config by using a snippet similar to the one below in seam-beans.xml. This will
change the JNDI location Seam JMS looks to jms/ConnectionFactory
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:java:ee"
xmlns:jmsi="urn:java:org.jboss.seam.jms.inject"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://docs.jboss.org/cdi/beans_1_0.xsd">
<jmsi:JmsConnectionFactoryProducer>
<s:modifies />
<jmsi:connectionFactoryJNDILocation>jms/ConnectionFactory</jmsi:connectionFactoryJNDILocation>
</jmsi:JmsConnectionFactoryProducer>
</beans>