<web-app xmlns="http://caucho.com/ns/resin">
  <!--
     - Configures the JDBC-backed Queue.
    -->
  <resource var="queue" type="com.caucho.jms.jdbc.JdbcQueue">
    <init>
      <queue-name>resin</queue-name>
      <data-source>jdbc/resin</data-source>
    </init>
  </resource>

  <!--
     - Configures the JMS connectionAbstract factory
    -->
  <resource var="jmsFactory" type="com.caucho.jms.ConnectionFactoryImpl">
  </resource>

  <resource type="com.caucho.jms.resource.ListenerResource">
    <init>
      <connection-factory>${jmsFactory}</connection-factory>

      <destination>${queue}</destination>

      <listener type="example.MyListener"/>
    </init>
  </resource>

  <resource jndi-name="jms/sender"
        type="com.caucho.jms.resource.MessageSenderResource">
    <init>
      <connection-factory>${jmsFactory}</connection-factory>

      <destination>${queue}</destination>
    </init>
  </resource>

  <!--
     - The test servlet uses bean-style init to simplify the code.
     - Applications may want to use a standard init-param and
     - JNDI lookup in the init() method.
    -->
  <servlet servlet-name="send" servlet-class="example.MessageServlet">
    <init>
      <sender>${jndi:lookup("jms/sender")}</sender>
    </init>
  </servlet>

  <servlet-mapping url-pattern="/send" servlet-name="send"/>
</web-app>
