Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • configure JORAM jms provider instead of activeMQ in the web app WEB-INF/applicationContext.xml
    Code Block
    <bean id="jmsFactory"
    	class="org.objectweb.joram.client.jms.local.LocalConnectionFactory">
    </bean>
    
  • remove references to activeMQ in the web app WEB-INF/
    Code Block
    <context-param>
    	<param-name>contextConfigLocation</param-name>
    	<param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    
    instead of
    Code Block
    <context-param>
    	<param-name>contextConfigLocation</param-name>
    	<param-value>/WEB-INF/applicationContext.xml WEB-INF/activeMQ.xml</param-value>
    </context-param>
    
    * remove
  •  remove references to activeMQ in the web app WEB-INF/applicationCOntextapplicationContext.xml

You can take the following code these files :
 

applicationContext.xml

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xbean.org/schemas/spring/1.0"
	xmlns:sm="http://servicemix.apache.org/config/1.0"
	xmlns:my="http://servicemix.apache.org/demo/"
	xmlns:foo="http://servicemix.apache.org/demo/">

	<!-- the JBI container -->
	<sm:container id="jbi" rootDir="<at:var at:name="rootDir" />"
		useMBeanServer="true" createMBeanServer="true"
		installationDirPath="<at:var at:name="installationDirPath" />"
		deploymentDirPath="<at:var at:name="deploymentDirPath" />"
		monitorInstallationDirectory="true" dumpStats="true"
		statsInterval="10" transactionManager="#transactionManager">

	</sm:container>

	<bean id="transactionManager"
		class="org.jencks.factory.TransactionManagerFactoryBean" />


	<bean id="jmsFactory"
		class="org.objectweb.joram.client.jms.local.LocalConnectionFactory">
	</bean>

</beans>

web.xml

Code Block
 <<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

  <display-name>ServiceMix Web Application</display-name>
  <description>Deploys ServiceMix inside a Web Application</description>

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
  </context-param>
  <context-param>
    <param-name>contextClass</param-name>
    <param-value>org.apache.xbean.spring.context.XmlWebApplicationContext</param-value>
  </context-param>

  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

  <!-- servlet mappings -->

  <!-- the main JMX servlet -->
  <servlet>
    <servlet-name>JMXServlet</servlet-name>
    <servlet-class>org.apache.servicemix.web.jmx.JMXServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>


  <servlet-mapping>
    <servlet-name>JMXServlet</servlet-name>
    <url-pattern>/jmx/*</url-pattern>
  </servlet-mapping>

</web-app>

...

The client sends a SOAP message with an attachment over http to servicemix-http
which post it to the NMR. Then the message is forwarded to the drools component. If the SOAP body of the sent message contains the keyword 'keep', then the message is posted to the NMR without any modification. Else, the attachment is remove from the message. Then the message is routed to the servicemix-jms component which transforms it into a JMS Message sent to the ServiceMixOnJOnASExample1Queue queue. The client (which was waiting on this queue) received the message.

Here is a schema of the flow :

         SOAP/HTTP                          NMR                 NMR                                     JMS
Client ------> servicemix-http -----> drools -----> servicemix-jms ------> Client

you can download an archive containing all the example ; ServiceMixOnJOnASExample1

Limitations

ServiceMix clustering is using ActiveMQ classes so this functionnality is not supported in JOnAS which is using JORAM.

...