You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by as...@apache.org on 2006/09/19 17:24:58 UTC

svn commit: r447880 - in /webservices/axis2/trunk/java/xdocs/latest: index.html jms-transport.html userguide.html

Author: asankha
Date: Tue Sep 19 08:24:57 2006
New Revision: 447880

URL: http://svn.apache.org/viewvc?view=rev&rev=447880
Log:
checkin initial documentation for JMS

Added:
    webservices/axis2/trunk/java/xdocs/latest/jms-transport.html
Modified:
    webservices/axis2/trunk/java/xdocs/latest/index.html
    webservices/axis2/trunk/java/xdocs/latest/userguide.html

Modified: webservices/axis2/trunk/java/xdocs/latest/index.html
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/xdocs/latest/index.html?view=diff&rev=447880&r1=447879&r2=447880
==============================================================================
--- webservices/axis2/trunk/java/xdocs/latest/index.html (original)
+++ webservices/axis2/trunk/java/xdocs/latest/index.html Tue Sep 19 08:24:57 2006
@@ -176,6 +176,10 @@
       <td>Description on HTTP sender and HTTP receiver in Axis2</td>
     </tr>
     <tr>
+      <td><a href="jms-transport.html">JMS Transport</a></td>
+      <td>Description on JMS sender and JMS receiver in Axis2</td>
+    </tr>
+    <tr>
       <td><a href="spring.html">Spring Framework</a></td>
       <td>Guide on how to use Axis2 with the Spring Framework</td>
     </tr>

