You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/02/13 17:55:23 UTC
svn commit: r744175 - in /cxf/trunk:
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/org/apache/cxf/sy...
Author: dkulp
Date: Fri Feb 13 16:55:22 2009
New Revision: 744175
URL: http://svn.apache.org/viewvc?rev=744175&view=rev
Log:
[CXF-2030] Fix issues with JMS and IBM MQ. Patch from Marat Bedretdinov applied.
Added:
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java (with props)
Modified:
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSUtilsTest.java
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/Server.java
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
cxf/trunk/testutils/src/main/resources/wsdl/jms_test.wsdl
Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java Fri Feb 13 16:55: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/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java Fri Feb 13 16:55: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/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java Fri Feb 13 16:55: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/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java Fri Feb 13 16:55: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/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java Fri Feb 13 16:55: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/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd (original)
+++ cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd Fri Feb 13 16:55: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/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java (original)
+++ cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java Fri Feb 13 16:55:22 2009
@@ -318,6 +318,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/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSUtilsTest.java?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSUtilsTest.java (original)
+++ cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSUtilsTest.java Fri Feb 13 16:55: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());
+ }
}
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java?rev=744175&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java Fri Feb 13 16:55:22 2009
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jms;
+
+import javax.jws.WebService;
+
+
+
+@WebService(serviceName = "HelloWorldServiceAppCorrelationIDNoPrefix",
+ portName = "HelloWorldPortAppCorrelationIDNoPrefix",
+ endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType",
+ targetNamespace = "http://cxf.apache.org/hello_world_jms",
+ wsdlLocation = "testutils/jms_test.wsdl")
+public class GreeterImplTwoWayJMSAppCorrelationIDNoPrefix extends TwoWayJMSImplBase {
+
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java?rev=744175&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java Fri Feb 13 16:55:22 2009
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jms;
+
+import javax.jws.WebService;
+
+
+
+@WebService(serviceName = "HelloWorldServiceAppCorrelationIDStaticPrefix",
+ portName = "HelloWorldPortAppCorrelationIDStaticPrefixEng",
+ endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType",
+ targetNamespace = "http://cxf.apache.org/hello_world_jms",
+ wsdlLocation = "testutils/jms_test.wsdl")
+public class GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng extends TwoWayJMSImplBase {
+
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java?rev=744175&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java Fri Feb 13 16:55:22 2009
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jms;
+
+import javax.jws.WebService;
+
+
+
+@WebService(serviceName = "HelloWorldServiceAppCorrelationIDStaticPrefix",
+ portName = "HelloWorldPortAppCorrelationIDStaticPrefixSales",
+ endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType",
+ targetNamespace = "http://cxf.apache.org/hello_world_jms",
+ wsdlLocation = "testutils/jms_test.wsdl")
+public class GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales extends TwoWayJMSImplBase {
+
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java?rev=744175&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java Fri Feb 13 16:55:22 2009
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jms;
+
+import javax.jws.WebService;
+
+
+
+@WebService(serviceName = "HelloWorldServiceRuntimeCorrelationIDDynamicPrefix",
+ portName = "HelloWorldPortRuntimeCorrelationIDDynamicPrefix",
+ endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType",
+ targetNamespace = "http://cxf.apache.org/hello_world_jms",
+ wsdlLocation = "testutils/jms_test.wsdl")
+public class GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix extends TwoWayJMSImplBase {
+
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java?rev=744175&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java Fri Feb 13 16:55:22 2009
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jms;
+
+import javax.jws.WebService;
+
+
+
+@WebService(serviceName = "HelloWorldServiceRuntimeCorrelationIDStaticPrefix",
+ portName = "HelloWorldPortRuntimeCorrelationIDStaticPrefixEng",
+ endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType",
+ targetNamespace = "http://cxf.apache.org/hello_world_jms",
+ wsdlLocation = "testutils/jms_test.wsdl")
+public class GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng extends TwoWayJMSImplBase {
+
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java?rev=744175&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java Fri Feb 13 16:55:22 2009
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.jms;
+
+import javax.jws.WebService;
+
+
+
+@WebService(serviceName = "HelloWorldServiceRuntimeCorrelationIDStaticPrefix",
+ portName = "HelloWorldPortRuntimeCorrelationIDStaticPrefixSales",
+ endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType",
+ targetNamespace = "http://cxf.apache.org/hello_world_jms",
+ wsdlLocation = "testutils/jms_test.wsdl")
+public class GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales extends TwoWayJMSImplBase {
+
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java Fri Feb 13 16:55: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/trunk/systests/src/test/java/org/apache/cxf/systest/jms/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/Server.java?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/Server.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/Server.java Fri Feb 13 16:55: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/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java Fri Feb 13 16:55: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/trunk/testutils/src/main/resources/wsdl/jms_test.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/resources/wsdl/jms_test.wsdl?rev=744175&r1=744174&r2=744175&view=diff
==============================================================================
--- cxf/trunk/testutils/src/main/resources/wsdl/jms_test.wsdl (original)
+++ cxf/trunk/testutils/src/main/resources/wsdl/jms_test.wsdl Fri Feb 13 16:55: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>