Commit in servicemix/tooling/servicemix-web/src/webapp/WEB-INF on MAIN
activemq.xml+69added 1.1
applicationContext.xml+97-51.1 -> 1.2
+166-5
1 added + 1 modified, total 2 files
added an example to the WAR so you can monitor the stats through the console easily

servicemix/tooling/servicemix-web/src/webapp/WEB-INF
activemq.xml added at 1.1
diff -N activemq.xml
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ activemq.xml	14 Sep 2005 18:22:31 -0000	1.1
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC  "-//ACTIVEMQ//DTD//EN" "http://activemq.org/dtd/activemq.dtd">
+<beans>
+  
+  <!-- ==================================================================== -->
+  <!-- ActiveMQ Broker Configuration -->
+  <!-- ==================================================================== -->
+  <broker>
+    <connector>
+      <tcpServerTransport uri="tcp://localhost:61616" backlog="1000" useAsyncSend="true" maxOutstandingMessages="50"/>
+    </connector>
+
+    <persistence>
+      <cachePersistence>
+        <journalPersistence directory="../var/journal">
+          <jdbcPersistence dataSourceRef="derby-ds"/>
+        </journalPersistence>
+      </cachePersistence>
+    </persistence>
+  </broker>
+
+  <!-- ==================================================================== -->
+  <!-- JDBC DataSource Configurations -->
+  <!-- ==================================================================== -->
+
+  <!-- The Derby Datasource that will be used by the Broker -->
+  <bean id="derby-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
+    <property name="driverClassName">
+      <value>org.apache.derby.jdbc.EmbeddedDriver</value>
+    </property>
+    <property name="url">
+      <!-- Use a URL like 'jdbc:hsqldb:hsql://localhost:9001' if you want to connect to a remote hsqldb -->
+      <value>jdbc:derby:derbydb;create=true</value>
+    </property>
+    <property name="username">
+      <value></value>
+    </property>
+    <property name="password">
+      <value></value>
+    </property>
+    <property name="poolPreparedStatements">
+      <value>true</value>
+    </property>
+  </bean>
+
+  <!-- The MYSQL Datasource that will be used by the Broker -->
+  <bean id="mysql-ds"
+    class="org.apache.commons.dbcp.BasicDataSource"
+    destroy-method="close">
+    <property name="driverClassName">
+      <value>com.mysql.jdbc.Driver</value>
+    </property>
+    <property name="url">
+      <value>jdbc:mysql://localhost/activemq</value>
+    </property>
+    <property name="username">
+      <value>myname</value>
+    </property>
+    <property name="password">
+      <value>mypassword</value>
+    </property>
+    <property name="poolPreparedStatements">
+      <value>true</value>
+    </property>
+  </bean>
+
+
+</beans>
+

servicemix/tooling/servicemix-web/src/webapp/WEB-INF
applicationContext.xml 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- applicationContext.xml	12 Sep 2005 17:45:45 -0000	1.1
+++ applicationContext.xml	14 Sep 2005 18:22:31 -0000	1.2
@@ -6,20 +6,112 @@
    <property name="rootDir" value="../wdir"/>
    <property name="useMBeanServer" value="true"/>
    <property name="createMBeanServer" value="true"/>
-   <property name="installationDirPath" value="install"/>
-   <property name="deploymentDirPath" value="deploy"/>
+   <property name="installationDirPath" value="../install"/>
    <property name="monitorInstallationDirectory" value="true"/>
    <property name="dumpStats" value="true"/>
    <property name="statsInterval" value="10"/>
-   <property name="flowName" value = "seda"/>
-   <property name="transactionManager" ref="transactionManager"/>
+    <property name="transactionManager" ref="transactionManager"/>
 
     <components>