Added: webservices/axis2/trunk/java/xdocs/latest/jms-transport.html
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/xdocs/latest/jms-transport.html?view=auto&rev=447880
==============================================================================
--- webservices/axis2/trunk/java/xdocs/latest/jms-transport.html (added)
+++ webservices/axis2/trunk/java/xdocs/latest/jms-transport.html Tue Sep 19 08:24:57 2006
@@ -0,0 +1,188 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta http-equiv="content-type" content="">
+  <title>HTTP transports</title>
+</head>
+
+<body lang="en">
+<h1><a name="configTransport">JMS Transport</a></h1>
+
+<p>This document is all about the JMS transport support in Axis2, and how it
+should be configured.</p>
+
+<p><i>Send your feedback or questions to: <a
+href="mailto:axis-dev@ws.apache.org">axis-dev@ws.apache.org</a></i>. Prefix
+subject with [Axis2]. To subscribe to mailing list see <a
+href="http://ws.apache.org/axis2/mail-lists.html">here.</a></p>
+
+<h2>Contents</h2>
+<ul>
+  <li><a href="#CommonsHTTPTransportSender">Overview</a></li>
+  <li><a href="#timeout_config">Configuration</a></li>
+</ul>
+
+<h2><a name="CommonsHTTPTransportSender">Overview</a></h2>
+
+<p>A new JMS transport implementation has been added to Axis2 to overcome
+some drawbacks of the previous JMS implementation. Some of the enhancements
+provided with this new implementation is the ability to assign custom JMS
+destination names or existing JMS destinations to Axis2 services being
+deployed. </p>
+
+<p></p>
+
+<h2>Configuration</h2>
+
+<p>To use the JMS transport, the axis2.xml configuration must be setup as
+follows, to configure the JMSListener and the JMS Sender</p>
+<pre>
+axis2.xml
+    &lt;transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener"&gt;
+      &lt;parameter name="default" locked="false"&gt;                
+        &lt;parameter name="java.naming.factory.initial" locked="false"&gt;org.apache.activemq.jndi.ActiveMQInitialContextFactory&lt;/parameter&gt;
+        &lt;parameter name="java.naming.provider.url" locked="false"&gt;tcp://localhost:61616&lt;/parameter&gt;        
+        &lt;parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false"&gt;QueueConnectionFactory&lt;/parameter&gt;
+      &lt;/parameter&gt;
+    &lt;/transportReceiver&gt;
+
+    &lt;transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/&gt;
+</pre>
+
+<p>The JMS transport receiver configuration allows you to define the default
+connection factory (named as "default" ~ JMSConstants.DEFAULT_CONFAC_NAME)
+for use by Axis2 services using the JMS transport. This connection factory
+would be used by any service which does not explicitly specify a connection
+factory name in its services.xml. The configuration required to associate a
+(local) Axis2 connection factory to an actual implementation must be provided
+as shown above, to specify the JNDI URL, initial context factory class and
+the JNDI name of the actual JMS connection factory to be used. You may also
+specify the parameters "java.naming.security.principal" and
+"java.naming.security.credentials" if required, to access the actual
+connection factory. The example shown above uses an ActiveMQ JMS
+implementation.</p>
+<pre>axis2.xml
+  &lt;parameter name="myTopicConnectionFactory" locked="false"&gt;</pre>
+<pre>    &lt;parameter name="java.naming.factory.initial" locked="false"&gt;org.apache.activemq.jndi.ActiveMQInitialContextFactory&lt;/parameter&gt;</pre>
+<pre>    &lt;parameter name="java.naming.provider.url" locked="false"&gt;tcp://localhost:61616&lt;/parameter&gt;</pre>
+<pre>    &lt;parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false"&gt;TopicConnectionFactory&lt;/parameter&gt;</pre>
+<pre>  &lt;/parameter&gt;</pre>
+
+<p>If it is required or applicable, you are free to define additional (local)
+connection factories to Axis2 as shown above, which your services may use.
+For a service to specify that such a connection factory should be used, its
+services.xml may specify the following configuration parameter.</p>
+<pre>services.xml  
+  &lt;parameter name="transport.jms.ConnectionFactory" locked="true"&gt;myTopicConnectionFactory&lt;/parameter&gt;</pre>
+
+<p>Note: Depending on your JMS implementation, you will need to make
+available all required libraries to your Axis2 instance. This example assumes
+you are using an ActiveMQ instance. To run the given code samples, it
+required me to make available the following JAR files:
+activeio-core-3.0-beta1.jar, activemq-core-4.0-RC2.jar,
+geronimo-j2ee-management_1.0_spec-1.0.jar at a minimum. It also requires you
+to start ActiveMQ separately from Axis2, and then provide the appropriate
+configuration settings (e.g. URL) to Axis2.</p>
+
+<p>During initialization, the JMS Listener creates a dedicated JMS message
+processor for each connection factory defined, and utilizes a shared thread
+pool to process received messages.</p>
+
+<p>A service on an Axis2 instance is deployed on all started transports by
+default, unless a list of transports are specified in its services.xml. Hence
+if a service must only be deployed on JMS, you should specify it on the
+services.xml as follows:</p>
+<pre>  &lt;transports&gt; 
+    &lt;transport&gt;jms&lt;/transport&gt; 
+  &lt;/transports&gt;</pre>
+
+<p>If the services.xml does not provide an explicit JMS destination name, it
+is assumed that the service will listen for messages on a JMS
+<strong>Queue</strong> by the same name as the <strong>name of the
+service</strong>. If an explicit connection factory definition name has not
+been specified, it is assumed that the "default" connection factory
+definition configured within the transport receiver should be used. To
+provide a custom JMS destination name and connection factory, the
+services.xml could provide the following optional parameters.</p>
+<pre>  &lt;parameter name="transport.jms.ConnectionFactory" locked="true"&gt;myTopicConnectionFactory&lt;/parameter&gt;
+  &lt;parameter name="transport.jms.Destination" locked="true"&gt;dynamicTopics/something.TestTopic&lt;/parameter&gt;</pre>
+
+<h2>Writing services to use the JMS transport</h2>
+
+<p>This section assumes that you are already familiar with writing service
+implementations for Axis2, and provides information to enable you to write
+your own service implementations which are exposed over JMS.</p>
+
+<p></p>
+
+<p>Echo - Service implementation and services.xml</p>
+
+<p>This sample demonstrates a very simple service which is to be exposed over
+JMS. It does not specify a custom connection factory name and hence uses the
+"default" as specified in the JMS transport listener configuration. It also
+does not specify a custom destination name, and hence would listen to
+messages over a JMS Queue named "Echo" (which is the name of the service).
+This service will be exposed over all defined Axis2 transports, and the
+resulting URL for the service over JMS would be</p>
+
+<p></p>
+<pre>Echo.java</pre>
+<pre>  public class Echo {</pre>
+<pre>    public String echoString(String in) {</pre>
+<pre>      return in;</pre>
+<pre>    }</pre>
+<pre>    public String echoString1(String in) {</pre>
+<pre>      return "echoString1 " + in;</pre>
+<pre>    }</pre>
+<pre>    public String echoString2(String in) {</pre>
+<pre>      return "echoString2 " + in;</pre>
+<pre>    }</pre>
+<pre>  }</pre>
+<pre></pre>
+<pre>services.xml</pre>
+<pre>  &lt;service name="echo"&gt;</pre>
+<pre>    &lt;description&gt;Echo Service&lt;/description&gt;</pre>
+<pre>    &lt;messageReceivers&gt;</pre>
+<pre>      &lt;messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"</pre>
+<pre>        class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/&gt;</pre>
+<pre>      &lt;messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"</pre>
+<pre>        class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/&gt;</pre>
+<pre>    &lt;/messageReceivers&gt;</pre>
+<pre>    &lt;parameter name="ServiceClass" locked="true"&gt;Echo&lt;/parameter&gt;</pre>
+<pre>&lt;/service&gt;</pre>
+
+<p></p>
+
+<p>Echo2 - Service implementation and services.xml</p>
+
+<p>This example shows a simple service which specifies that it should only be
+exposed over the JMS transport, and that the custom connection factory named
+"myTopcConnectionFactory" should be used to listen for requests, at the JMS
+destination named "dynamicTopics/something.TestTopic". The JMS URL to access
+this service is</p>
+<pre>Echo2.java</pre>
+<pre>  public class Echo2 {</pre>
+<pre>    public String echoString(String in) {</pre>
+<pre>      return in;</pre>
+<pre>    }</pre>
+<pre>  }</pre>
+<pre></pre>
+<pre>services.xml</pre>
+<pre>  &lt;service name="echo"&gt;</pre>
+<pre>    &lt;transports&gt;</pre>
+<pre>      &lt;transport&gt;jms&lt;/transport&gt;</pre>
+<pre>    &lt;/transports&gt;</pre>
+<pre>    &lt;description&gt;Echo2 Service&lt;/description&gt;</pre>
+<pre>    &lt;messageReceivers&gt;</pre>
+<pre>      &lt;messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"</pre>
+<pre>        class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/&gt;</pre>
+<pre>      &lt;messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"</pre>
+<pre>        class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/&gt;</pre>
+<pre>    &lt;/messageReceivers&gt;</pre>
+<pre>    &lt;parameter name="ServiceClass" locked="true"&gt;Echo2&lt;/parameter&gt;</pre>
+<pre>    &lt;parameter name="transport.jms.ConnectionFactory" locked="true"&gt;myTopicConnectionFactory&lt;/parameter&gt;</pre>
+<pre>    &lt;parameter name="transport.jms.Destination" locked="true"&gt;dynamicTopics/something.TestTopic&lt;/parameter&gt;</pre>
+<pre>  &lt;/service&gt;</pre>
+<pre> </pre>
+</body>
+</html>

Modified: webservices/axis2/trunk/java/xdocs/latest/userguide.html
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/xdocs/latest/userguide.html?view=diff&rev=447880&r1=447879&r2=447880
==============================================================================
--- webservices/axis2/trunk/java/xdocs/latest/userguide.html (original)
+++ webservices/axis2/trunk/java/xdocs/latest/userguide.html Tue Sep 19 08:24:57 2006
@@ -161,6 +161,8 @@
       Transport</a></li>
       <li><a href="http-transport.html" target="_blank">HTTP
       Transports</a></li>
+      <li><a href="jms-transport.html" target="_blank">JMS
+      Transports</a></li>
       <li><a href="mtom-guide.html" target="_blank">MTOM with Axis2</a></li>
       <li><a href="../modules/wss4j/1_0/security-module.html" target="_blank">Securing SOAP
         Messages with Apache Rampart</a></li>



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org