Resin JMS Configuration
Resin 3.1

Documentation
Examples
Changes

Overview
Installation
Configuration
Quercus
SOA/IoC
JSP
Servlets and Filters
Admin (JMX)
EJB
Amber
Security
Performance
Hessian
XML and XSLT
Third-party
Troubleshooting/FAQ

JAXB Annotations
IoC Annotations
JAX-WS Annotations
JMS Configuration
init
bean
CronResource
RMI
Resource FAQ
JAX-WS Annotations
SOA/IoC
init

Configuration for Resin's JMS provider implementation. The JDBC Queues and Topics provide a persistent messaging store. The Memory Queues and Topics provide a low-overhead memory-based store.

ConnectionFactory

The ConnectionFactory resource defines the JMS factory for creating JMS connections.

ConnectionFactory resource
<resource jndi-name="jms/factory"
          type="com.caucho.jms.ConnectionFactoryImpl"/>

If an application creates a named queue or topic using the the JMS Session, Resin's default behaviour is to create a memory queue or topic. The jdbc-manager configuration of the connection factory causes creation of a jdbc queue or topic instead.

ConnectionFactory resource
<resource jndi-name="jms/factory"
           type="com.caucho.jms.ConnectionFactoryImpl"/>
  <init>
    <jdbc-manager>
      <data-source>jdbc/database</data-source>
    </jdbc-manager>
  </init>
</resource>
client-idclientID value for durable subscriptionspseudo-random generated value
jdbc-managerUse jdbc queues and topics for queues and topics created using the JMS Session object, see jdbc-manageruse a memory queue for created queues and topics

JDBC Queue/Topic

The JDBC Queue and Topic store the messages using a JDBC DataSource. The data source is defined in a <database> element. Resin's internal file-based database can be used for single-JVM messaging. A central database is used for clusters and situations where more than one is a producer or consumer.

JdbcQueue configuration

Queue configuration with Resin's database
<database jndi-name="jdbc/resin">
  <driver type="com.caucho.db.jdbc.ConnectionPoolDataSourceImpl">
     <path>WEB-INF/db</path>
  </driver>
</database>

<resource jndi-name="jms/my-queue"
          type="com.caucho.jms.jdbc.JdbcQueue">
  <init>
    <queue-name>my-queue</queue-name>
    <jdbc-manager>
      <data-source>jdbc/resin</data-source>
    </jdbc-manager>
  </init>
</resource>
queue-nameName of the queuerequired
jdbc-managerConfiguration of database usage, see jdbc-managerrequired

JdbcTopic configuration

Topic configuration with MySQL database
<database>
  <jndi-name>jdbc/jms</jndi-name>
  <driver>
    <type>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</type>
    <url>jdbc:mysql://localhost:3306/jms</url>
    <user>username</user>
    <password>password</password>
  </driver>
  ...
</database>

<resource jndi-name="jms/my-topic"
          type="com.caucho.jms.jdbc.JdbcTopic">
  <init>
    <topic-name>my-topic</topic-name>
    <jdbc-manager>
      <data-source>jdbc/jms</data-source>
    </jdbc-manager>
  </init>
</resource>
topic-nameName of the topicrequired
jdbc-managerConfiguration of database usage, see jdbc-managerrequired

jdbc-manager

consumer-tableName of the table to use for storing consumersresin_jms_consumer
data-sourceJDBC DataSourcerequired
destination-tableName of the table to use for storing destinationsresin_jms_destination
message-tableName of the table to use for storing messagesresin_jms_message
purge-intervalFrequency for purging of expired messages60s
poll-intervalPolling interval when there is a message listenerno polling
tablespaceTablespace for Oracle blobs onlynone

Memory Queue/Topic

The Memory Queue and Topic are non-persistent. If the server restarts or even if the Queue's environment restarts, the messaging data will be lost. Applications needing persistent messaging should use the JDBC Queues.

Memory Queue configuration
<resource jndi-name="jms/factory"
           type="com.caucho.jms.ConnectionFactoryImpl"/>

<resource jndi-name="jms/my-queue"
           type="com.caucho.jms.memory.MemoryQueue">
  <init>
    <queue-name>my-queue</queue-name>
  </init>
</resource>
Memory Topic configuration
<resource jndi-name="jms/factory"
           type="com.caucho.jms.ConnectionFactoryImpl"/>

<resource jndi-name="jms/my-topic"
           type="com.caucho.jms.memory.MemoryTopic">
  <init>
    <topic-name>my-topic</topic-name>
  </init>
</resource>

JAX-WS Annotations
SOA/IoC
init
Copyright © 1998-2006 Caucho Technology, Inc. All rights reserved.
Resin ® is a registered trademark, and Quercustm, Ambertm, and Hessiantm are trademarks of Caucho Technology.