cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject git commit: Fixing bug in when using replyToDestination
Date Mon, 31 Mar 2014 11:26:20 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 70634720d -> 532c5a78a


Fixing bug in when using replyToDestination


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/532c5a78
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/532c5a78
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/532c5a78

Branch: refs/heads/master
Commit: 532c5a78ab6d398869bf36c00aeaaf3089ad2fd3
Parents: 7063472
Author: Christian Schneider <chris@die-schneider.net>
Authored: Mon Mar 31 13:26:07 2014 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Mon Mar 31 13:26:07 2014 +0200

----------------------------------------------------------------------
 .../apache/cxf/transport/jms/JMSConduit.java    |  64 +++++-----
 .../cxf/transport/jms/JMSConfiguration.java     |  15 ++-
 .../cxf/transport/jms/uri/JMSEndpoint.java      |   5 +
 .../MessageIdAsCorrelationIdJMSConduitTest.java |   1 +
 .../cxf/transport/jms/uri/JMSEndpointTest.java  |   3 +-
 .../jms/uri/URIConfiguredConduitTest.java       |   2 +
 .../jms/testsuite/services/TestSuiteServer.java | 119 +++++++------------
 .../testcases/SOAPJMSTestSuiteTest.java         |  12 +-
 .../cxf/jms/testsuite/util/JMSTestUtil.java     |  25 ++--
 .../apache/cxf/jms/testsuite/util/testcases.xml |  64 +++++-----
 10 files changed, 140 insertions(+), 170 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/532c5a78/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
