cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r744216 - in /cxf/branches/2.0.x-fixes: ./ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/main/resources/schemas/wsdl/ rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/ systests/src/test/java...
Date Fri, 13 Feb 2009 18:44:25 GMT
Author: dkulp
Date: Fri Feb 13 18:44:22 2009
New Revision: 744216

URL: http://svn.apache.org/viewvc?rev=744216&view=rev
Log:
Merged revisions 744181 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.1.x-fixes

................
  r744181 | dkulp | 2009-02-13 12:15:59 -0500 (Fri, 13 Feb 2009) | 9 lines
  
  Merged revisions 744175 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r744175 | dkulp | 2009-02-13 11:55:22 -0500 (Fri, 13 Feb 2009) | 2 lines
    
    [CXF-2030] Fix issues with JMS and IBM MQ.   Patch from Marat Bedretdinov applied.
  ........
................

Added:
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java
      - copied unchanged from r744181, cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java
      - copied unchanged from r744181, cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java
      - copied unchanged from r744181, cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java
      - copied unchanged from r744181, cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java
      - copied unchanged from r744181, cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java
      - copied unchanged from r744181, cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java
Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
    cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSUtilsTest.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/Server.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
    cxf/branches/2.0.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 13 18:44:22 2009
@@ -1,3 +1,3 @@
-/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472,694717,694748-694749,694870,695503,695509,695553,695555,695563,695875-695877,695940,695980,696436,696455,696721,697086,698129,701526,701634,702275,702443,702527,702582,702604,702610,702642-702643,702649,702760,702870,702873,702959,703193,703242,703523,704303,704587,704738,704998,705153,705280-705449,705455,709357,709641,709644,710177,710184,711736,712199,712225,712275,712600,712896,713083,713410,713413,713594,713599,713808,713901,714169-714171,718622,718929,719211,719221-719223,7192
 96,719300-719301,719303,719308,719332,719356,719363,719369-719383,719650,719695,720124,723545,724403-724404,724421,724448,724451,724486-724487,724714,725367,725371,725763,725774,726045,726048,726106,726123,726745-726746,726749,726754,726756-726758,726995,727794,727797-727798,727800,731676,731684,731686-731688,731690,733587,733873,733876,733884,733891,733893,733915,735132,735136,735789,736451,736453,736456,736761,736765,736771,736827,736853,737126,737706,737714,737716,737726,737729-737730,737732,737734,737737,737861,738167,738181,738202,738206,738208,738243,738245,738588-738594,739379,739916,739920-739921,739930,740043,740190,740195,740326,740328,740959,741153-741156,741159,741163,741190,743496,743498-743499,743501-743502,743504,743512,743516,743968,744173
-/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694869,695396,695484,695537,695552,695561,695619,695684,695835,695935,695977,696094,696433,696720,697085,698128,700261,700602,701783,701830,701862,702267,702580,702602,702609,702616,702656,702957,703191,703239,703501,704584,704997,705150,705274,705340,705446,708550,708554,709353-709354,709425,710150,712194,712198,712272,712312,712670,712893,713082,713584,713597,713804,713899,714167-714168,718281,718565,718620,718640,718665,719017,719210,719215-719218,719222,719273,719327-719354,719362,719368,719382,719649,719680,720119-720217,723338,723717-723791,724334-724371,724433-724438,724449,724481,724485,724668,724782,724795,725754,725773,725799,725839,726342,726524,726631,726637,726639,726692,726724,726992,727445,727692,727754,727792,730139,731598,731604,731615,73163
 1,731635,732320,732363,732411,732710,732773,732827,732829,733582,734666,734836,735734,736332,736343,736352,736408,736423,736491,736738,736766,736825,736852,737032,737069,737124,737237,737299,737356,737494,737498,737855,738166,738178,738201,738242,738244,739367,739799-739800,739876-739877,739922,739937,740154,740186,740197,740255,740810,740844,740886,740902,740923,741124,741152,741188,741521,741529,741879,743087,743439,743441,743459,743469,743965,743967