+
+      <!-- lets kick off a timer to send messages on an input destination topic -->
+      <component id="timer" service="my:timer" class="org.servicemix.components.quartz.QuartzComponent" destinationService="my:inputSender">
+        <property name="triggers">
+          <map>
+            <entry>
+              <key>
+                <bean class="org.quartz.SimpleTrigger">
+                  <property name="repeatInterval" value="5000"/>
+                  <property name="repeatCount" value="-1"/>
+                </bean>
+              </key>
+                <bean class="org.quartz.JobDetail">
+                  <property name="name" value="My Example Job"/>
+                  <property name="group" value="ServiceMix"/>
+                </bean>
+            </entry>
+          </map>
+        </property>
+      </component>
+      <component id="inputSender" service="my:inputSender" class="org.servicemix.components.jms.JmsSenderComponent">
+        <property name="template">
+          <bean class="org.springframework.jms.core.JmsTemplate">
+            <property name="connectionFactory">
+              <ref local="jmsFactory"/>
+            </property>
+            <property name="defaultDestinationName" value="demo.org.servicemix.source"/>
+            <property name="pubSubDomain" value="true"/>
+          </bean>
+        </property>
+      </component>
+
+
+      <!-- lets subscribe and republish on a different JMS destination - i.e. make a JMS bridge -->
+      <component id="inputReceiver" service="my:inputReceiver" class="org.servicemix.components.jms.JmsInUsingJCABinding" destinationService="my:outputSender">
+        <property name="jcaContainer" ref="jencks"/>
+        <property name="activationSpec">
+          <bean class="org.activemq.ra.ActiveMQActivationSpec">
+            <property name="destination" value="demo.org.servicemix.source"/>
+            <property name="destinationType" value="javax.jms.Topic"/>
+          </bean>
+        </property>
+      </component>
+
+
+      <component id="outputSender" service="my:outputSender" class="org.servicemix.components.jms.JmsSenderComponent">
+        <property name="template">
+          <bean class="org.springframework.jms.core.JmsTemplate">
+            <property name="connectionFactory">
+              <ref local="jmsFactory"/>
+            </property>
+            <property name="defaultDestinationName" value="demo.org.servicemix.result"/>
+            <property name="pubSubDomain" value="true"/>
+          </bean>
+        </property>
+      </component>
+
+
+      <!-- just to demonstrate that we are sending messages, lets trace the messages we receive -->
+      <component id="jmsTrace" service="my:jmsTrace" class="org.servicemix.components.jms.JmsInUsingJCABinding" destinationService="my:trace">
+        <property name="jcaContainer" ref="jencks"/>
+        <property name="activationSpec">
+          <bean class="org.activemq.ra.ActiveMQActivationSpec">
+            <property name="destination" value="demo.org.servicemix.result"/>
+            <property name="destinationType" value="javax.jms.Topic"/>
+          </bean>
+        </property>
+      </component>
+
+      <component id="trace" service="my:trace" class="org.servicemix.components.util.TraceComponent"/>
     </components>
   </container>
 
+
+  <!-- the JCA container -->
+  <bean id="jencks" class="org.jencks.JCAContainer" singleton="true">
+
+    <!-- lets use the default configuration of work manager and transaction manager-->
+    <property name="bootstrapContext">
+      <bean class="org.jencks.factory.BootstrapContextFactoryBean">
+        <property name="threadPoolSize" value="25"/>
+      </bean>
+    </property>
+
+    <!-- the JCA Resource Adapter -->
+    <property name="resourceAdapter">
+      <bean id="activeMQResourceAdapter" class="org.activemq.ra.ActiveMQResourceAdapter" singleton="true">
+        <property name="serverUrl" value="tcp://localhost:61616"/>
+      </bean>
+    </property>
+  </bean>
+
+  <!-- message broker -->
+  <bean id="broker" class="org.activemq.spring.BrokerFactoryBean">
+     <property name="config" value="/WEB-INF/activemq.xml"/>
+   </bean>
+
   <bean id="transactionManager" class="org.jencks.factory.TransactionManagerFactoryBean"/>
- 
+
   <bean id="jmsFactory" class="org.activemq.pool.PooledConnectionFactory">
     <property name="connectionFactory">
       <bean class="org.activemq.ActiveMQConnectionFactory">
CVSspam 0.2.8



Reply via email to