index ddcc271..95d6d78 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
@@ -103,23 +103,23 @@ public class JMSConduit extends AbstractConduit implements JMSExchangeSender,
Me
     }
 
     private synchronized void getJMSListener(Destination replyTo) {
-        if (jmsListener == null) {
-            jmsListener = createListenerContainer(replyTo);
-            addBusListener();
+        if (jmsListener != null) {
+            return;
         }
-    }
-    
-    private JMSListenerContainer createListenerContainer(Destination destination) {
-        MessageListenerContainer container = new MessageListenerContainer(connection, destination,
-                                                                          this);
         String messageSelector = JMSFactory.getMessageSelector(jmsConfig, conduitId);
+        if (messageSelector == null && !jmsConfig.isPubSubDomain()) {
+            // Do not open listener without selector on a queue as we then can not share
the queue.
+            // An option for this might be a good idea for people who do not plan to share
queues.
+            return;
+        }
+        MessageListenerContainer container = new MessageListenerContainer(connection, replyTo,
this);
         container.setMessageSelector(messageSelector);
         Executor executor = JMSFactory.createExecutor(bus, "jms-conduit");
         container.setExecutor(executor);
         container.start();
-        return container;
+        jmsListener = container;
+        addBusListener();
     }
-
     
     /**
      * Send the JMS message and if the MEP is not oneway receive the response.
@@ -176,25 +176,30 @@ public class JMSConduit extends AbstractConduit implements JMSExchangeSender,
Me
             correlationMap.put(correlationId, exchange);
         }
         
-        Destination replyToDestination = jmsConfig.getReplyToDestination(session, headers.getJMSReplyTo());
-        String jmsMessageID = sendMessage(request, outMessage, replyToDestination, correlationId,
closer, session);
-        
-        boolean perMessageCorrelationId = correlationId == null || userCID != null;
-        if (correlationId == null) {
-            correlationId = jmsMessageID;
-            correlationMap.put(correlationId, exchange);
-        }
+        // Synchronize on exchange early to make sure we do not miss the notify 
+        synchronized (exchange) {
+            Destination replyToDestination = jmsConfig
+                .getReplyToDestination(session, headers.getJMSReplyTo());
+            String jmsMessageID = sendMessage(request, outMessage, replyToDestination, correlationId,
closer,
+                                              session);
+
+            boolean useSyncReceive = ((correlationId == null || userCID != null) &&
!jmsConfig.isPubSubDomain())
+                || !replyToDestination.equals(staticReplyDestination);
+            if (correlationId == null) {
+                correlationId = jmsMessageID;
+                correlationMap.put(correlationId, exchange);
+            }
 
-        if (exchange.isSynchronous()) {
-            if (perMessageCorrelationId) {
-                // TODO Not sure if replyToDestination is correct here
-                javax.jms.Message replyMessage = JMSUtil.receive(session, replyToDestination,
correlationId,
-                                                                 jmsConfig.getReceiveTimeout(),
-                                                                 jmsConfig.isPubSubNoLocal());
-                correlationMap.remove(correlationId);
-                processReplyMessage(exchange, replyMessage);
-            } else {
-                synchronized (exchange) {
+            if (exchange.isSynchronous()) {
+                if (useSyncReceive) {
+                    // TODO Not sure if replyToDestination is correct here
+                    javax.jms.Message replyMessage = JMSUtil.receive(session, replyToDestination,
+                                                                     correlationId,
+                                                                     jmsConfig.getReceiveTimeout(),
+                                                                     jmsConfig.isPubSubNoLocal());
+                    correlationMap.remove(correlationId);
+                    processReplyMessage(exchange, replyMessage);
+                } else {
                     try {
                         exchange.wait(jmsConfig.getReceiveTimeout());
                     } catch (InterruptedException e) {
@@ -204,6 +209,7 @@ public class JMSConduit extends AbstractConduit implements JMSExchangeSender,
Me
                         throw new RuntimeException("Timeout receiving message with correlationId
"
                                                    + correlationId);
                     }
+
                 }
             }
         }
@@ -257,7 +263,7 @@ public class JMSConduit extends AbstractConduit implements JMSExchangeSender,
Me
             return userCID;
         } else if (!jmsConfig.isSetConduitSelectorPrefix() && !jmsConfig.isReplyPubSubDomain()
                    && exchange.isSynchronous()
-                   && (!jmsConfig.isSetUseConduitIdSelector() || !jmsConfig.isUseConduitIdSelector()))
{
+                   && (!jmsConfig.isUseConduitIdSelector())) {
             // in this case the correlation id will be set to
             // the message id later
             return null;

http://git-wip-us.apache.org/repos/asf/cxf/blob/532c5a78/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
index af49c64..00328ef 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
@@ -76,7 +76,13 @@ public class JMSConfiguration {
     private String messageType = JMSConstants.TEXT_MESSAGE_TYPE;
     private boolean pubSubDomain;
     private boolean replyPubSubDomain;
-    private Boolean useConduitIdSelector;
+    
+    /**
+     *  Default to use conduitIdSelector as it allows to receive using a listener
+     *  which improves performance.
+     *  Set to false to use message id as correlation id for compatibility with IBM MQ.
+     */
+    private boolean useConduitIdSelector = true;
     private String conduitSelectorPrefix;
     private boolean jmsProviderTibcoEms;
 
@@ -318,16 +324,9 @@ public class JMSConfiguration {
     }
 
     public boolean isUseConduitIdSelector() {
-        if (useConduitIdSelector == null) {
-            return true;
-        }
         return useConduitIdSelector;
     }
 
-    public boolean isSetUseConduitIdSelector() {
-        return useConduitIdSelector != null;
-    }
-
     public boolean isReconnectOnException() {
         return reconnectOnException;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/532c5a78/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
index b75fdd8..7929e0a 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
@@ -401,6 +401,11 @@ public class JMSEndpoint {
     public boolean isUseConduitIdSelector() {
         return useConduitIdSelector;
     }
+    
+    public void setUseConduitIdSelector(String useConduitIdSelectorSt) {
+        this.useConduitIdSelector = Boolean.valueOf(useConduitIdSelectorSt);
+    }
+    
     public void setUseConduitIdSelector(boolean useConduitIdSelector) {
         this.useConduitIdSelector = useConduitIdSelector;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/532c5a78/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/MessageIdAsCorrelationIdJMSConduitTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/MessageIdAsCorrelationIdJMSConduitTest.java
b/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/MessageIdAsCorrelationIdJMSConduitTest.java
index af108d9..d542dd1 100644
--- a/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/MessageIdAsCorrelationIdJMSConduitTest.java
+++ b/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/MessageIdAsCorrelationIdJMSConduitTest.java
@@ -64,6 +64,7 @@ public class MessageIdAsCorrelationIdJMSConduitTest {
         JMSConfiguration jmsConfig = new JMSConfiguration();
         jmsConfig.setTargetDestination(SERVICE_QUEUE);
         jmsConfig.setConnectionFactory(connectionFactory);
+        jmsConfig.setUseConduitIdSelector(false);
         jmsConfig.setReplyDestination(replyDestination);
 
         JMSConduit conduit = new JMSConduit(target, jmsConfig, bus);

http://git-wip-us.apache.org/repos/asf/cxf/blob/532c5a78/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/JMSEndpointTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/JMSEndpointTest.java
b/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/JMSEndpointTest.java
index e61a1b3..fe90601 100644
--- a/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/JMSEndpointTest.java
+++ b/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/JMSEndpointTest.java
@@ -37,10 +37,11 @@ public class JMSEndpointTest extends Assert {
 
     @Test
     public void testQueueParameters() throws Exception {
-        JMSEndpoint endpoint = new JMSEndpoint("jms:queue:Foo.Bar?foo=bar&foo2=bar2");
+        JMSEndpoint endpoint = new JMSEndpoint("jms:queue:Foo.Bar?foo=bar&foo2=bar2&useConduitIdSelector=false");
         assertEquals(JMSEndpoint.QUEUE, endpoint.getJmsVariant());
         assertEquals(endpoint.getDestinationName(), "Foo.Bar");
         assertEquals(endpoint.getJmsVariant(), JMSEndpoint.QUEUE);
+        assertEquals(false, endpoint.isUseConduitIdSelector());
         assertEquals(endpoint.getParameters().size(), 2);
         assertEquals(endpoint.getParameter("foo"), "bar");
         assertEquals(endpoint.getParameter("foo2"), "bar2");

http://git-wip-us.apache.org/repos/asf/cxf/blob/532c5a78/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java
b/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java
index 033e7b9..360e9ba 100644
--- a/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java
+++ b/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java
@@ -64,6 +64,7 @@ public class URIConfiguredConduitTest {
                        "jms:jndi:dynamicQueues/"
                            + SERVICE_QUEUE
                            + "?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+                           + "&useConduitIdSelector=false"
                            + "&replyToName=dynamicQueues/testreply" 
                            + "&messageType=text"
                            + "&jndiConnectionFactoryName=ConnectionFactory"
@@ -73,6 +74,7 @@ public class URIConfiguredConduitTest {
     @Test
     public void testSendReceiveCFFromContext() throws Exception {
         sendAndReceive(SyncType.sync, "jms:queue:" + SERVICE_QUEUE + "?replyToName=testreply"
+                                      + "&useConduitIdSelector=false"
                                       + "&messageType=text" 
                                       + "&receiveTimeout=10000"
                                       + "&jndiConnectionFactoryName=ConnectionFactory");

http://git-wip-us.apache.org/repos/asf/cxf/blob/532c5a78/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/services/TestSuiteServer.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/services/TestSuiteServer.java
b/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/services/TestSuiteServer.java
index e68c71f..6ac4523 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/services/TestSuiteServer.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/services/TestSuiteServer.java
@@ -28,88 +28,45 @@ import org.apache.cxf.jms.testsuite.util.JMSTestUtil;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class TestSuiteServer extends AbstractBusTestServerBase {
+    
+    private static String jndiUrl;
+
     List<Endpoint> endpoints = new LinkedList<Endpoint>();
     protected void run() {
         setBus(BusFactory.getDefaultBus());
-        Test0001Impl t0001 = new Test0001Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0001").getAddress().trim(),
t0001));        
-        Test0101Impl t0101 = new Test0101Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0101").getAddress().trim(),
t0101));
-
-        Test0003Impl t0003 = new Test0003Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0003").getAddress().trim(),
t0003));
-        
-        Test0005Impl t0005 = new Test0005Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0005").getAddress().trim(),
t0005));
-        
-        Test0006Impl t0006 = new Test0006Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0006").getAddress().trim(),
t0006));
-        
-        Test0008Impl t0008 = new Test0008Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0008").getAddress().trim(),
t0008));
-        
-        Test0009Impl t0009 = new Test0009Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0009").getAddress().trim(),
t0009));
-        
-        Test0010Impl t0010 = new Test0010Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0010").getAddress().trim(),
t0010));
-        
-        Test0011Impl t0011 = new Test0011Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0011").getAddress().trim(),
t0011));
-        
-        Test0012Impl t0012 = new Test0012Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0012").getAddress().trim(),
t0012));
-        
-        Test0013Impl t0013 = new Test0013Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0013").getAddress().trim(),
t0013));
-        
-        Test0014Impl t0014 = new Test0014Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test0014").getAddress().trim(),
t0014));
-        
-        Test1001Impl t1001 = new Test1001Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1001").getAddress().trim(),
t1001));
-        
-        Test1002Impl t1002 = new Test1002Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1002").getAddress().trim(),
t1002));
-        
-        Test1003Impl t1003 = new Test1003Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1003").getAddress().trim(),
t1003));
-        
-        Test1004Impl t1004 = new Test1004Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1004").getAddress().trim(),
t1004));
-        
-        Test1006Impl t1006 = new Test1006Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1006").getAddress().trim(),
t1006));
-        
-        Test1007Impl t1007 = new Test1007Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1007").getAddress().trim(),
t1007));
-        
-        Test1008Impl t1008 = new Test1008Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1008").getAddress().trim(),
t1008));
-        
-        Test1101Impl t1101 = new Test1101Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1101").getAddress().trim(),
t1101));
-        
-        Test1102Impl t1102 = new Test1102Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1102").getAddress().trim(),
t1102));
-        
-        Test1103Impl t1103 = new Test1103Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1103").getAddress().trim(),
t1103));
-        
-        Test1104Impl t1104 = new Test1104Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1104").getAddress().trim(),
t1104));
-        
-        Test1105Impl t1105 = new Test1105Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1105").getAddress().trim(),
t1105));
-        
-        Test1106Impl t1106 = new Test1106Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1106").getAddress().trim(),
t1106));
-        
-        Test1107Impl t1107 = new Test1107Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1107").getAddress().trim(),
t1107));
-        
-        Test1108Impl t1108 = new Test1108Impl();
-        endpoints.add(Endpoint.publish(JMSTestUtil.getTestCase("test1108").getAddress().trim(),
t1108));
+        startEndpoint("test0001", new Test0001Impl());
+        startEndpoint("test0101", new Test0101Impl());
+        startEndpoint("test0003", new Test0003Impl());
+        startEndpoint("test0005", new Test0005Impl());
+        startEndpoint("test0006", new Test0006Impl());
+        startEndpoint("test0008", new Test0008Impl());
+        startEndpoint("test0009", new Test0009Impl());
+        startEndpoint("test0010", new Test0010Impl());
+        startEndpoint("test0011", new Test0011Impl());
+        startEndpoint("test0012", new Test0012Impl());
+        startEndpoint("test0013", new Test0013Impl());
+        startEndpoint("test0014", new Test0014Impl());
+        startEndpoint("test1001", new Test1001Impl());
+        startEndpoint("test1002", new Test1002Impl());
+        startEndpoint("test1003", new Test1003Impl());
+        startEndpoint("test1004", new Test1004Impl());
+        startEndpoint("test1006", new Test1006Impl());
+        startEndpoint("test1007", new Test1007Impl());
+        startEndpoint("test1008", new Test1008Impl());
+        startEndpoint("test1101", new Test1101Impl());
+        startEndpoint("test1102", new Test1102Impl());
+        startEndpoint("test1103", new Test1103Impl());
+        startEndpoint("test1104", new Test1104Impl());
+        startEndpoint("test1105", new Test1105Impl());
+        startEndpoint("test1106", new Test1106Impl());
+        startEndpoint("test1107", new Test1107Impl());
+        startEndpoint("test1108", new Test1108Impl());
+    }
+    
+    private void startEndpoint(String endpointName, Object testImpl) {
+        String partAddress = JMSTestUtil.getTestCase(endpointName).getAddress().trim();
+        String address = JMSTestUtil.getFullAddress(partAddress, jndiUrl);
+        endpoints.add(Endpoint.publish(address, testImpl));
     }
 
     public void tearDown() {
@@ -129,4 +86,8 @@ public class TestSuiteServer extends AbstractBusTestServerBase {
             System.out.println("done!");
         }
     }