+/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472,694717,694748-694749,694870,695503,695509,695553,695555,695563,695875-695877,695940,695980,696436,696455,696721,697086,698129,701526,701634,702275,702443,702527,702582,702604,702610,702642-702643,702649,702760,702870,702873,702959,703193,703242,703523,704303,704587,704738,704998,705153,705280-705449,705455,709357,709641,709644,710177,710184,711736,712199,712225,712275,712600,712896,713083,713410,713413,713594,713599,713808,713901,714169-714171,718622,718929,719211,719221-719223,7192
 96,719300-719301,719303,719308,719332,719356,719363,719369-719383,719650,719695,720124,723545,724403-724404,724421,724448,724451,724486-724487,724714,725367,725371,725763,725774,726045,726048,726106,726123,726745-726746,726749,726754,726756-726758,726995,727794,727797-727798,727800,731676,731684,731686-731688,731690,733587,733873,733876,733884,733891,733893,733915,735132,735136,735789,736451,736453,736456,736761,736765,736771,736827,736853,737126,737706,737714,737716,737726,737729-737730,737732,737734,737737,737861,738167,738181,738202,738206,738208,738243,738245,738588-738594,739379,739916,739920-739921,739930,740043,740190,740195,740326,740328,740959,741153-741156,741159,741163,741190,743496,743498-743499,743501-743502,743504,743512,743516,743968,744173,744181
