You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "Gosse, William" <wi...@eads.com> on 2008/09/19 14:58:09 UTC

servicemix spring joram configuration

If you are interested, I have something to submit about joram + spring +
servicemix configuration
(http://cwiki.apache.org/confluence/display/SM/JORAM))

Here is an example of jms consumer configuration with the new servicemix-jms
endpoints.

First, you have to add the following dependencies in the servicemix-jms su
pom (spring-remoting and joram-client):

<dependencies>
  <dependency>
    <groupId>org.apache.servicemix</groupId>
    <artifactId>servicemix-jms</artifactId>
    <version>${servicemix-version}</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-remoting</artifactId>
    <version>2.0.6</version>
  </dependency>
	<dependency>
    <groupId>org.objectweb.joram</groupId>
    <artifactId>joram-client</artifactId>
    <version>5.0.9</version>
	</dependency> 
</dependencies>

In the following example, we declare a jms:consumer endpoint reading in a
joram queue. The DefaultConsumerMarshaler is used.
Joram ConnectionFactory and Queue are retrieved via jndi using spring
<jee:jndi-lookup>

<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
       xmlns:amq="http://activemq.org/config/1.0"
       xmlns:jee="http://www.springframework.org/schema/jee"
       xmlns:ex="http://ex.sdea.net/esb"
       xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://servicemix.apache.org/jms/1.0
http://servicemix.apache.org/schema/servicemix-jms-3.2.2.xsd
       http://activemq.org/config/1.0
http://activemq.apache.org/schema/core/activemq-core-4.1.1.xsd
       http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">

	<bean id="marshaler"
class="org.apache.servicemix.jms.endpoints.DefaultConsumerMarshaler">
	   <property name="mep"
value="http://www.w3.org/2004/08/wsdl/in-only" />
	</bean>
	
	<jee:jndi-lookup id="connectionFactory" jndi-name="qcf">
		<jee:environment>
	
java.naming.factory.initial=fr.dyade.aaa.jndi2.client.NamingContextFactory
	      java.naming.provider.url=scn://localhost:16400
	    </jee:environment>
	</jee:jndi-lookup>
	  
	<jee:jndi-lookup id="queue" jndi-name="queue">
	    <jee:environment>
	
java.naming.factory.initial=fr.dyade.aaa.jndi2.client.NamingContextFactory
	      java.naming.provider.url=scn://localhost:16400
	    </jee:environment>
	</jee:jndi-lookup>
	  
	<jms:consumer service="ex:MyConsumerService"
		endpoint="jmsEndpoint"
		targetService="ex:helloComponent"
		destination="#queue"
		connectionFactory="#connectionFactory"
		marshaler="#marshaler" />

</beans>


William