+
+    public static void setJndiUrl(String jndiUrl) {
+        TestSuiteServer.jndiUrl = jndiUrl;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/532c5a78/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java
b/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java
index 502c268..dd0f628 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java
@@ -87,7 +87,7 @@ public class SOAPJMSTestSuiteTest extends AbstractBusClientServerTestBase
{
     public static void startServers() throws Exception {
         broker = new EmbeddedJMSBrokerLauncher();
         launchServer(broker);
-        JMSTestUtil.setJndiUrl(broker.getEncodedBrokerURL());
+        TestSuiteServer.setJndiUrl(broker.getBrokerURL());
         assertTrue("server did not launch correctly", launchServer(TestSuiteServer.class,
true));
         createStaticBus();
     }
@@ -582,9 +582,13 @@ public class SOAPJMSTestSuiteTest extends AbstractBusClientServerTestBase
{
         }
         if (requestHeader.getJMSCorrelationID() != null) {
             assertEquals(requestHeader.getJMSCorrelationID(), responseHeader.getJMSCorrelationID());
-        } else {
-            assertEquals(requestHeader.getJMSMessageID(), responseHeader.getJMSCorrelationID());
         }
+        // Correlation id should be the message id
+        /*
+         else {
+            assertEquals(requestHeader.getJMSCorrelationID(), responseHeader.getJMSCorrelationID());
+        }
+        */
     }
 
     private void checkJMSProperties(MessagePropertiesType messageProperties,
@@ -631,7 +635,7 @@ public class SOAPJMSTestSuiteTest extends AbstractBusClientServerTestBase
{
         String address = testcase.getAddress();
         
         EndpointInfo endpointInfo = new EndpointInfo();
-        endpointInfo.setAddress(address);
+        endpointInfo.setAddress(JMSTestUtil.getFullAddress(address, broker.getBrokerURL()));
         JMSConfiguration jmsConfig = JMSConfigFactory.createFromEndpointInfo(staticBus, endpointInfo
, null);
         
         ResourceCloser closer = new ResourceCloser();

http://git-wip-us.apache.org/repos/asf/cxf/blob/532c5a78/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
b/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
index d65bcc5..07dfc86 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
@@ -44,15 +44,19 @@ import org.apache.cxf.transport.jms.spec.JMSSpecConstants;
 public final class JMSTestUtil {
 
     private static TestCasesType testcases;
-    private static String jndiUrl;
 
     private JMSTestUtil() {
     }
     
-    public static void setJndiUrl(String jndiUrl) {
-        JMSTestUtil.jndiUrl = jndiUrl;
+    public static String getFullAddress(String partAddress, String jndiUrl) {
+        String separator = partAddress.contains("?") ? "&" : "?";
+        String address = partAddress + separator
+            + "&jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+            + "&jndiConnectionFactoryName=ConnectionFactory" 
+            + "&jndiURL=" + jndiUrl;
+        return address;
     }
-
+    
     public static List<TestCaseType> getTestCases() {
         try {
             if (testcases == null) {
@@ -85,19 +89,6 @@ public final class JMSTestUtil {
         JAXBElement<?> e = (JAXBElement<?>)unmarshaller.unmarshal(new JMSTestUtil().getClass()
             .getResource("/org/apache/cxf/jms/testsuite/util/testcases.xml"));
         testcases = (TestCasesType)e.getValue();
-        for (TestCaseType tct : testcases.getTestCase()) {
-            if (tct.isSetAddress()) {
-                String add = tct.getAddress();
-                int idx = add.indexOf("jndiURL=");
-                if (idx != -1) {
-                    int idx2 = add.indexOf("&", idx);
-                    add = add.substring(0, idx)
-                        + "jndiURL=" + jndiUrl
-                        + (idx2 == -1 ? "" : add.substring(idx2));
-                    tct.setAddress(add);
-                }
-            }
-        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/532c5a78/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/testcases.xml
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/testcases.xml
b/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/testcases.xml
index 6c9f382..a31ec20 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/testcases.xml
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/testcases.xml
@@ -17,7 +17,7 @@
         -->
 <testCases xmlns="http://cxf.apache.org/jms/testcase/">
     <testCase id="test0001" mep="inonly">
-        <address>jms:jndi:dynamicQueues/testqueue0001?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0001</address>
         <requestMessage>
             <messageType>byte</messageType>
             <deliveryMode>2</deliveryMode>
@@ -37,7 +37,7 @@
         </requestMessage>
     </testCase>
     <testCase id="test0002" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0001?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0001</address>
         <requestMessage>
             <messageType>byte</messageType>
             <deliveryMode>2</deliveryMode>
@@ -72,7 +72,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0101" mep="inonly">
-        <address>jms:jndi:dynamicQueues/testqueue0101?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0101</address>
         <requestMessage>
             <messageType>byte</messageType>
             <deliveryMode>2</deliveryMode>
@@ -92,7 +92,7 @@
         </requestMessage>
     </testCase>
     <testCase id="test0102" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0101?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0101</address>
         <requestMessage>
             <messageType>byte</messageType>
             <deliveryMode>2</deliveryMode>
@@ -128,7 +128,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0003" mep="inonly">
-        <address>jms:jndi:dynamicQueues/testqueue0003?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0003</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -148,7 +148,7 @@
         </requestMessage>
     </testCase>
     <testCase id="test0004" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0003?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0003</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -184,7 +184,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0005" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0005?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500&amp;targetService=EchoPort&amp;deliveryMode=NON_PERSISTENT&amp;timeToLive=3600000&amp;priority=5&amp;replyToName=dynamicQueues/replyqueue0005</address>
+        <address>jms:jndi:dynamicQueues/testqueue0005?targetService=EchoPort&amp;deliveryMode=NON_PERSISTENT&amp;timeToLive=3600000&amp;priority=5&amp;replyToName=dynamicQueues/replyqueue0005</address>
         <requestMessage>
             <deliveryMode>1</deliveryMode>
             <priority>5</priority>
@@ -197,7 +197,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0006" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0006?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0006</address>
         <requestMessage>
             <deliveryMode>1</deliveryMode>
             <priority>6</priority>
@@ -210,7 +210,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0008" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0008?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0008?useConduitIdSelector=false</address>
         <requestMessage>
             <deliveryMode>1</deliveryMode>
             <priority>8</priority>
@@ -223,7 +223,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0009" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0009?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500&amp;targetService=EchoPort&amp;deliveryMode=PERSISTENT&amp;timeToLive=3600000&amp;priority=1&amp;replyToName=dynamicQueues/replyqueue00091</address>
+        <address>jms:jndi:dynamicQueues/testqueue0009?targetService=EchoPort&amp;deliveryMode=PERSISTENT&amp;timeToLive=3600000&amp;priority=1&amp;replyToName=dynamicQueues/replyqueue00091</address>
         <requestMessage>
             <deliveryMode>1</deliveryMode>
             <priority>3</priority>
@@ -236,7 +236,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0010" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0010?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500&amp;deliveryMode=PERSISTENT&amp;timeToLive=3600000&amp;priority=1&amp;replyToName=dynamicQueues/replyqueue00101</address>
+        <address>jms:jndi:dynamicQueues/testqueue0010?deliveryMode=PERSISTENT&amp;timeToLive=3600000&amp;priority=1&amp;replyToName=dynamicQueues/replyqueue00101</address>
         <requestMessage>
             <deliveryMode>2</deliveryMode>
             <priority>1</priority>
@@ -249,7 +249,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0011" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0011?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500&amp;deliveryMode=PERSISTENT&amp;timeToLive=3600000&amp;priority=1&amp;replyToName=dynamicQueues/replyqueue00111&amp;deliveryMode=NON_PERSISTENT&amp;timeToLive=7200000&amp;priority=2&amp;replyToName=dynamicQueues/replyqueue00112</address>
+        <address>jms:jndi:dynamicQueues/testqueue0011?deliveryMode=PERSISTENT&amp;timeToLive=3600000&amp;priority=1&amp;replyToName=dynamicQueues/replyqueue00111&amp;deliveryMode=NON_PERSISTENT&amp;timeToLive=7200000&amp;priority=2&amp;replyToName=dynamicQueues/replyqueue00112</address>
         <requestMessage>
             <deliveryMode>1</deliveryMode>
             <priority>2</priority>
@@ -262,7 +262,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0012" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0012?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0012</address>
         <requestMessage>
             <deliveryMode>2</deliveryMode>
             <priority>4</priority>
@@ -274,7 +274,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0013" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0013?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0013</address>
         <requestMessage>
             <deliveryMode>2</deliveryMode>
             <priority>5</priority>
@@ -286,7 +286,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test0014" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue0014?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue0014</address>
         <requestMessage>
             <deliveryMode>2</deliveryMode>
             <priority>5</priority>
@@ -298,7 +298,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1001" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1001?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1001</address>
         <requestMessage>
             <messageType>byte</messageType>
             <deliveryMode>2</deliveryMode>
@@ -335,7 +335,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1002" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1002?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1002</address>
         <requestMessage>
             <messageType>stream</messageType>
             <deliveryMode>2</deliveryMode>
@@ -371,7 +371,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1003" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1003?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1003</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -408,7 +408,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1004" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1004?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1004</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -445,7 +445,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1006" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1006?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1006</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -482,7 +482,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1007" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1007?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1007</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -518,7 +518,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1008" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1008?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1008</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -555,7 +555,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1009" mep="inout">
-        <address>jms:XXXX:dynamicQueues/testqueue1009?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:XXXX:dynamicQueues/testqueue1009</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -592,7 +592,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1101" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1101?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1101</address>
         <requestMessage>
             <messageType>byte</messageType>
             <deliveryMode>2</deliveryMode>
@@ -629,7 +629,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1102" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1102?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1102</address>
         <requestMessage>
             <messageType>stream</messageType>
             <deliveryMode>2</deliveryMode>
@@ -666,7 +666,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1103" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1103?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1103</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -703,7 +703,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1104" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1104?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1104</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -739,7 +739,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1105" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1105?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1105</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -775,7 +775,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1106" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1106?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1106</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -812,7 +812,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1107" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1107?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1107</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -848,7 +848,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1108" mep="inout">
-        <address>jms:jndi:dynamicQueues/testqueue1108?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:jndi:dynamicQueues/testqueue1108</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>
@@ -885,7 +885,7 @@
         </responseMessage>
     </testCase>
     <testCase id="test1109" mep="inout">
-        <address>jms:XXXX:dynamicQueues/testqueue1109?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+        <address>jms:XXXX:dynamicQueues/testqueue1109</address>
         <requestMessage>
             <messageType>text</messageType>
             <deliveryMode>2</deliveryMode>


Mime
View raw message