+/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694869,695396,695484,695537,695552,695561,695619,695684,695835,695935,695977,696094,696433,696720,697085,698128,700261,700602,701783,701830,701862,702267,702580,702602,702609,702616,702656,702957,703191,703239,703501,704584,704997,705150,705274,705340,705446,708550,708554,709353-709354,709425,710150,712194,712198,712272,712312,712670,712893,713082,713584,713597,713804,713899,714167-714168,718281,718565,718620,718640,718665,719017,719210,719215-719218,719222,719273,719327-719354,719362,719368,719382,719649,719680,720119-720217,723338,723717-723791,724334-724371,724433-724438,724449,724481,724485,724668,724782,724795,725754,725773,725799,725839,726342,726524,726631,726637,726639,726692,726724,726992,727445,727692,727754,727792,730139,731598,731604,731615,73163
 1,731635,732320,732363,732411,732710,732773,732827,732829,733582,734666,734836,735734,736332,736343,736352,736408,736423,736491,736738,736766,736825,736852,737032,737069,737124,737237,737299,737356,737494,737498,737855,738166,738178,738201,738242,738244,739367,739799-739800,739876-739877,739922,739937,740154,740186,740197,740255,740810,740844,740886,740902,740923,741124,741152,741188,741521,741529,741879,743087,743439,743441,743459,743469,743965,743967,744175
 /incubator/cxf/trunk:434594-651668

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java (original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java Fri Feb 13 18:44:22 2009
@@ -27,6 +27,7 @@
 import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -54,28 +55,25 @@
  */
 public class JMSConduit extends AbstractConduit implements JMSExchangeSender, MessageListener {
     static final Logger LOG = LogUtils.getL7dLogger(JMSConduit.class);
+    
     private static final String CORRELATED = JMSConduit.class.getName() + ".correlated";
+    
     private EndpointInfo endpointInfo;
     private JMSConfiguration jmsConfig;
     private Map<String, Exchange> correlationMap;
     private DefaultMessageListenerContainer jmsListener;
     private String conduitId;
-    private int messageCount;
+    private AtomicLong messageCount;
 
     public JMSConduit(EndpointInfo endpointInfo, EndpointReferenceType target, JMSConfiguration jmsConfig) {
         super(target);
         this.jmsConfig = jmsConfig;
         this.endpointInfo = endpointInfo;
         correlationMap = new ConcurrentHashMap<String, Exchange>();
-        conduitId = UUID.randomUUID().toString();
-        messageCount = 0;
+        conduitId = UUID.randomUUID().toString().replaceAll("-", "");
+        messageCount = new AtomicLong(0);
     }
     
-    private synchronized String createCorrelationId() {
-        messageCount++;
-        return conduitId + "_" + messageCount;
-    }
-
     /**
      * Prepare the message for send out. The message will be sent after the caller has written the payload to
      * the OutputStream of the message and calls the close method of the stream. In the JMS case the
@@ -117,8 +115,10 @@
         
         final javax.jms.Destination replyTo = exchange.isOneWay() ? null : jmsListener.getDestination();
 
-        final String correlationId = (headers != null && headers.isSetJMSCorrelationID()) ? headers
-            .getJMSCorrelationID() : createCorrelationId();
+        final String correlationId = (headers != null && headers.isSetJMSCorrelationID()) 
+            ? headers.getJMSCorrelationID() 
+            : JMSUtils.createCorrelationId(jmsConfig.getConduitSelectorPrefix() + conduitId, 
+                                           messageCount.incrementAndGet());
             
         MessageCreator messageCreator = new MessageCreator() {
             public javax.jms.Message createMessage(Session session) throws JMSException {

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java (original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java Fri Feb 13 18:44:22 2009
@@ -78,6 +78,7 @@
     private String messageType = JMSConstants.TEXT_MESSAGE_TYPE;
     private boolean pubSubDomain;
     private boolean useConduitIdSelector = true;
+    private String conduitSelectorPrefix = "";
     private boolean autoResolveDestination;
     private long recoveryInterval = DEFAULT_VALUE;
     private int cacheLevel = DEFAULT_VALUE;
@@ -213,6 +214,14 @@
         this.messageSelector = messageSelector;
     }
 
+    public void setConduitSelectorPrefix(String conduitSelectorPrefix) {
+        this.conduitSelectorPrefix = conduitSelectorPrefix;
+    }
+
+    public String getConduitSelectorPrefix() {
+        return conduitSelectorPrefix;
+    }
+
     public boolean isSubscriptionDurable() {
         return subscriptionDurable;
     }

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java (original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java Fri Feb 13 18:44:22 2009
@@ -138,8 +138,14 @@
         } else if (jmsConfig.getCacheLevel() != JMSConfiguration.DEFAULT_VALUE) {
             jmsListener.setCacheLevel(jmsConfig.getCacheLevel());
         }
+        String staticSelectorPrefix = jmsConfig.getConduitSelectorPrefix();
         if (messageSelectorPrefix != null && jmsConfig.isUseConduitIdSelector()) {
-            jmsListener.setMessageSelector("JMSCorrelationID LIKE '" + messageSelectorPrefix + "%'");
+            jmsListener.setMessageSelector("JMSCorrelationID LIKE '" 
+                                            + staticSelectorPrefix 
+                                            + messageSelectorPrefix + "%'");
+        } else if (staticSelectorPrefix.length() > 0) {
+            jmsListener.setMessageSelector("JMSCorrelationID LIKE '" 
+                                            + staticSelectorPrefix +  "%'");
         }
         if (jmsConfig.getDestinationResolver() != null) {
             jmsListener.setDestinationResolver(jmsConfig.getDestinationResolver());

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java (original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java Fri Feb 13 18:44:22 2009
@@ -97,6 +97,9 @@
             jmsConfig.setReceiveTimeout(clientConfig.getClientReceiveTimeout());
             //}
             jmsConfig.setUseConduitIdSelector(clientConfig.isUseConduitIdSelector());
+            if (clientConfig.isSetConduitSelectorPrefix()) {
+                jmsConfig.setConduitSelectorPrefix(clientConfig.getConduitSelectorPrefix());
+            }
             jmsConfig.setSubscriptionDurable(serverBehavior.isSetDurableSubscriberName());       
             jmsConfig.setDurableSubscriptionName(serverBehavior.getDurableSubscriberName());
             if (sessionPool.isSetHighWaterMark()) {

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java (original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java Fri Feb 13 18:44:22 2009
@@ -47,6 +47,9 @@
 
     static final Logger LOG = LogUtils.getL7dLogger(JMSUtils.class);
 
+    private static final char[] CORRELATTION_ID_PADDING =  {'0', '0', '0', '0', '0', '0', '0', '0', 
+                                                            '0', '0', '0', '0', '0', '0', '0'};
+
     private JMSUtils() {
 
     }
@@ -281,5 +284,12 @@
         jmsMessage.setJMSCorrelationID(correlationId);
         return jmsMessage;
     }
-
+    
+    public static String createCorrelationId(final String prefix, long i) {
+        String index = Long.toHexString(i);
+        StringBuffer id = new StringBuffer(prefix);
+        id.append(CORRELATTION_ID_PADDING, 0, 16 - index.length());
+        id.append(index);
+        return id.toString();
+    }
 }

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd (original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd Fri Feb 13 18:44:22 2009
@@ -54,7 +54,8 @@
     				default="60000" />
     			<xs:attribute name="messageTimeToLive" type="xs:long"
     				default="0" />
-    			<xs:attribute name="useConduitIdSelector" type="xs:boolean" use="optional" default="true"></xs:attribute>
+                <xs:attribute name="conduitSelectorPrefix" type="xs:string" use="optional" default=""/>    				
+                <xs:attribute name="useConduitIdSelector" type="xs:boolean" use="optional" default="true"/>
     		</xs:extension>
     	</xs:complexContent>
     </xs:complexType>

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java (original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java Fri Feb 13 18:44:22 2009
@@ -320,6 +320,7 @@
         verifyReceivedMessage(inMessage);
         // wait for a while for the jms session recycling
 
+        inMessage = null;
         // Send a second message to check for an issue
         // Where the session was closed the second time
         sendoutMessage(conduit, outMessage, false);

Modified: cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSUtilsTest.java?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSUtilsTest.java (original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSUtilsTest.java Fri Feb 13 18:44:22 2009
@@ -22,6 +22,8 @@
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.Properties;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicLong;
 
 import javax.naming.Context;
 
@@ -61,9 +63,64 @@
             assertTrue("we should get the UnsupportedEncodingException here",
                        ex instanceof UnsupportedEncodingException);
         }
+    }
+    
+    @Test
+    public void testCorrelationIDGeneration() {
+        final String conduitId = UUID.randomUUID().toString().replaceAll("-", "");
+        // test min edge case
+        AtomicLong messageMinCount = new AtomicLong(0);
+        String correlationID = 
+            JMSUtils.createCorrelationId(conduitId, messageMinCount.get());
+        
+        String expected = conduitId + "0000000000000000";
+        assertEquals("The correlationID value does not match expected value",
+                     expected, correlationID);
+        assertEquals("The correlationID value does not match expected length",
+                     48, correlationID.length());
+        
+        // test max edge case
+        AtomicLong messageMaxCount = new AtomicLong(0xFFFFFFFFFFFFFFFFL);
+        
+        correlationID = 
+            JMSUtils.createCorrelationId(conduitId, messageMaxCount.get());
+        
+        expected = conduitId + "ffffffffffffffff";
+        assertEquals("The correlationID value does not match expected value",
+                     expected, correlationID);
+        assertEquals("The correlationID value does not match expected length",
+                48, correlationID.length());
+
+        // test overflow case
+        AtomicLong overflowCount = new AtomicLong(0xFFFFFFFFFFFFFFFFL);
         
+        correlationID = 
+            JMSUtils.createCorrelationId(conduitId, overflowCount.incrementAndGet());
         
-        
-    }
+        expected = conduitId + "0000000000000000";
+        assertEquals("The correlationID value does not match expected value",
+                     expected, correlationID);
+        assertEquals("The correlationID value does not match expected length",
+                48, correlationID.length());
+        
+        // test sequential flow
+        AtomicLong messageSequenceCount = new AtomicLong(0);
+        correlationID = 
+            JMSUtils.createCorrelationId(conduitId, messageSequenceCount.incrementAndGet());
+        
+        expected = conduitId + "0000000000000001";
+        assertEquals("The correlationID value does not match expected value",
+                     expected, correlationID);
+        assertEquals("The correlationID value does not match expected length",
+                     48, correlationID.length());
 
+        correlationID = 
+            JMSUtils.createCorrelationId(conduitId, messageSequenceCount.incrementAndGet());
+
+        expected = conduitId + "0000000000000002";
+        assertEquals("The correlationID value does not match expected value",
+                     expected, correlationID);
+        assertEquals("The correlationID value does not match expected length",
+                     48, correlationID.length());
+    }
 }

Modified: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java (original)
+++ cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java Fri Feb 13 18:44:22 2009
@@ -22,8 +22,11 @@
 import java.lang.reflect.Proxy;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.UUID;
 
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
@@ -37,6 +40,10 @@
 import org.apache.cxf.hello_world_jms.HelloWorldPubSubPort;
 import org.apache.cxf.hello_world_jms.HelloWorldPubSubService;
 import org.apache.cxf.hello_world_jms.HelloWorldService;
+import org.apache.cxf.hello_world_jms.HelloWorldServiceAppCorrelationIDNoPrefix;
+import org.apache.cxf.hello_world_jms.HelloWorldServiceAppCorrelationIDStaticPrefix;
+import org.apache.cxf.hello_world_jms.HelloWorldServiceRuntimeCorrelationIDDynamicPrefix;
+import org.apache.cxf.hello_world_jms.HelloWorldServiceRuntimeCorrelationIDStaticPrefix;
 import org.apache.cxf.hello_world_jms.NoSuchCodeLitFault;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.transport.jms.JMSConstants;
@@ -367,6 +374,301 @@
             throw (Exception)ex.getCause();
         }
     }
+
+    private static interface CorrelationIDFactory {
+        String createCorrealtionID();
+    }
+    
+    private static class ClientRunnable implements Runnable {
+        private HelloWorldPortType port;
+        private CorrelationIDFactory corrFactory;
+        private String prefix;
+        private Throwable ex;
+
+        public ClientRunnable(HelloWorldPortType port) {
+            this.port = port;
+        }
+
+        public ClientRunnable(HelloWorldPortType port, String prefix) {
+            this.port = port;
+            this.prefix = prefix;
+        }
+
+        public ClientRunnable(HelloWorldPortType port, CorrelationIDFactory factory) {
+            this.port = port;
+            this.corrFactory = factory;
+        }
+        
+        public Throwable getException() {
+            return ex;
+        }
+        
+        public void run() {
+            try {
+                InvocationHandler handler  = Proxy.getInvocationHandler(port);
+                BindingProvider  bp = (BindingProvider)handler;
+                Map<String, Object> requestContext = bp.getRequestContext();
+                JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
+                requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
+     
+                for (int idx = 0; idx < 5; idx++) {
+                    String request = "World" + ((prefix != null) ? ":" + prefix : "");
+                    String correlationID = null;
+                    if (corrFactory != null) {
+                        correlationID = corrFactory.createCorrealtionID();
+                        requestHeader.setJMSCorrelationID(correlationID);
+                        request +=  ":" + correlationID;
+                    }
+                    String expected = "Hello " + request;
+                    String response = port.greetMe(request);
+                    assertEquals("Response didn't match expected request", expected, response);
+                    if (corrFactory != null) {
+                        Map<String, Object> responseContext = bp.getResponseContext();
+                        JMSMessageHeadersType responseHeader = 
+                            (JMSMessageHeadersType)responseContext.get(
+                                    JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
+                        assertEquals("Request and Response CorrelationID didn't match", 
+                                      correlationID, responseHeader.getJMSCorrelationID());
+                    }
+                }
+            } catch (Throwable e) {
+                ex = e;
+            }
+        }
+    }
+    
+    @Test
+    public void testTwoWayQueueAppCorrelationIDStaticPrefix() throws Exception {
+        QName serviceName = getServiceName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                 "HelloWorldServiceAppCorrelationIDStaticPrefix"));
+        QName portNameEng = getPortName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                               "HelloWorldPortAppCorrelationIDStaticPrefixEng"));
+        QName portNameSales = getPortName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                               "HelloWorldPortAppCorrelationIDStaticPrefixSales"));
+
+        URL wsdl = getClass().getResource("/wsdl/jms_test.wsdl");
+        assertNotNull(wsdl);
+
+        HelloWorldServiceAppCorrelationIDStaticPrefix service = 
+            new HelloWorldServiceAppCorrelationIDStaticPrefix(wsdl, serviceName);
+        assertNotNull(service);
+
+        ClientRunnable engClient = 
+            new ClientRunnable(service.getPort(portNameEng, HelloWorldPortType.class),
+                new CorrelationIDFactory() {
+                    private int counter;
+                    public String createCorrealtionID() {
+                        return "com.mycompany.eng:" + counter++;
+                    }
+                });
+        
+        ClientRunnable salesClient = 
+             new ClientRunnable(service.getPort(portNameSales, HelloWorldPortType.class),
+                new CorrelationIDFactory() {
+                    private int counter;
+                    public String createCorrealtionID() {
+                        return "com.mycompany.sales:" + counter++;
+                    }
+                });
+        
+        Thread[] threads = new Thread[] {new Thread(engClient), new Thread(salesClient)};
+        
+        for (Thread t : threads) {
+            t.start();
+        }
+    
+        for (Thread t : threads) {
+            t.join();
+        }
+
+        Throwable e = (engClient.getException() != null) 
+                          ? engClient.getException() 
+                          : (salesClient.getException() != null) 
+                              ? salesClient.getException() : null;
+                              
+        if (e != null) {
+            StringBuffer message = new StringBuffer();
+            for (StackTraceElement ste : e.getStackTrace()) {
+                message.append(ste.toString() + System.getProperty("line.separator"));
+            }
+            fail(message.toString());
+        }
+    }
+
+    /* TO DO:
+     * This tests shows a missing QoS. When CXF clients share a named (persistent) reply queue
+     *  with an application provided correlationID there will be a guaranteed response
+     * message loss. 
+     * 
+     * A large number of threads is used to ensure message loss and avoid a false 
+     * positive assertion
+     */
+    @Test
+    public void testTwoWayQueueAppCorrelationIDNoPrefix() throws Exception {
+        QName serviceName = getServiceName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                 "HelloWorldServiceAppCorrelationIDNoPrefix"));
+        QName portName = getPortName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                               "HelloWorldPortAppCorrelationIDNoPrefix"));
+        URL wsdl = getClass().getResource("/wsdl/jms_test.wsdl");
+        assertNotNull(wsdl);
+
+        HelloWorldServiceAppCorrelationIDNoPrefix service = 
+            new HelloWorldServiceAppCorrelationIDNoPrefix(wsdl, serviceName);
+        assertNotNull(service);
+
+        Collection<Thread> threads = new ArrayList<Thread>();
+        Collection<ClientRunnable> clients = new ArrayList<ClientRunnable>();
+        
+        HelloWorldPortType port = service.getPort(portName, HelloWorldPortType.class);
+        
+        for (int i = 0; i < 100; ++i) {
+            ClientRunnable client =  
+                new ClientRunnable(port,
+                    new CorrelationIDFactory() {
+                        public String createCorrealtionID() {
+                            return UUID.randomUUID().toString();
+                        }
+                    });
+            
+            Thread thread = new Thread(client);
+            threads.add(thread);
+            clients.add(client);
+            thread.start();
+        }
+    
+        for (Thread t : threads) {
+            t.join();
+        }
+
+        for (ClientRunnable client : clients) {
+            if (client.getException() != null 
+                && client.getException().getMessage().contains("Timeout")) {
+                // exceptions expected
+                return;
+            }
+        }
+       
+        fail("This is a negative pass. If this test passed this means that the missing QoS" 
+             + " has been added to the runtime or an unexpected exception received. " 
+             + " If latter is true, then read method comments for details on missing QoS"
+             + " and change this test to fail on exception");
+    }
+
+    /*
+     * This tests a use case where there is a shared request and reply queues between
+     * two servers (Eng and Sales). However each server has a design time provided selector
+     * which allows them to share the same queue and do not consume the other's
+     * messages. 
+     * 
+     * The clients to these two servers use the same request and reply queues.
+     * An Eng client uses a design time selector prefix to form request message 
+     * correlationID and to form a reply consumer that filters only reply
+     * messages originated from the Eng server. To differentiate between
+     * one Eng client instance from another this suffix is supplemented by
+     * a runtime value of ConduitId which has 1-1 relation to a client instance
+     * This guarantees that an Eng client instance will only consume its own reply 
+     * messages. 
+     * 
+     * In case of a single client instance being shared among multiple threads
+     * the third portion of the request message correlationID, 
+     * an atomic rolling message counter, ensures that each message gets a unique ID
+     *  
+     * So the model is:
+     * 
+     * Many concurrent Sales clients to a single request and reply queues (Q1, Q2) 
+     * to a single Sales server
+     * Many concurrent Eng clients to a single request and reply queues (Q1, Q2) 
+     * to a single Eng server
+     */
+    @Test
+    public void testTwoWayQueueRuntimeCorrelationIDStaticPrefix() throws Exception {
+        QName serviceName = getServiceName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                 "HelloWorldServiceRuntimeCorrelationIDStaticPrefix"));
+        
+        QName portNameEng = getPortName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                  "HelloWorldPortRuntimeCorrelationIDStaticPrefixEng"));
+        QName portNameSales = getPortName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                  "HelloWorldPortRuntimeCorrelationIDStaticPrefixSales"));
+
+        URL wsdl = getClass().getResource("/wsdl/jms_test.wsdl");
+        assertNotNull(wsdl);
+
+        HelloWorldServiceRuntimeCorrelationIDStaticPrefix service = 
+            new HelloWorldServiceRuntimeCorrelationIDStaticPrefix(wsdl, serviceName);
+        assertNotNull(service);
+
+        Collection<Thread> threads = new ArrayList<Thread>();
+        Collection<ClientRunnable> clients = new ArrayList<ClientRunnable>();
+        
+        HelloWorldPortType portEng = service.getPort(portNameEng, HelloWorldPortType.class);
+        HelloWorldPortType portSales = service.getPort(portNameSales, HelloWorldPortType.class);
+        
+        for (int i = 0; i < 100; ++i) {
+            ClientRunnable client =  new ClientRunnable(portEng, "com.mycompany.eng:");
+            Thread thread = new Thread(client);
+            threads.add(thread);
+            clients.add(client);
+            thread.start();
+            client =  new ClientRunnable(portSales, "com.mycompany.sales:");
+            thread = new Thread(client);
+            threads.add(thread);
+            clients.add(client);
+            thread.start();
+        }
+    
+        for (Thread t : threads) {
+            t.join();
+        }
+
+        for (ClientRunnable client : clients) {
+            if (client.getException() != null 
+                && client.getException().getMessage().contains("Timeout")) {
+                fail(client.getException().getMessage());
+            }
+        }
+    }
+
+    @Test
+    public void testTwoWayQueueRuntimeCorrelationDynamicPrefix() throws Exception {
+        QName serviceName = getServiceName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                 "HelloWorldServiceRuntimeCorrelationIDDynamicPrefix"));
+        
+        QName portName = getPortName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                               "HelloWorldPortRuntimeCorrelationIDDynamicPrefix"));
+        
+        URL wsdl = getClass().getResource("/wsdl/jms_test.wsdl");
+        assertNotNull(wsdl);
+
+        HelloWorldServiceRuntimeCorrelationIDDynamicPrefix service = 
+            new HelloWorldServiceRuntimeCorrelationIDDynamicPrefix(wsdl, serviceName);
+        assertNotNull(service);
+
+        Collection<Thread> threads = new ArrayList<Thread>();
+        Collection<ClientRunnable> clients = new ArrayList<ClientRunnable>();
+        
+        HelloWorldPortType port = service.getPort(portName, HelloWorldPortType.class);
+        
+        for (int i = 0; i < 100; ++i) {
+            ClientRunnable client =  
+                new ClientRunnable(port);
+            
+            Thread thread = new Thread(client);
+            threads.add(thread);
+            clients.add(client);
+            thread.start();
+        }
+    
+        for (Thread t : threads) {
+            t.join();
+        }
+
+        for (ClientRunnable client : clients) {
+            if (client.getException() != null) {
+                fail(client.getException().getMessage());            
+            }
+        }
+    }
+
     
     @Test
     public void testContextPropogation() throws Exception {

Modified: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/Server.java?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/Server.java (original)
+++ cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/Server.java Fri Feb 13 18:44:22 2009
@@ -26,13 +26,20 @@
 
 
     protected void run()  {
-        Object implementor = new GreeterImplTwoWayJMS();        
+        Object implementor = new GreeterImplTwoWayJMS();
         Object impl2 =  new GreeterImplQueueOneWay();
         Object impl3  = new GreeterImplTopicOneWay();
         Object impleDoc = new GreeterImplDoc();
         Object impl4 = new GreeterByteMessageImpl();
         Object impl5 =  new SoapService6SoapPort6Impl();
         Object impl6 = new JmsDestPubSubImpl();
+        Object i1 = new GreeterImplTwoWayJMSAppCorrelationIDNoPrefix();
+        Object i2 = new GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng();
+        Object i3 = new GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales();
+        Object i4 = new GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix();
+        Object i5 = new GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng();
+        Object i6 = new GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales();
+        
         
         Endpoint.publish(null, impleDoc);
         String address = "http://localhost:9000/SoapContext/SoapPort";
@@ -42,6 +49,12 @@
         Endpoint.publish("http://testaddr.not.required.byte/", impl4);
         Endpoint.publish("http://testaddr.not.required.jms/", impl5);
         Endpoint.publish("http://ignore", impl6);
+        Endpoint.publish("", i1);
+        Endpoint.publish("", i2);
+        Endpoint.publish("", i3);
+        Endpoint.publish("", i4);
+        Endpoint.publish("", i5);
+        Endpoint.publish("", i6);
     }
 
 

Modified: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java (original)
+++ cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java Fri Feb 13 18:44:22 2009
@@ -41,7 +41,7 @@
         MessageContext mc = wsContext.getMessageContext();
         JMSMessageHeadersType headers =
             (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_REQUEST_HEADERS);
-        System.out.println("get the message headers JMSCorrelationID" + headers.getJMSCorrelationID());
+        System.out.println("get the message headers JMSCorrelationID: " + headers.getJMSCorrelationID());
         System.out.println("Reached here :" + me);
         
         // set reply header custom property

Modified: cxf/branches/2.0.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl?rev=744216&r1=744215&r2=744216&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl (original)
+++ cxf/branches/2.0.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl Fri Feb 13 18:44:22 2009
@@ -350,6 +350,85 @@
            </port>
     </service>
     
+    <service name="HelloWorldServiceAppCorrelationIDStaticPrefix">
+        <port binding="tns:HelloWorldPortBinding" name="HelloWorldPortAppCorrelationIDStaticPrefixEng">
+               <jms:clientConfig conduitSelectorPrefix="com.mycompany.eng:"
+                                 useConduitIdSelector="false"/>
+               <jms:address
+                   jndiConnectionFactoryName="ConnectionFactory" 
+                   jndiDestinationName="dynamicQueues/test.jmstransport.text.app.correlation.id.static.prefix"
+                   jndiReplyDestinationName="dynamicQueues/test.jmstransport.text.app.correlation.id.static.prefix.reply">
+                   <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+               </jms:address>
+        </port>
+        <port binding="tns:HelloWorldPortBinding" name="HelloWorldPortAppCorrelationIDStaticPrefixSales">
+               <jms:clientConfig conduitSelectorPrefix="com.mycompany.sales:"
+                                 useConduitIdSelector="false"/>
+               <jms:address
+                   jndiConnectionFactoryName="ConnectionFactory" 
+                   jndiDestinationName="dynamicQueues/test.jmstransport.text.app.correlation.id.static.prefix"
+                   jndiReplyDestinationName="dynamicQueues/test.jmstransport.text.app.correlation.id.static.prefix.reply">
+                   <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+               </jms:address>
+        </port>
+    </service>
+    
+    <service name="HelloWorldServiceAppCorrelationIDNoPrefix">
+        <port binding="tns:HelloWorldPortBinding" name="HelloWorldPortAppCorrelationIDNoPrefix">
+            <jms:clientConfig clientReceiveTimeout = "5000"
+                              useConduitIdSelector="false"/>
+            <jms:address
+                   jndiConnectionFactoryName="ConnectionFactory" 
+                   jndiDestinationName="dynamicQueues/test.jmstransport.text.app.correlation.id.no.prefix"
+                   jndiReplyDestinationName="dynamicQueues/test.jmstransport.text.app.correlation.id.no.prefix.reply">
+                   <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+            </jms:address>
+        </port>
+    </service>
+
+    <service name="HelloWorldServiceRuntimeCorrelationIDStaticPrefix">
+       <port binding="tns:HelloWorldPortBinding" name="HelloWorldPortRuntimeCorrelationIDStaticPrefixEng">
+            <jms:clientConfig conduitSelectorPrefix="com.mycompany.eng:"
+                              useConduitIdSelector="true"/>
+            <jms:server messageSelector="JMSCorrelationID LIKE 'com.mycompany.eng:%'"/>   
+            <jms:address
+                   jndiConnectionFactoryName="ConnectionFactory" 
+                   jndiDestinationName="dynamicQueues/test.jmstransport.text.runtime.correlation.id.static.prefix"
+                   jndiReplyDestinationName="dynamicQueues/test.jmstransport.text.runtime.correlation.id.static.prefix.reply">
+                   <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+            </jms:address>
+        </port>
+       <port binding="tns:HelloWorldPortBinding" name="HelloWorldPortRuntimeCorrelationIDStaticPrefixSales">
+            <jms:clientConfig conduitSelectorPrefix="com.mycompany.sales:"
+                              useConduitIdSelector="true"/>
+            <jms:server messageSelector="JMSCorrelationID LIKE 'com.mycompany.sales:%'"/>   
+            <jms:address
+                   jndiConnectionFactoryName="ConnectionFactory" 
+                   jndiDestinationName="dynamicQueues/test.jmstransport.text.runtime.correlation.id.static.prefix"
+                   jndiReplyDestinationName="dynamicQueues/test.jmstransport.text.runtime.correlation.id.static.prefix.reply">
+                   <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+            </jms:address>
+        </port>
+    </service>
+
+    <service name="HelloWorldServiceRuntimeCorrelationIDDynamicPrefix">
+        <port binding="tns:HelloWorldPortBinding" name="HelloWorldPortRuntimeCorrelationIDDynamicPrefix">
+            <jms:clientConfig useConduitIdSelector="true"/>
+            <jms:address
+                   jndiConnectionFactoryName="ConnectionFactory" 
+                   jndiDestinationName="dynamicQueues/test.jmstransport.text.runtime.correlation.id.dynamic.prefix"
+                   jndiReplyDestinationName="dynamicQueues/test.jmstransport.text.runtime.correlation.id.dynamic.prefix.reply">
+                   <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+            </jms:address>
+        </port>
+    </service>
+    
     <service name="HelloWorldServiceLoop">
         <port binding="tns:HWStaticReplyQBinMsgBinding" name="HelloWorldPortLoop">
             <jms:address
@@ -459,7 +538,7 @@
             <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
         </port>
     </service>
-    
+
 </definitions>
 
 



Mime
View raw message