Sorry, I guess I should have posted this. It is obtained from doccos on the
website. I previously had a problem with parsing this XML file, so disabled
the validation (based on similar solutions in this forum).

Apologies if this is some sort ofapplication classr. just the package
structure made me think that maybe it is part of the framework?



<?xml version="1.0" encoding="UTF-8"?>

<!-- START SNIPPET: spring -->
<beans 
  xmlns="http://www.springframework.org/schema/beans"; 
  xmlns:amq="http://activemq.org/config/1.0";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd 
  http://activemq.org/config/1.0
http://people.apache.org/repository/org.apache.activemq/xsds/activemq-core-4.1-incubator-SNAPSHOT.xsd";>
  
  <!--  lets create an embedded ActiveMQ Broker -->
  <amq:broker useJmx="false" persistent="false">
    <amq:transportConnectors>
      <amq:transportConnector uri="tcp://localhost:0" />
    </amq:transportConnectors>
  </amq:broker>

   <!--  ActiveMQ destinations to use  -->
  <amq:queue id="destination" 
physicalName="org.apache.activemq.spring.Test.spring.embedded"/>

  <!-- JMS ConnectionFactory to use, configuring the embedded broker using
XML -->
  <amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost"/>
  

  <!-- Spring JMS Template -->
  <bean id="myJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory">
      <!-- lets wrap in a pool to avoid creating a connection per send -->

      <bean
class="org.springframework.jms.connection.SingleConnectionFactory">
        <property name="targetConnectionFactory">
          <ref local="jmsFactory" />
        </property>
      </bean>
    </property>
  </bean>

  <bean id="consumerJmsTemplate"
class="org.springframework.jms.core.JmsTemplate">

    <property name="connectionFactory" ref="jmsFactory"/>
  </bean>

  <!-- a sample POJO which uses a Spring JmsTemplate -->
  <bean id="producer" class="org.apache.activemq.spring.SpringProducer">
    <property name="template">
      <ref bean="myJmsTemplate"></ref>
    </property>

    <property name="destination">

      <ref bean="destination" />
    </property>

    <property name="messageCount">
      <value>10</value>
    </property>
  </bean>

  <!-- a sample POJO consumer -->

  <bean id="consumer" class="org.apache.activemq.spring.SpringConsumer">
    <property name="template" ref="consumerJmsTemplate"/>
    <property name="destination" ref="destination"/>
  </bean>

</beans>

<!-- END SNIPPET: spring -->
-- 
View this message in context: 
http://www.nabble.com/org.apache.activemq.spring.SpringProducer-Jar-tf3026581.html#a8408449
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to