...
- Download the hornetq-all-new.jar and copy it to the
<EI_HOME>/lib/
directory. - Replace the
geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
file in the<EI_HOME>/wso2/lib/endorsed/
directory withjavax.jms-api-2.0.1.jar
- Download HornetQ from http://hornetq.jboss.org/downloads and extract the tar.gz.
...
The XML configuration for this sample scenario is as follows:
Note |
---|
Make sure to configure the below properties as follows when setting up the inbound endpoint:
|
Code Block | ||
---|---|---|
| ||
<definitions xmlns="http://ws.apache.org/ns/synapse"> <registry provider="org.wso2.carbon.mediation.registry.WSO2Registry"> <parameter name="cachableDuration">15000</parameter> </registry> <taskManager provider="org.wso2.carbon.mediation.ntask.NTaskTaskManager"> <parameter name="cachableDuration">15000</parameter> </taskManager> <sequence name="request" onError="fault"> <log level="full"/> <drop/> </sequence> <sequence name="fault"> <log level="full"> <property name="MESSAGE" value="Executing default "fault" sequence"/> <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/> <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/> </log> <drop/> </sequence> <sequence name="main"> <log level="full"/> <drop/> </sequence> <inboundEndpoint name="jms_inbound" sequence="request" onError="fault" protocol="jms" suspend="false"> <parameters> <parameter name="interval">1000</parameter> <parameter name="transport.jms.Destination">/topic/exampleTopic</parameter> <parameter name="transport.jms.CacheLevel">3</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter> <parameter name="sequential">true</parameter> <parameter name="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</parameter> <parameter name="java.naming.provider.url">jnp://localhost:1099</parameter> <parameter name="transport.jms.SessionAcknowledgement">AUTO_ACKNOWLEDGE</parameter> <parameter name="transport.jms.SessionTransacted">false</parameter> <parameter name="transport.jms.ConnectionFactoryType">topic</parameter> <parameter name="transport.jms.JMSSpecVersion">2.0</parameter> <parameter name="transport.jms.SharedSubscription">true</parameter> <parameter name="transport.jms.DurableSubscriberName">mySubscription</parameter> </parameters> </inboundEndpoint> </definitions> |
...
You will see that 5 messages are shared between the inbound listener and TopicConsumer.java
. This is because both the WSO2 EI inbound listener, and TopicConsumer.java
are configured as shared subscribers.
...