axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <d...@yahoo.com>
Subject Re: jms URL
Date Thu, 08 Jan 2004 13:58:19 GMT
Jim,

Checked in your patch. Please cross check the axis cvs. Also next time, please follow the
guidelines mentioned here for patch submission -
http://nagoya.apache.org/wiki/apachewiki.cgi?AxisProjectPages/SubmitPatches

thanks,
dims

--- Jim Stafford <jim.stafford@raba.com> wrote:
> Glen,
> 
> I have attached the requested patch for the changes I made against the 
> JMS packages. I have finished a full publish thread from client to 
> Server, but not much else. The changes are soley in the publish side 
> since the additional properties are mostly for the comms-routing of the 
> messages and not meant to be content to the receiving object. If we do 
> need additional access to the JMS properties on the receiving side, it 
> will more than likely involve an upgrade the the SimpleJMS classes provided.
> 
> The URL properties are passed as Strings. I also did not change Stub 
> generation to all the caller an overloaded method to pass the per-Call 
> properties through the static Stub.
> 
> The following is a summary of what changes exist:
> * org.apache.axis.client.Stub.extractAttachements() - defended against 
> NullPointerException when no response message present
> 
> * org.apache.axis.components.JMSVendorAdapter - populate MessageContext 
> with application-specific properties from the jmsurl, the 
> MessageContext, and Call.
> 
> * org.apache.axis.transport.jms.JMSConstants - added a few properties to 
> identify application-specific property prefix in URL and Map of 
> properties within the MessageContext properties.
> 
> * org.apache.axis.transport.jms.JMSServer - expanded the role of 
> createSendProperties() such that it grabs the application-specific 
> properties as well as the JMS-defined.
> 
> * org.apache.axis.transport.jms.JMSURLHelper.java - added ability to 
> separately track/process application-specific properties as well as 
> re-generate itself into a String again.
> 
> Once general comment I found annoying was the use of classes versus 
> interfaces when it came to HasMap versus Map. Many times Map would have 
> been sufficient, but the code required a HashMap type. I was wondering 
> if there was any hidden intent in making it a class type versus an 
> interface type?
> 
> jim
> 
> Glen Daniels wrote:
> 
> >Since the JMS transport isn't used by all that many people yet, if you can get a
version of
> this ready to go in the next day or two, I think we can get it into 1.2 (we're gonna
release 1.2
> beta probably at the end of this week).  Jim, would you be willing to generate a patch
against
> the latest CVS version and send it to axis-dev so that Jaime and others can check it
out and
> then commit it?  This seems like good functionality to me.
> >
> >--Glen
> >
> >
> >Original message:
> >---------------From:Jaime Meritt <jmeritt@sonicsoftware.com>
> >To:Jim Stafford <jim.stafford@raba.com>
> >Cc:Jim Stafford <jcstaff@aplcenMP.apl.jhu.edu>, Glen Daniels <gdaniels@sonicsoftware.com>,
> "David A. Chappell" <chappell@sonicsoftware.com>, Keith Fisher <keith.fisher@raba.com>
> >
> >Jim,
> >=20
> >Great to see you hacking away at the code!!!  I would prefer a version
> >that fits in the Axis tree as opposed to using subclasses because it is
> >generically useful functionality that I see no purpose in specializing
> >for.  I would be happy to review the code and once we agree that it is
> >ready I will commit it as well. However, we may have to wait until after
> >1.2 releases to see a productized version of it (1.3 I would imagine).
> >=20
> >Thanks,
> >Jaime
> >
> >________________________________
> >
> >From: Jim Stafford [mailto:jim.stafford@raba.com]=20
> >Sent: Tuesday, January 06, 2004 12:10 AM
> >To: Jim Stafford
> >Cc: Jaime Meritt; Jim Stafford; Glen Daniels; David A. Chappell; Keith
> >Fisher
> >Subject: Re: jms URL
> >
> >
> >Jaime,
> >
> >I have finished working on a version of the JMS software that handles
> >the processing side:
> >
> >2004-01-05 23:46:49 [MSG:129] received from user=3D'anonymous': =
> >connID=3D68
> >prodID=3D6
> >71 msgID=3D'ID:siteBlitz_hub.12283BB3A08C:3' Time=3D1073364409345
> >mode=3DNON_PERSISTENT topic=3D'topics.general' =
> >msg=3DBytesMessage=3D{Header=3D{
> >JMSDestination=3D{TOPIC:'topics.general'} =
> >JMSDeliveryMode=3D{NON_PERSISTENT}
> >JMSPriority=3D{4} JMSMessageID=3D{ID:si
> >teBlitz_hub.12283BB3A08C:3} JMSTimestamp=3D{1073364409345}}
> >Properties=3D{"prop2"=3D{string:'value2'} "prop1"=3D{string:'value1'}
> >"EWMService"=3D{string:'DemoService'}=20
> >"callProp1"=3D{string:'aValue'}} Body=3D{byte[]:652 bytes}
> >
> >* callProp1 comes from code interacting with the Call=20
> >        Map appProps =3D new HashMap();
> >        appProps.put("callProp1", "aValue");
> >=20
> >_call.setProperty(EWMJMSConstants.JMS_APPLICATION_MSG_PROPS,appProps);
> >
> >* EWMService, prop1, and prop2 come from the WSDL URL
> >jms:/topics.general?domain=3DTOPIC&vendor=3DEWMJNDI&
> >java.naming.factory.initial=3Dcom.tibco.tibjms.naming.TibjmsInitialContex=
> >t
> >Factory&j
> >ava.naming.provider.url=3Dtcp://blitz:7222,tcp://blitz:7224&
> >ConnectionFactoryJNDIName=3DTopicConnectionFactory&
> >waitForResponse=3Dfalse&
> >msgProp.EWMService=3DDemoService&
> >msgProp.prop1=3Dvalue1&
> >msgProp.prop2=3Dvalue2
> >
> >I have two versions
> >1) edits the ws-axis CVS tree
> >2) sub-classes and other extensions with no modification to the Axis
> >classes
> >
> >Which form would you be interested in and would you be interested in
> >viewing either solution before I get things more finalized for our demo?
> >
> >jim
> >
> >Jim Stafford wrote:
> >
> >
> >	Jaime,
> >=09
> >	We are interested in creating and contributing what is needed to
> >do this and are motivated by a short term proof of concept demo on our
> >end to get things going quickly. What do you normally need (functional
> >specs, design proposals?) for such a change; besides code and what isn't
> >documented on the axis contribution web page?
> >=09
> >	I will try to further spell out my/our intentions to make sure
> >this is where you want the product to head and help solicit pointers of
> >where you would or would not implement some of this.
> >=09
> >	--
> >	We have a system of JMS Servers that integrate collaborators in
> >various parts of the world and with varying access to bandwidth. Various
> >application-specific JMS properties are useful/necessary to route or
> >limit the route of messages to certain remote locations as well as
> >having replies find their way back to the requestor. We are working on a
> >data-driven system, where the publishers/senders of messages are
> >ignorant of the location of the receivers/subscribers of the messages.
> >Systems cannot be hard-wired to share a single queue or topic and may
> >not be part of the same JMS Server system. We have this working with
> >pure-JMS clients.=20
> >=09
> >	We are now making the next step where we'd like to propose a
> >message format standard for these JMS clients. For open interoperability
> >reasons, we are leaning towards XML and specifically SOAP with
> >attachements. The JAX-RPC Call API seems a bit more natural than the
> >pure SOAP API. The WSDL generated static stubs seems even nicer for
> >clients who want to stay removed from the details of Web Services.
> >=09
> >	The 1.2alpa org.apache.axis.transport.jms release goes a long
> >way towards meeting the above goals. I have only worked my way through
> >the send side of the product, but the only glaring issue I've found is
> >the diffuculty in being able to supply application-specific properties.
> >We tend to have several types:
> >	* Service-specific properties (e.g, location=3DUSA|Europe,
> >business-domain=3Dsales|shipping)
> >	* Client-specific properties (e.g., location,
> >business-domain=3Don-line-shop|store)
> >	* Call-specific properties (e.g., business-priority (versus JMS
> >priority), conversation sequence (versus JMS sequence), privacy labels)
> >=09
> >	Some might be able to argue that the call-specific properties
> >could be limited to expression within the JMS message and not exposed as
> >a JMS property. However, at this point in our research/development, such
> >constraints would seem very risky.
> >=09
> >	It appears we need to make changes to
> >	1) allow application-specific properties to be specified for the
> >service (done in WSDL and processing chains), the client (through
> >collaboration with the Locator/runtime URL and processing chains), and
> >the call (using Call.addProperty).
> >	2) allow users of the WSDL-generated static stubs to also be
> >able to provide call-specific, application-specific properties (e.g.,
> >provide a non-standard overload of each method call that accepts a Map
> >of application-specific properties to be merged with the client and
> >server supplied properties.
> >=09
> >	thoughts?
> >=09
> >	jim
> >=09
> >	Jaime Meritt wrote:
> >=09
> >
> >		There is definitely interest in this issue.  Perhaps we
> >should
> >		collaborate on a patch that adds your functionality into
> >the main
> 
=== message truncated ===> Index: org/apache/axis/client/Stub.java
> ===================================================================
> RCS file: /home/cvspublic/ws-axis/java/src/org/apache/axis/client/Stub.java,v
> retrieving revision 1.31
> diff -u -r1.31 Stub.java
> --- org/apache/axis/client/Stub.java	7 Aug 2003 21:38:22 -0000	1.31
> +++ org/apache/axis/client/Stub.java	8 Jan 2004 03:30:10 -0000
> @@ -328,7 +328,8 @@
>       */ 
>      public void extractAttachments(Call call) {
>          attachments.clear();
> -        if(call.getResponseMessage().countAttachments()>0) {
> +        if(call.getResponseMessage() != null &&
> +           call.getResponseMessage().countAttachments()>0) {
>              Iterator iterator = call.getResponseMessage().getAttachments();
>              while(iterator.hasNext()){
>                  attachments.add(iterator.next());
> Index: org/apache/axis/components/jms/JMSVendorAdapter.java
> ===================================================================
> RCS file:
> /home/cvspublic/ws-axis/java/src/org/apache/axis/components/jms/JMSVendorAdapter.java,v
> retrieving revision 1.5
> diff -u -r1.5 JMSVendorAdapter.java
> --- org/apache/axis/components/jms/JMSVendorAdapter.java	20 Nov 2003 06:44:29 -0000	1.5
> +++ org/apache/axis/components/jms/JMSVendorAdapter.java	8 Jan 2004 03:30:11 -0000
> @@ -57,6 +57,7 @@
>  
>  import java.util.HashMap;
>  import java.util.Iterator;
> +import java.util.Map;
>  
>  import javax.jms.InvalidDestinationException;
>  import javax.jms.JMSException;
> @@ -325,5 +326,38 @@
>              else
>                  context.removeProperty(JMSConstants.WAIT_FOR_RESPONSE);
>          }
> +        setupApplicationProperties(context, call, jmsurl);
> +    }
> +    
> +    public void setupApplicationProperties(MessageContext context,
> +                                    Call call,
> +                                    JMSURLHelper jmsurl)
> +    {
> +        //start with application properties from the URL
> +        Map appProps = new HashMap();
> +        if (jmsurl != null && jmsurl.getApplicationProperties() != null) {
> +            for(Iterator itr=jmsurl.getApplicationProperties().iterator();
> +                itr.hasNext();) {
> +                String name = (String)itr.next();
> +                appProps.put(name,jmsurl.getPropertyValue(name));
> +            }
> +        }
> +        
> +        //next add application properties from the message context
> +        Map ctxProps = 
> +           (Map)context.getProperty(JMSConstants.JMS_APPLICATION_MSG_PROPS);
> +        if (ctxProps != null) {
> +            appProps.putAll(ctxProps);
> +        }
> +        
> +        //finally add the properties from the call
> +        Map callProps = 
> +            (Map)call.getProperty(JMSConstants.JMS_APPLICATION_MSG_PROPS);
> +        if (callProps != null) {
> +            appProps.putAll(callProps);
> +        }
> +        
> +        //now tore these properties within the context
> +        context.setProperty(JMSConstants.JMS_APPLICATION_MSG_PROPS,appProps);
>      }
>  }
> Index: org/apache/axis/transport/jms/JMSConstants.java
> ===================================================================
> RCS file: /home/cvspublic/ws-axis/java/src/org/apache/axis/transport/jms/JMSConstants.java,v
> retrieving revision 1.4
> diff -u -r1.4 JMSConstants.java
> --- org/apache/axis/transport/jms/JMSConstants.java	30 Sep 2003 19:08:09 -0000	1.4
> +++ org/apache/axis/transport/jms/JMSConstants.java	8 Jan 2004 03:30:14 -0000
> @@ -102,6 +102,10 @@
>      final static String _INTERACT_RETRY_INTERVAL      = "interactRetryInterval";
>      final static String _TIMEOUT_TIME                 = "timeoutTime";
>      final static String _MIN_TIMEOUT_TIME             = "minTimeoutTime";
> +    /** Defines a prefix added to each application-specific property in the 
> +     * JMS URL that should be added to the JMS Message when issued.
> +     */
> +    final static String _MSG_PROP_PREFIX              = "msgProp.";
>  
>      public static String JMS_PROPERTY_PREFIX = "transport.jms.";
>  
> @@ -291,6 +295,12 @@
>  
>      // key used to store the JMS URL string in the message context
>      final static String JMS_URL         = JMS_PROPERTY_PREFIX + "EndpointAddress";
> +    
> +    /** A property that carries a Map of application-specific properties to be
> +     * added to the JMS messages when issued. 
> +     */
> +    final static String JMS_APPLICATION_MSG_PROPS = 
> +        JMS_PROPERTY_PREFIX + "msgProps";
>  
>      final static String ADAPTER_POSTFIX = "VendorAdapter";
>  }
> Index: org/apache/axis/transport/jms/JMSSender.java
> ===================================================================
> RCS file: /home/cvspublic/ws-axis/java/src/org/apache/axis/transport/jms/JMSSender.java,v
> retrieving revision 1.4
> diff -u -r1.4 JMSSender.java
> --- org/apache/axis/transport/jms/JMSSender.java	1 Oct 2003 10:46:08 -0000	1.4
> +++ org/apache/axis/transport/jms/JMSSender.java	8 Jan 2004 03:30:14 -0000
> @@ -63,6 +63,7 @@
>  import javax.jms.Destination;
>  import java.io.ByteArrayOutputStream;
>  import java.util.HashMap;
> +import java.util.Map;
>  
>  /**
>   * This is meant to be used on a SOAP Client to call a SOAP server.
> @@ -137,15 +138,12 @@
>  
>      private HashMap createSendProperties(MessageContext context)
>      {
> +        //I'm not sure why this helper method is private, but 
> +        //we need to delegate to factory method that can build the
> +        //application-specific map of properties so make a change to
> +        //delegate here. 
> +        HashMap props = createApplicationProperties(context);
>  
> -        if(!context.containsProperty(JMSConstants.PRIORITY) &&
> -           !context.containsProperty(JMSConstants.DELIVERY_MODE) &&
> -           !context.containsProperty(JMSConstants.TIME_TO_LIVE))
> -        {
> -            return null;
> -        }
> -
> -        HashMap props = new HashMap();
>          if(context.containsProperty(JMSConstants.PRIORITY))
>              props.put(JMSConstants.PRIORITY,
>              context.getProperty(JMSConstants.PRIORITY));
> @@ -158,5 +156,17 @@
>          return props;
>      }
>  
> -
> +    /** Return a map of properties that makeup the application-specific
> +        for the JMS Messages.
> +     */
> +    protected HashMap createApplicationProperties(MessageContext context) {
> +        HashMap props = null;
> +        if (context.containsProperty(
> +            JMSConstants.JMS_APPLICATION_MSG_PROPS)) {
> +            props = new HashMap();
> +            props.putAll((Map)context.getProperty(
> +                JMSConstants.JMS_APPLICATION_MSG_PROPS));
> +        }
> +        return props;
> +    }
>  }
> Index: org/apache/axis/transport/jms/JMSURLHelper.java
> ===================================================================
> RCS file: /home/cvspublic/ws-axis/java/src/org/apache/axis/transport/jms/JMSURLHelper.java,v
> retrieving revision 1.1
> diff -u -r1.1 JMSURLHelper.java
> --- org/apache/axis/transport/jms/JMSURLHelper.java	30 Sep 2003 19:14:56 -0000	1.1
> +++ org/apache/axis/transport/jms/JMSURLHelper.java	8 Jan 2004 03:30:14 -0000
> @@ -55,8 +55,11 @@
>  
>  package org.apache.axis.transport.jms;
>  
> +import java.net.MalformedURLException;
>  import java.net.URL;
>  import java.util.HashMap;
> +import java.util.Iterator;
> +import java.util.Map;
>  import java.util.StringTokenizer;
>  import java.util.Vector;
>  
> @@ -75,10 +78,13 @@
>  
>      // vendor-specific properties
>      private HashMap properties;
> -
> +    
>      // required properties
>      private Vector requiredProperties;
>  
> +    //application-specific JMS message properties
> +    private Vector appProperties;
> +
>      public JMSURLHelper(java.net.URL url) throws java.net.MalformedURLException {
>          this(url, null);
>      }
> @@ -86,6 +92,7 @@
>      public JMSURLHelper(java.net.URL url, String[] requiredProperties) throws
> java.net.MalformedURLException {
>          this.url = url;
>          properties = new HashMap();
> +        appProperties = new Vector();
>  
>          // the path should be something like '/SampleQ1'
>          // clip the leading '/' if there is one
> 
=== message truncated ===


=====
Davanum Srinivas - http://webservices.apache.org/~dims/

Mime
View raw message