Testing WebsphereMQ 8.0 (Windows server 2012) together with WSO2 ESB 4.8.1 message stores and message processors - Full Synapse Configuration
For configuaring IBM WebsphreMQ with WSO2 ESB please click on this link :
WSO2 ESB Full Synapse Configuration
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
<parameter name="cachableDuration">15000</parameter>
</registry>
<proxy name="MySample2"
transports="https http"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property name="FORCE_SC_ACCEPTED"
value="true"
scope="axis2"
type="STRING"/>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
<store messageStore="JMSStore2"/>
</inSequence>
</target>
</proxy>
<proxy name="MySample"
transports="https http"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property name="FORCE_SC_ACCEPTED"
value="true"
scope="axis2"
type="STRING"/>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
<store messageStore="JMSStore1"/>
</inSequence>
</target>
</proxy>
<proxy name="MyMockProxy"
transports="https http"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<log level="custom">
<property name="it" value="** Its Inline Sequence of MockProxy"/>
</log>
<payloadFactory media-type="xml">
<format>
<Response xmlns="">
<status>OK</status>
<code>1</code>
</Response>
</format>
<args/>
</payloadFactory>
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<property name="messageType" value="application/xml" scope="axis2"/>
<send/>
</inSequence>
</target>
</proxy>
<endpoint name="MyMockProxy">
<address uri="http://192.168.48.140:8280/services/MyMockProxy"/>
</endpoint>
<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">
<in>
<log level="full"/>
<filter source="get-property('To')" regex="http://localhost:9000.*">
<send/>
</filter>
</in>
<out>
<send/>
</out>
<description>The main sequence for the message mediation</description>
</sequence>
<messageStore class="org.apache.synapse.message.store.impl.jms.JmsStore"
name="JMSStore1">
<parameter name="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory</parameter>
<parameter name="store.jms.password">wso2321#qa</parameter>
<parameter name="java.naming.provider.url">file:\C:\Users\Administrator\Desktop\jndidirectory</parameter>
<parameter name="store.jms.connection.factory">MyQueueConnectionFactory</parameter>
<parameter name="store.jms.username">Administrator</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
<parameter name="store.jms.destination">LocalQueue1</parameter>
</messageStore>
<messageStore class="org.apache.synapse.message.store.impl.jms.JmsStore"
name="JMSStore2">
<parameter name="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory</parameter>
<parameter name="store.jms.password">wso2321#qa</parameter>
<parameter name="java.naming.provider.url">file:\C:\Users\Administrator\Desktop\jndidirectory</parameter>
<parameter name="store.jms.connection.factory">MyQueueConnectionFactory5</parameter>
<parameter name="store.jms.username">Administrator</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
<parameter name="store.jms.destination">LocalQueue5</parameter>
</messageStore>
<messageProcessor class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor"
name="JMSMessagePro2"
targetEndpoint="MyMockProxy"
messageStore="JMSStore2">
<parameter name="client.retry.interval">1000</parameter>
<parameter name="max.delivery.attempts">5</parameter>
<parameter name="interval">10000</parameter>
<parameter name="is.active">true</parameter>
</messageProcessor>
<messageProcessor class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor"
name="JMSMessagePro"
targetEndpoint="MyMockProxy"
messageStore="JMSStore1">
<parameter name="max.delivery.attempts">2</parameter>
<parameter name="client.retry.interval">1000</parameter>
<parameter name="interval">10000</parameter>
<parameter name="is.active">true</parameter>
</messageProcessor>
</definitions>
Important Points :
[1] Identify the message flow ...
SoapRequest --> MySampleProxy --> MessageStore -->MessageQueue --> MessageProcessor
(SoapUI) (ESB) (ESB) (WebsphereMQ) (ESB)
|
MyMockProxy <--|
(ESB)
[2] Remember to set additional MS / MP settings depending on your requirement.
eg: Maximum delivery attempts , Retry period etc.
No comments:
Post a Comment