Author: hiranya
Date: Mon Aug 4 19:58:41 2008
New Revision: 682568
URL: http://svn.apache.org/viewvc?rev=682568&view=rev
Log:
Added a new sample to the documentation (sample 260). Sample demonstrates
switching from FIX to AMQP. Updated the samples guide and samples setup guide
as necessary. Added two new resource files under the samples. (con.properties
and direct.properties)
Also added a new AMQPConsumer class under the userguide.
This sample is related to SYNAPSE-405 and the patch was provided by Asanka A.
Added:
synapse/trunk/java/modules/samples/src/main/java/samples/userguide/AMQPConsumer.java
synapse/trunk/java/repository/conf/sample/resources/fix/
synapse/trunk/java/repository/conf/sample/resources/fix/con.properties
synapse/trunk/java/repository/conf/sample/resources/fix/direct.properties
synapse/trunk/java/repository/conf/sample/synapse_sample_260.xml
Modified:
synapse/trunk/java/modules/samples/src/main/scripts/build.xml
synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
synapse/trunk/java/src/site/xdoc/Synapse_Samples_Setup.xml
Added:
synapse/trunk/java/modules/samples/src/main/java/samples/userguide/AMQPConsumer.java
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/samples/src/main/java/samples/userguide/AMQPConsumer.java?rev=682568&view=auto
==============================================================================
---
synapse/trunk/java/modules/samples/src/main/java/samples/userguide/AMQPConsumer.java
(added)
+++
synapse/trunk/java/modules/samples/src/main/java/samples/userguide/AMQPConsumer.java
Mon Aug 4 19:58:41 2008
@@ -0,0 +1,267 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package samples.userguide;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
+
+import javax.jms.*;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.FileInputStream;
+import java.io.File;
+import java.util.Iterator;
+import java.util.Properties;
+
+public class AMQPConsumer {
+ private MessageProducer replyProducer;
+ private Connection connection;
+ private MessageConsumer messageConsumer;
+ private Session session;
+ private String inSymbol;
+ private String inQty;
+ private String inClOrderID;
+ private int execID = 1;
+ private String fileName;
+
+ private static final String CLASS = "AMQPConsumer";
+ private static final String PROPERTY_FILE =
"../../repository/conf/sample/resources/fix/direct.properties";
+ private static final String PROP_FILE_NAME = "propfile";
+ private static final String LOOKUP_CODE_CON = "directQueue";
+ private static final String LOOKUP_CODE_REP = "replyQueue";
+ private static final String CONNECTION_FACTORY = "qpidConnectionfactory";
+ private static final String FIX_MSG = "message";
+ private static final String FIX_MSG_BODY = "body";
+ private static final String FIX_MSG_ID = "id";
+ private static final String FIX_MSG_SYMBOL = "55";
+ private static final String FIX_MSG_CLORDID = "11";
+ private static final String FIX_MSG_ORDQTY = "38";
+
+ /**
+ * Main method to execute the consumer sample.
+ *
+ * @param args
+ */
+ public static void main(String[] args) {
+ AMQPConsumer syncConsumer = new AMQPConsumer();
+ syncConsumer.runTest();
+ }
+
+ /**
+ * Start the sample by creating and listerning to a defined Queue
+ */
+ private void runTest() {
+ try {
+ fileName = getProperty(PROP_FILE_NAME, PROPERTY_FILE);
+ // Load JNDI properties from the configuration file
+ Properties properties = new Properties();
+ InputStream inStream = new FileInputStream(new
File(fileName).getAbsolutePath());
+ properties.load(inStream);
+ //Create the initial context
+ Context ctx = new InitialContext(properties);
+ // look up destination
+ Destination destination = (Destination)
ctx.lookup(LOOKUP_CODE_CON); // Listerning queue
+ Destination replyQueue = (Destination)
ctx.lookup(LOOKUP_CODE_REP); // Reply queue
+ // Lookup the connection factory
+ ConnectionFactory conFac = (ConnectionFactory)
ctx.lookup(CONNECTION_FACTORY);
+ connection = conFac.createConnection();
+ // As this application is using a MessageConsumer we need to set
an ExceptionListener on the connection
+ // so that errors raised within the JMS client library can be
reported to the application
+ System.out.println(
+ CLASS + ": Setting an ExceptionListener on the connection
as sample uses a MessageConsumer");
+ connection.setExceptionListener(new ExceptionListener() {
+ public void onException(JMSException jmse) {
+ // The connection may have broken invoke reconnect code if
available.
+ // The connection may have broken invoke reconnect code if
available.
+ System.err.println(CLASS + ": The sample received an
exception through the ExceptionListener" + jmse.getMessage());
+ jmse.printStackTrace();
+ System.exit(0);
+ }
+ });
+ createSession(conFac,destination); // Call to create the sessions
+ createRepQueue(conFac,replyQueue); // Call to create the Reply
Queue and close the session
+ connection.start(); // Start the connection
+ System.out.println(CLASS + ": Starting connection so the
MessageConsumer can receive messages");
+ onMessage();
+ } catch (Exception e) {
+ //TODO: handle the exception
+ System.out.println("ERROR : "+ e.toString());
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @param destination
+ */
+ private void createSession(ConnectionFactory conFac,Destination
destination) throws JMSException {
+ // Create a session on the connection
+ // This session is a default choice of non-transacted and uses the
auto acknowledge feature of a session.
+ System.out.println(CLASS + ": Creating a non-transacted,
auto-acknowledged session");
+ session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ // Create a MessageConsumer
+ System.out.println(CLASS + ": Creating a MessageConsumer");
+ messageConsumer = session.createConsumer(destination);
+ }
+
+ /**
+ * Create reply queue
+ * @param replyQueue
+ * @throws JMSException
+ */
+ private void createRepQueue(ConnectionFactory conFac,Destination
replyQueue) throws JMSException {
+ MessageProducer messageProducer = session.createProducer(replyQueue);
+ System.out.println(CLASS + ": Reply queue created");
+ }
+
+ /**
+ * Not a typical message callback, this method will listern and pole the
messages
+ */
+ private void onMessage() throws JMSException, XMLStreamException {
+ Message message;
+ boolean end = false;
+ while (!end) {
+ message = messageConsumer.receive();
+ String text;
+ if (message instanceof TextMessage) {
+ text = ((TextMessage) message).getText();
+ } else {
+ byte[] body = new byte[(int) ((BytesMessage)
message).getBodyLength()];
+ ((BytesMessage) message).readBytes(body);
+ text = new String(body);
+ }
+ System.out.println(CLASS + ": Received message: " + text);
+ if (message.getJMSReplyTo() != null) {
+ // Send the Execution back to the sendar
+ parseOrder(text);
+ sendExecution(message);
+ }
+ }
+
+ }
+
+ /**
+ * @param payload XML message content came inside the JMS message
+ * @throws XMLStreamException
+ */
+ private void parseOrder(String payload) throws XMLStreamException {
+ InputStream is = new ByteArrayInputStream(payload.getBytes());
+ javax.xml.stream.XMLStreamReader parser = XMLInputFactory
+ .newInstance().createXMLStreamReader(is);
+ StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser,
+ null);
+ SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
+ // retrieve SOAP body
+ SOAPBody soapBody = envelope.getBody();
+ OMElement messageNode = soapBody.getFirstChildWithName(new QName(
+ FIX_MSG));
+ Iterator<OMElement> messageElements = messageNode
+ .getChildElements();
+ while (messageElements.hasNext()) {
+ OMElement node = messageElements.next();
+ if (node.getQName().getLocalPart().equals(FIX_MSG_BODY)) {
+ Iterator<OMElement> bodyElements = node.getChildElements();
+ while (bodyElements.hasNext()) {
+ OMElement bodyNode = bodyElements.next();
+ String tag = bodyNode
+ .getAttributeValue(new QName(FIX_MSG_ID));
+ String value = bodyNode.getText();
+ if (tag.equals(FIX_MSG_SYMBOL)) {
+ inSymbol = value;
+ } else if (tag.equals(FIX_MSG_CLORDID)) {
+ inClOrderID = value;
+ } else if (tag.equals(FIX_MSG_ORDQTY)) {
+ inQty = value;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ * @param message incoming message
+ * @throws JMSException
+ */
+ private void sendExecution(Message message) throws JMSException {
+ String repValue = "<m0:message
xmlns:m0=\"http://services.samples/xsd/\" inSeession=\"FIX.4.0:EXEC-->SYNAPSE\"
count=\"2\">\n"
+ + "<m0:header>"
+ + "<m0:field m0:id=\"35\"><![CDATA[8]]></m0:field>"
+ + "<m0:field
m0:id=\"52\"><![CDATA[20080618-08:41:56]]></m0:field>"
+ + "</m0:header>"
+ + "<m0:body>"
+ + "<m0:field m0:id=\"6\"><![CDATA[12.3]]></m0:field>"
+ + "<m0:field m0:id=\"11\"><![CDATA["
+ + inClOrderID
+ + "]]></m0:field>"
+ + "<m0:field m0:id=\"14\"><![CDATA["
+ + inQty
+ + "]]></m0:field>"
+ + "<m0:field m0:id=\"17\"><![CDATA["
+ + execID
+ + "]]></m0:field>"
+ + "<m0:field m0:id=\"20\"><![CDATA[0]]></m0:field>"
+ + "<m0:field m0:id=\"31\"><![CDATA[12.3]]></m0:field>"
+ + "<m0:field m0:id=\"32\"><![CDATA["
+ + inQty
+ + "]]></m0:field>"
+ + "<m0:field m0:id=\"37\"><![CDATA[2]]></m0:field>"
+ + "<m0:field m0:id=\"38\"><![CDATA["
+ + inQty
+ + "]]></m0:field>"
+ + "<m0:field m0:id=\"39\"><![CDATA[2]]></m0:field>"
+ + "<m0:field m0:id=\"54\"><![CDATA[1]]></m0:field>"
+ + "<m0:field m0:id=\"55\"><![CDATA["
+ + inSymbol
+ + "]]></m0:field>"
+ + "<m0:field m0:id=\"150\"><![CDATA[2]]></m0:field>"
+ + "<m0:field m0:id=\"151\"><![CDATA[0]]></m0:field>"
+ + "</m0:body>"
+ + "<m0:trailer>"
+ + "</m0:trailer>"
+ + "</m0:message>";
+ execID++;
+ TextMessage repMessage = session.createTextMessage(repValue);
+ repMessage.setJMSCorrelationID(message.getJMSMessageID());
+ replyProducer = session.createProducer(message.getJMSReplyTo());
+ replyProducer.send(repMessage);
+ System.out.println("Execution sent: " + repMessage.getText());
+ }
+
+ /**
+ * Get the system properties
+ * @param name property name
+ * @param def default value
+ * @return property value
+ */
+ private static String getProperty(String name, String def) {
+ String result = System.getProperty(name);
+ if (result == null || result.length() == 0) {
+ result = def;
+ }
+ return result;
+ }
+}
+
Modified: synapse/trunk/java/modules/samples/src/main/scripts/build.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/samples/src/main/scripts/build.xml?rev=682568&r1=682567&r2=682568&view=diff
==============================================================================
--- synapse/trunk/java/modules/samples/src/main/scripts/build.xml (original)
+++ synapse/trunk/java/modules/samples/src/main/scripts/build.xml Mon Aug 4
19:58:41 2008
@@ -67,6 +67,13 @@
example:
ant fixclient -Dsymbol=IBM -Dqty=5 -Dmode=buy
-Daddurl=http://localhost:8280/services/FIXProxy
+
+ ant amqpconsumer
+ A JMS based amqp consumer that accept orders and generates executions.
+ [-Dpropfile=/etc/direct.properties]
+
+ example:
+ ant amqpconsumer
</echo>
</target>
@@ -90,6 +97,7 @@
<property name="opt_file" value=""/>
<property name="class.dir" value="target/classes"/>
<property name="qty" value=""/>
+ <property name="propfile" value=""/>
<target name="clean">
<delete dir="target" quiet="true"/>
@@ -133,6 +141,13 @@
</java>
</target>
+ <target name="amqpconsumer" depends="compile">
+ <java classname="samples.userguide.AMQPConsumer"
+ classpathref="javac.classpath" fork="true">
+ <sysproperty key="propfile" value="${propfile}"/>
+ </java>
+ </target>
+
<target name="jmsclient" depends="compile">
<java classname="samples.userguide.GenericJMSClient"
classpathref="javac.classpath" fork="true">
Added: synapse/trunk/java/repository/conf/sample/resources/fix/con.properties
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/resources/fix/con.properties?rev=682568&view=auto
==============================================================================
--- synapse/trunk/java/repository/conf/sample/resources/fix/con.properties
(added)
+++ synapse/trunk/java/repository/conf/sample/resources/fix/con.properties Mon
Aug 4 19:58:41 2008
@@ -0,0 +1,12 @@
+#initial context factory
+
+#java.naming.factory.initial
=org.apache.qpid.jndi.PropertiesFileInitialContextFactory
+
+# register some connection factories
+# connectionfactory.[jndiname] = [ConnectionURL]
+connectionfactory.qpidConnectionfactory=amqp://guest:[EMAIL
PROTECTED]/test?brokerlist='tcp://localhost:5672'
+
+# Register an AMQP destination in JNDI
+# destination.[jndiName] = [BindingURL]
+destination.directQueue=direct://amq.direct//QpidStockQuoteService
+
Added: synapse/trunk/java/repository/conf/sample/resources/fix/direct.properties
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/resources/fix/direct.properties?rev=682568&view=auto
==============================================================================
--- synapse/trunk/java/repository/conf/sample/resources/fix/direct.properties
(added)
+++ synapse/trunk/java/repository/conf/sample/resources/fix/direct.properties
Mon Aug 4 19:58:41 2008
@@ -0,0 +1,11 @@
+java.naming.factory.initial =
org.apache.qpid.jndi.PropertiesFileInitialContextFactory
+
+# register some connection factories
+# connectionfactory.[jndiname] = [ConnectionURL]
+connectionfactory.qpidConnectionfactory = amqp://guest:[EMAIL
PROTECTED]/test?brokerlist='tcp://localhost:5672'
+
+# Register an AMQP destination in JNDI
+# destination.[jniName] = [BindingURL]
+destination.directQueue =
direct://amq.direct//QpidStockQuoteService?routingkey='QpidStockQuoteService'
+destination.replyQueue =
direct://amq.direct//replyQueue?routingkey='replyQueue'
+
Added: synapse/trunk/java/repository/conf/sample/synapse_sample_260.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_260.xml?rev=682568&view=auto
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_260.xml (added)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_260.xml Mon Aug 4
19:58:41 2008
@@ -0,0 +1,46 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<!-- FIX to AMQP Proxy Service -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <proxy name="FIXProxy" transports="fix">
+ <target>
+ <endpoint>
+ <address
uri="jms:/QpidStockQuoteService?transport.jms.ConnectionFactoryJNDIName=qpidConnectionfactory&java.naming.factory.initial=org.apache.qpid.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/sample/resources/fix/con.properties&transport.jms.ReplyDestination=replyQueue"/>
+ </endpoint>
+ <inSequence>
+ <log level="full" />
+ </inSequence>
+ <outSequence>
+ <property name="transport.fix.ServiceName"
+ value="FIXProxy" scope="axis2-client" />
+ <log level="full" />
+ <send />
+ </outSequence>
+ </target>
+ <parameter name="transport.fix.AcceptorConfigURL">
+
file:repository/conf/sample/resources/fix/fix-synapse.cfg
+ </parameter>
+ <parameter name="transport.fix.AcceptorMessageStore">
+ file
+ </parameter>
+ </proxy>
+</definitions>
+
+
Modified: synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml?rev=682568&r1=682567&r2=682568&view=diff
==============================================================================
--- synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml (original)
+++ synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml Mon Aug 4 19:58:41
2008
@@ -322,6 +322,10 @@
<a href="#Sample259">Sample 259: Switching from FIX to HTTP
</a>
</li>
+ <li>
+ <a href="#Sample260">Sample 260: Switching from FIX to AMQP
+ </a>
+ </li>
</ul>
</li>
<li>
@@ -3944,7 +3948,85 @@
see <a href="Synapse_Samples_Setup.html#fixparameters">FIX Transport
Parameters
</a>.
</p>
-
+ <h2>
+ <a name="Sample260" id="Sample260">Sample 260: Switch from FIX to AMQP
</a>
+ </h2>
+ <pre xml:space="preserve">
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+ <proxy name="FIXProxy" transports="fix">
+ <target>
+ <endpoint>
+ <address
uri="jms:/QpidStockQuoteService?transport.jms.ConnectionFactoryJNDIName=qpidConnectionfactory&amp;java.naming.factory.initial=org.apache.qpid.jndi.PropertiesFileInitialContextFactory&amp;java.naming.provider.url=repository/conf/sample/resources/fix/con.properties&amp;transport.jms.ReplyDestination=replyQueue"/>
+ </endpoint>
+ <inSequence>
+ <log level="full" />
+ </inSequence>
+ <outSequence>
+ <property
name="transport.fix.ServiceName"
+ value="FIXProxy"
scope="axis2-client" />
+ <log level="full" />
+ <send />
+ </outSequence>
+ </target>
+ <parameter
name="transport.fix.AcceptorConfigURL">
+
file:repository/conf/sample/resources/fix/fix-synapse.cfg
+ </parameter>
+ <parameter
name="transport.fix.AcceptorMessageStore">
+ file
+ </parameter>
+ </proxy>
+</definitions></pre>
+ <p>
+ <strong>Objective: Demonstrate the capability of switching between
FIX and AMQP protocols</strong>
+ </p>
+ <p>
+ <strong>Prerequisites:</strong><br/>
+ You will need the sample FIX blotter that comes with Quickfix/J
+ (Banzai). Configure the blotter to establish
+ sessions with Synapse. See <a
href="Synapse_Samples_Setup.html#fixsamplesconfig">
+ Configuring Sample FIX Applications</a>
+ </p>
+ <p>
+ Configure the AMQP transport for Synapse. See <a
href="Synapse_Samples_Setup.html#setupamqpjms">
+ Configure Synapse for AMQP Transport</a>
+ </p>
+ <p>
+ Start the AMQP consumer, by switching to samples/axis2Client
directory and running the consumer
+ using the following command. Consumer will listen to the queue
'QpidStockQuoteService', accept the orders and
+ reply to the queue 'replyQueue'.
+ </p>
+ <pre xml:space="preserve">ant amqpconsumer
-Dpropfile=$SYNAPSE_HOME/repository/conf/sample/resources/fix/direct.properties</pre>
+ <p>
+ Start Banzai
+ </p>
+ <p>
+ Enable FIX transport in the Synapse axis2.xml. See <a
+ href="Synapse_Samples_Setup.html#fixtransport">Setting up FIX
transport
+ </a>
+ </p>
+ <p>
+ Configure Synapse for FIX samples. See <a
href="Synapse_Samples_Setup.html#fixsamples">
+ Configuring Synapse for FIX Samples</a>
+ </p>
+ <p>
+ Open up the
SYNAPSE_HOME/repository/conf/sample/synapse_sample_260.xml file
+ and make sure that the transport.fix.AcceptorConfigURL property
points to the
+ fix-synapse.cfg file you created. Once done you can start the
Synapse configuration numbered 260:
+ i.e. synapse -sample 260. Note that Synapse creates a new FIX
session with
+ Banzai at this point.
+ </p>
+ <p>
+ Send an order request from Banzai to Synapse. e.g. Buy DELL 1000 @
MKT.
+ </p>
+ <p>
+ Synapse will forward the order request by binding it to a JMS
message payload and sending it to the
+ AMQP consumer. AMQP consumer will send a execution back to Banzai.
+ </p>
+ <p>
+ To get an idea about the various transport parameters being used in
this sample
+ see <a href="Synapse_Samples_Setup.html#fixparameters">FIX Transport
Parameters
+ </a>.
+ </p>
<h1>
<a name="Task" id="Task">Introduction to Synapse Tasks</a>
</h1>
Modified: synapse/trunk/java/src/site/xdoc/Synapse_Samples_Setup.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/src/site/xdoc/Synapse_Samples_Setup.xml?rev=682568&r1=682567&r2=682568&view=diff
==============================================================================
--- synapse/trunk/java/src/site/xdoc/Synapse_Samples_Setup.xml (original)
+++ synapse/trunk/java/src/site/xdoc/Synapse_Samples_Setup.xml Mon Aug 4
19:58:41 2008
@@ -500,6 +500,65 @@
</parameter>
</transportReceiver></pre>
<p/>
+ <h2 id="setupamqpjms">
+ Configure Synapse for AMQP Transport
+ </h2>
+ <p/>
+ <p>
+ The samples used in this guide assumes the existence of a local QPid
+ (1.0-M2 or higher) installation properly installed and started up. You
also
+ need to copy the following client JAR files into the Synapse 'lib' folder
+ to support AMQP. These files are found in the 'lib' directory of the
+ QPid installation.
+ </p>
+ <ul>
+ <li>qpid-client-1.0-incubating-M2.jar</li>
+ <li>qpid-common-1.0-incubating-M2.jar</li>
+ <li>geronimo-jms_1.1_spec-1.0.jar</li>
+ <li>slf4j-api-1.4.0.jar **</li>
+ <li>slf4j-log4j12-1.4.0.jar **</li>
+ </ul>
+ <p>
+ ** To configure FIX (Quickfix/J 1.3) with AMQP (QPid-1.0-M2) copy
the sl4j-* libraries comes with QPid and ignore the sl4j-* libraries with
Quickfix/J.
+ </p>
+ <p>
+ To enable the AMQP over JMS transport, you need to uncomment the JMS
transport
+ listener configuration. To enable AMQP over JMS for synapse, the
repository/conf/axis2.xml must be updated,
+ while to enable JMS support for the sample Axis2 server the
+ samples/axis2Server/repository/conf/axis2.xml file must be updated.
+ </p>
+ <pre xml:space="preserve"> <!--Uncomment this and configure as
appropriate for JMS transport support, after setting up your JMS environment
-->
+ <transportReceiver name="jms"
class="org.apache.synapse.transport.jms.JMSListener">
+ </transportReceiver>
+
+ <transportSender name="jms"
class="org.apache.synapse.transport.jms.JMSSender">
+ </transportReceiver></pre>
+
+ <p/>
+ <p>
+ Locate and edit the AMQP connection settings file for the message
consumer, this fle is usually named direct.properties.
+ <pre>
+ java.naming.factory.initial =
org.apache.qpid.jndi.PropertiesFileInitialContextFactory
+ # register some connection factories
+ # connectionfactory.[jndiname] = [ConnectionURL]
+ connectionfactory.qpidConnectionfactory = amqp://guest:[EMAIL
PROTECTED]/test?brokerlist='tcp://localhost:5672'
+ # Register an AMQP destination in JNDI
+ # destination.[jniName] = [BindingURL]
+ destination.directQueue =
direct://amq.direct//QpidStockQuoteService?routingkey='QpidStockQuoteService'
+ destination.replyQueue =
direct://amq.direct//replyQueue?routingkey='replyQueue'</pre>
+ </p>
+ <p>
+ Locate and edit the AMQP connection settings file for Synapse, this
fle is usually named con.properties.
+ <pre>
+ #initial context factory
+ #java.naming.factory.initial
=org.apache.qpid.jndi.PropertiesFileInitialContextFactory
+ # register some connection factories
+ # connectionfactory.[jndiname] = [ConnectionURL]
+ connectionfactory.qpidConnectionfactory=amqp://guest:[EMAIL
PROTECTED]/test?brokerlist='tcp://localhost:5672'
+ # Register an AMQP destination in JNDI
+ # destination.[jndiName] = [BindingURL]
+
destination.directQueue=direct://amq.direct//QpidStockQuoteService</pre>
+ </p>
<h2 id="mailsender">
Setting up Mail Transport Sender
</h2>
@@ -509,7 +568,7 @@
the MailTransportSender sample configuration and make sure it points to a
valid SMTP configuration for any actual scenarios.
</p>
-<pre xml:space="preserve"> <transportSender name="mailto"
class="org.apache.synapse.transport.mail.MailTransportSender">
+ <pre xml:space="preserve"> <transportSender name="mailto"
class="org.apache.synapse.transport.mail.MailTransportSender">
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter
name="mail.smtp.starttls.enable">true</parameter>