Author: ningjiang
Date: Fri Apr 30 09:19:04 2010
New Revision: 939594
URL: http://svn.apache.org/viewvc?rev=939594&view=rev
Log:
CXF-2760 implement useMessageIDAsCorrelationID for JMS Client by applying patch
with thanks to Seumas
Added:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPool.java
(with props)
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPoolableObjectFactory.java
(with props)
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/HelloWorldMessageIDAsCorrelationIDAsyncServiceImpl.java
(with props)
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/SoapService7SoapPort7Impl.java
(with props)
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test-binding.xml
(with props)
Modified:
cxf/branches/2.2.x-fixes/rt/transports/jms/pom.xml
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/Server.java
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl
Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/pom.xml
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/pom.xml?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/pom.xml (original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/pom.xml Fri Apr 30 09:19:04 2010
@@ -95,7 +95,6 @@
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.5.2</version>
- <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Modified:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
Fri Apr 30 09:19:04 2010
@@ -76,6 +76,8 @@ public class JMSConduit extends Abstract
private AtomicLong messageCount;
private JMSBusLifeCycleListener listener;
private Bus bus;
+ private JMSListenerPool listenerPool;
+ private final Map<String, AbstractMessageListenerContainer> listenerMap;
public JMSConduit(EndpointInfo endpointInfo,
EndpointReferenceType target,
@@ -88,6 +90,9 @@ public class JMSConduit extends Abstract
correlationMap = new ConcurrentHashMap<String, Exchange>();
conduitId = UUID.randomUUID().toString().replaceAll("-", "");
messageCount = new AtomicLong(0);
+ listenerPool = new JMSListenerPool(new
JMSListenerPoolableObjectFactory(jmsConfig,
+ this));
+ listenerMap = new ConcurrentHashMap<String,
AbstractMessageListenerContainer>();
}
/**
@@ -158,45 +163,75 @@ public class JMSConduit extends Abstract
final JmsTemplate jmsTemplate =
JMSFactory.createJmsTemplate(jmsConfig, headers);
String userCID = headers != null ? headers.getJMSCorrelationID() :
null;
AbstractMessageListenerContainer jmsList = jmsListener;
+
+ javax.jms.Destination replyTo = null;
+
if (!exchange.isOneWay()) {
- if (userCID == null || !jmsConfig.isUseConduitIdSelector()) {
+ if (jmsConfig.isUseMessageIDAsCorrelationID()) {
+ if (!exchange.isSynchronous()) {
+ try {
+ jmsList =
(AbstractMessageListenerContainer)listenerPool.borrowObject();
+ } catch (Exception ex) {
+ LOG.log(Level.SEVERE, "Failed to obtain listener from
pool: " + ex);
+ throw new RuntimeException("Failed to obtain listener
from pool.", ex);
+ }
+
+ replyTo = jmsList.getDestination();
+ } else {
+ String replyToName = jmsConfig.getReplyDestination();
+ replyTo =
+ JMSFactory.resolveOrCreateDestination(jmsTemplate,
+ replyToName,
+
jmsConfig.isPubSubDomain());
+ }
+ } else if (userCID == null || !jmsConfig.isUseConduitIdSelector())
{
jmsList = getJMSListener();
+ replyTo = jmsList.getDestination();
} else {
jmsList = getAllListener();
+ replyTo = jmsList.getDestination();
}
- }
-
- final javax.jms.Destination replyTo = exchange.isOneWay() ? null :
jmsList.getDestination();
+ }
- final String correlationId = (headers != null &&
headers.isSetJMSCorrelationID())
+ String correlationId = (headers != null &&
headers.isSetJMSCorrelationID())
? headers.getJMSCorrelationID()
:
JMSUtils.createCorrelationId(jmsConfig.getConduitSelectorPrefix() + conduitId,
messageCount.incrementAndGet());
- MessageCreator messageCreator = new MessageCreator() {
+ if (jmsConfig.isUseMessageIDAsCorrelationID()) {
+ correlationId = null;
+ }
+
+ if (exchange.isOneWay() && !jmsConfig.isEnforceSpec() &&
isSetReplyTo(outMessage)) {
+ String replyToName = (headers != null) ? headers.getJMSReplyTo() :
null;
+ if (replyToName == null && jmsConfig.getReplyDestination() !=
null) {
+ replyToName = jmsConfig.getReplyDestination();
+ }
+ if (replyToName != null) {
+ replyTo =
+ JMSFactory.resolveOrCreateDestination(jmsTemplate,
+ replyToName,
+
jmsConfig.isPubSubDomain());
+ }
+ }
+
+ final Destination replyToDestination = replyTo;
+ final String cid = correlationId;
+
+ class JMSConduitMessageCreator implements MessageCreator {
+ javax.jms.Message jmsMessage;
+
public javax.jms.Message createMessage(Session session) throws
JMSException {
String messageType = jmsConfig.getMessageType();
- final javax.jms.Message jmsMessage;
- Destination replyToDestination = replyTo;
- if (exchange.isOneWay() && !jmsConfig.isEnforceSpec() &&
isSetReplyTo(outMessage)) {
- String replyToName = (headers != null) ?
headers.getJMSReplyTo() : null;
- if (replyToName == null && jmsConfig.getReplyDestination()
!= null) {
- replyToName = jmsConfig.getReplyDestination();
- }
- if (replyToName != null) {
- replyToDestination =
- JMSFactory.resolveOrCreateDestination(jmsTemplate,
- replyToName,
-
jmsConfig.isPubSubDomain());
- }
- }
jmsMessage =
JMSUtils.buildJMSMessageFromCXFMessage(outMessage, request,
messageType, session, replyToDestination,
-
correlationId);
+ cid);
LOG.log(Level.FINE, "client sending request: ", jmsMessage);
return jmsMessage;
}
- };
+ }
+
+ JMSConduitMessageCreator messageCreator = new
JMSConduitMessageCreator();
/**
* If the message is not oneWay we will expect to receive a reply on
the listener. To receive this
@@ -205,20 +240,35 @@ public class JMSConduit extends Abstract
*/
if (!exchange.isOneWay()) {
synchronized (exchange) {
- correlationMap.put(correlationId, exchange);
+ if (correlationId != null) {
+ correlationMap.put(correlationId, exchange);
+ }
jmsTemplate.send(jmsConfig.getTargetDestination(),
messageCreator);
- if (exchange.isSynchronous()) {
+ if (jmsConfig.isUseMessageIDAsCorrelationID()) {
try {
- exchange.wait(jmsTemplate.getReceiveTimeout());
- } catch (InterruptedException e) {
- correlationMap.remove(correlationId);
- throw new RuntimeException(e);
+ correlationId =
messageCreator.jmsMessage.getJMSMessageID();
+ handleMessageIDAsCorrelationID(correlationId,
+ exchange,
+ jmsTemplate,
+ replyTo,
+ jmsList);
+ } catch (JMSException jmsex) {
+ throw JmsUtils.convertJmsAccessException(jmsex);
}
- correlationMap.remove(correlationId);
- if (exchange.get(CORRELATED) == null) {
- throw new RuntimeException("Timeout receiving message
with correlationId "
- + correlationId);
+ } else {
+ if (exchange.isSynchronous()) {
+ try {
+ exchange.wait(jmsTemplate.getReceiveTimeout());
+ } catch (InterruptedException e) {
+ correlationMap.remove(correlationId);
+ throw new RuntimeException(e);
+ }
+ correlationMap.remove(correlationId);
+ if (exchange.get(CORRELATED) == null) {
+ throw new RuntimeException("Timeout receiving
message with correlationId "
+ + correlationId);
+ }
}
}
}
@@ -227,6 +277,33 @@ public class JMSConduit extends Abstract
}
}
+ private void handleMessageIDAsCorrelationID(String correlationId,
+ Exchange exchange,
+ JmsTemplate jmsTemplate,
+ Destination replyTo,
+
AbstractMessageListenerContainer poolListener) {
+ String messageSelector = "JMSCorrelationID='" + correlationId + "'";
+ if (exchange.isSynchronous()) {
+ javax.jms.Message message =
+ jmsTemplate.receiveSelected(replyTo, messageSelector);
+ if (message != null) {
+ handleMessage(exchange, message);
+ } else {
+ throw new RuntimeException("Timeout receiving message with
correlationId "
+ + correlationId);
+ }
+ } else {
+ correlationMap.put(correlationId, exchange);
+ poolListener.setMessageSelector("JMSCorrelationID='" +
correlationId + "'");
+
+ if (!poolListener.isActive()) {
+ poolListener.initialize();
+ }
+
+ listenerMap.put(correlationId, poolListener);
+ }
+ }
+
static class JMSBusLifeCycleListener implements BusLifeCycleListener {
final WeakReference<JMSConduit> ref;
BusLifeCycleManager blcm;
@@ -280,11 +357,26 @@ public class JMSConduit extends Abstract
throw JmsUtils.convertJmsAccessException(e);
}
+ AbstractMessageListenerContainer poolListener =
listenerMap.remove(correlationId);
+
+ if (poolListener != null) {
+ try {
+ listenerPool.returnObject(poolListener);
+ } catch (Exception ex) {
+ LOG.log(Level.WARNING, "Could not return listener to pool: " +
ex);
+ }
+ }
+
Exchange exchange = correlationMap.remove(correlationId);
if (exchange == null) {
LOG.log(Level.WARNING, "Could not correlate message with
correlationId " + correlationId);
return;
}
+
+ handleMessage(exchange, jmsMessage);
+ }
+
+ private void handleMessage(Exchange exchange, javax.jms.Message
jmsMessage) {
Message inMessage = new MessageImpl();
exchange.setInMessage(inMessage);
LOG.log(Level.FINE, "client received reply: ", jmsMessage);
@@ -313,6 +405,16 @@ public class JMSConduit extends Abstract
}
public synchronized void close() {
+ if (listenerPool != null) {
+ try {
+ listenerPool.close();
+ } catch (Exception ex) {
+ LOG.log(Level.WARNING, "Failed to close JMSListener pool: " +
ex);
+ } finally {
+ listenerPool = null;
+ }
+ }
+
if (listener != null) {
listener.unreg();
listener = null;
Modified:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
Fri Apr 30 09:19:04 2010
@@ -88,6 +88,7 @@ public class JMSConfiguration implements
private String cacheLevelName;
private boolean enforceSpec = true;
private boolean acceptMessagesWhileStopping;
+ private boolean useMessageIDAsCorrelationID;
private boolean jmsProviderTibcoEms;
private ConnectionFactory wrappedConnectionFactory;
@@ -507,4 +508,12 @@ public class JMSConfiguration implements
public void setJmsProviderTibcoEms(boolean jmsProviderTibcoEms) {
this.jmsProviderTibcoEms = jmsProviderTibcoEms;
}
+
+ public boolean isUseMessageIDAsCorrelationID() {
+ return this.useMessageIDAsCorrelationID;
+ }
+
+ public void setUseMessageIDAsCorrelationID(boolean
useMessageIDAsCorrelationID) {
+ this.useMessageIDAsCorrelationID = useMessageIDAsCorrelationID;
+ }
}
Added:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPool.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPool.java?rev=939594&view=auto
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPool.java
(added)
+++
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPool.java
Fri Apr 30 09:19:04 2010
@@ -0,0 +1,28 @@
+/**
+ * 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.transport.jms;
+
+import org.apache.commons.pool.impl.GenericObjectPool;
+
+public class JMSListenerPool extends GenericObjectPool {
+ public JMSListenerPool(JMSListenerPoolableObjectFactory pof) {
+ super(pof);
+ }
+}
Propchange:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPool.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPool.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPoolableObjectFactory.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPoolableObjectFactory.java?rev=939594&view=auto
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPoolableObjectFactory.java
(added)
+++
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPoolableObjectFactory.java
Fri Apr 30 09:19:04 2010
@@ -0,0 +1,68 @@
+/**
+ * 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.transport.jms;
+
+import javax.jms.MessageListener;
+
+import org.apache.commons.pool.PoolableObjectFactory;
+import org.springframework.jms.listener.DefaultMessageListenerContainer;
+
+public class JMSListenerPoolableObjectFactory implements PoolableObjectFactory
{
+ private JMSConfiguration jmsConfig;
+ private MessageListener handler;
+ public JMSListenerPoolableObjectFactory(JMSConfiguration jmsConfig,
+ MessageListener handler) {
+ this.jmsConfig = jmsConfig;
+ this.handler = handler;
+ }
+
+ public void activateObject(Object obj) throws Exception {
+ DefaultMessageListenerContainer listener =
(DefaultMessageListenerContainer)obj;
+ listener.start();
+ }
+
+ public void destroyObject(Object obj) throws Exception {
+ DefaultMessageListenerContainer listener =
(DefaultMessageListenerContainer)obj;
+ listener.destroy();
+ }
+
+ public Object makeObject() throws Exception {
+ Object obj = JMSFactory.createJmsListener(jmsConfig,
+ handler,
+
jmsConfig.getReplyDestination(),
+ null,
+ false);
+ DefaultMessageListenerContainer listener =
(DefaultMessageListenerContainer)obj;
+ listener.setCacheLevel(DefaultMessageListenerContainer.CACHE_SESSION);
+
+ return listener;
+ }
+
+ public void passivateObject(Object obj) throws Exception {
+ DefaultMessageListenerContainer listener =
(DefaultMessageListenerContainer)obj;
+ listener.stop();
+ }
+
+ public boolean validateObject(Object obj) {
+ DefaultMessageListenerContainer listener =
(DefaultMessageListenerContainer)obj;
+
+ return listener.isActive();
+ }
+}
Propchange:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPoolableObjectFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSListenerPoolableObjectFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
Fri Apr 30 09:19:04 2010
@@ -105,6 +105,8 @@ public class JMSOldConfigHolder {
jmsConfig.setConduitSelectorPrefix(clientConfig.getConduitSelectorPrefix());
}
jmsConfig.setEnforceSpec(clientConfig.isEnforceSpec());
+
jmsConfig.setUseMessageIDAsCorrelationID(clientConfig.isSetUseMessageIDAsCorrelationID());
+
jmsConfig.setSubscriptionDurable(serverBehavior.isSetDurableSubscriberName());
jmsConfig.setDurableSubscriptionName(serverBehavior.getDurableSubscriberName());
jmsConfig.setDurableSubscriptionClientId(serverConfig.getDurableSubscriptionClientId());
@@ -135,7 +137,7 @@ public class JMSOldConfigHolder {
// Use the default dynamic destination resolver
jmsConfig.setTargetDestination(address.getJmsDestinationName());
jmsConfig.setReplyDestination(address.getJmsReplyDestinationName());
- }
+ }
}
return jmsConfig;
}
Modified:
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
(original)
+++
cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
Fri Apr 30 09:19:04 2010
@@ -60,6 +60,7 @@
<xs:attribute name="conduitSelectorPrefix" type="xs:string"
use="optional" default=""/>
<xs:attribute name="useConduitIdSelector"
type="pt:ParameterizedBoolean" use="optional"/>
<xs:attribute name="enforceSpec"
type="pt:ParameterizedBoolean" use="optional" default="true"/>
+ <xs:attribute name="useMessageIDAsCorrelationID"
type="xs:boolean" use="optional" default="false"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Added:
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/HelloWorldMessageIDAsCorrelationIDAsyncServiceImpl.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/HelloWorldMessageIDAsCorrelationIDAsyncServiceImpl.java?rev=939594&view=auto
==============================================================================
---
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/HelloWorldMessageIDAsCorrelationIDAsyncServiceImpl.java
(added)
+++
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/HelloWorldMessageIDAsCorrelationIDAsyncServiceImpl.java
Fri Apr 30 09:19:04 2010
@@ -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 = "HelloWorldMessageIDAsCorrelationIDAsyncService",
+ portName = "HelloWorldMessageIDAsCorrelationIDAsyncPort",
+ endpointInterface =
"org.apache.cxf.hello_world_jms.HelloWorldPortType",
+ targetNamespace = "http://cxf.apache.org/hello_world_jms",
+ wsdlLocation = "/wsdl/jms_test.wsdl")
+
+public class HelloWorldMessageIDAsCorrelationIDAsyncServiceImpl extends
TwoWayJMSImplBase {
+
+}
Propchange:
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/HelloWorldMessageIDAsCorrelationIDAsyncServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/HelloWorldMessageIDAsCorrelationIDAsyncServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified:
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
(original)
+++
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
Fri Apr 30 09:19:04 2010
@@ -25,13 +25,17 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
+import javax.xml.ws.AsyncHandler;
import javax.xml.ws.Binding;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Endpoint;
import javax.xml.ws.Holder;
+import javax.xml.ws.Response;
import javax.xml.ws.soap.SOAPBinding;
@@ -39,6 +43,7 @@ import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.hello_world_jms.BadRecordLitFault;
import org.apache.cxf.hello_world_jms.HWByteMsgService;
+import
org.apache.cxf.hello_world_jms.HelloWorldMessageIDAsCorrelationIDAsyncService;
import org.apache.cxf.hello_world_jms.HelloWorldOneWayPort;
import org.apache.cxf.hello_world_jms.HelloWorldOneWayQueueService;
import org.apache.cxf.hello_world_jms.HelloWorldPortType;
@@ -66,6 +71,7 @@ import org.apache.cxf.transport.jms.JMSP
import org.apache.hello_world_doc_lit.Greeter;
import org.apache.hello_world_doc_lit.PingMeFault;
import org.apache.hello_world_doc_lit.SOAPService2;
+import org.apache.hello_world_doc_lit.SOAPService7;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -86,7 +92,7 @@ public class JMSClientServerTest extends
launchServer(EmbeddedJMSBrokerLauncher.class, props, null));
assertTrue("server did not launch correctly",
- launchServer(Server.class, false));
+ launchServer(Server.class, true));
}
public URL getWSDLURL(String s) throws Exception {
@@ -875,4 +881,147 @@ public class JMSClientServerTest extends
assertEquals("The response file is not same with the sent file.",
size, bytes.length);
}
+
+ @Test
+ //@Ignore
+ public void useMessageIDAsCorrelationIDTest() throws Exception {
+ QName serviceName = getServiceName(new
QName("http://apache.org/hello_world_doc_lit",
+ "SOAPService7"));
+ QName portName = getPortName(new
QName("http://apache.org/hello_world_doc_lit", "SoapPort7"));
+ URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPService7 service = new SOAPService7(wsdl, serviceName);
+ Greeter greeter = service.getPort(portName, Greeter.class);
+
+ Collection<Thread> threads = new ArrayList<Thread>();
+ Collection<GreeterClientRunnable> clients = new
ArrayList<GreeterClientRunnable>();
+
+ for (int i = 0; i < 100; ++i) {
+ GreeterClientRunnable client = new GreeterClientRunnable(greeter,
i);
+
+ Thread thread = new Thread(client);
+ threads.add(thread);
+ clients.add(client);
+ thread.start();
+ }
+
+ for (Thread t : threads) {
+ t.join();
+ }
+
+ for (GreeterClientRunnable client : clients) {
+ if (client.getException() != null) {
+ fail(client.getException().getMessage());
+ }
+ }
+ }
+
+ private static class GreeterClientRunnable implements Runnable {
+ private Greeter port;
+ private int client;
+ private Throwable ex;
+
+ public GreeterClientRunnable(Greeter port, int client) {
+ this.port = port;
+ this.client = client;
+ }
+
+ public Throwable getException() {
+ return ex;
+ }
+
+ public void run() {
+ try {
+ for (int idx = 0; idx < 5; idx++) {
+ String request = "Message: " + idx + " from Client: " +
client;
+ String expected = "Hello " + request;
+ String response = port.greetMe(request);
+ //System.out.println("RESPONSE: " + response);
+ assertEquals("Response didn't match expected request",
expected, response);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
+ ex = e;
+ }
+ }
+ }
+
+ @Test
+ public void testAsyncCall() throws Exception {
+ QName serviceName = getServiceName(new
QName("http://cxf.apache.org/hello_world_jms",
+ "HelloWorldMessageIDAsCorrelationIDAsyncService"));
+ QName portName = getPortName(new
QName("http://cxf.apache.org/hello_world_jms",
+
"HelloWorldMessageIDAsCorrelationIDAsyncPort"));
+ URL wsdl = getWSDLURL("/wsdl/jms_test.wsdl");
+ assertNotNull(wsdl);
+
+ HelloWorldMessageIDAsCorrelationIDAsyncService service =
+ new HelloWorldMessageIDAsCorrelationIDAsyncService(wsdl,
serviceName);
+ assertNotNull(service);
+ HelloWorldPortType greeter = service.getPort(portName,
HelloWorldPortType.class);
+ final Thread thread = Thread.currentThread();
+
+ class TestAsyncHandler implements AsyncHandler<String> {
+ String expected;
+
+ public TestAsyncHandler(String x) {
+ expected = x;
+ }
+
+ public String getExpected() {
+ return expected;
+ }
+ public void handleResponse(Response<String> response) {
+ try {
+ Thread thread2 = Thread.currentThread();
+ assertNotSame(thread, thread2);
+ assertEquals("Hello " + expected, response.get());
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (ExecutionException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ TestAsyncHandler h1 = new TestAsyncHandler("Homer");
+ TestAsyncHandler h2 = new TestAsyncHandler("Maggie");
+ TestAsyncHandler h3 = new TestAsyncHandler("Bart");
+ TestAsyncHandler h4 = new TestAsyncHandler("Lisa");
+ TestAsyncHandler h5 = new TestAsyncHandler("Marge");
+
+ Future<?> f1 = greeter.greetMeAsync("Santa's Little Helper",
+ new TestAsyncHandler("Santa's
Little Helper"));
+ f1.get();
+ f1 = greeter.greetMeAsync("PauseForTwoSecs Santa's Little Helper",
+ new TestAsyncHandler("Santa's Little
Helper"));
+ long start = System.currentTimeMillis();
+ f1 = greeter.greetMeAsync("PauseForTwoSecs " + h1.getExpected(), h1);
+ Future<?> f2 = greeter.greetMeAsync("PauseForTwoSecs " +
h2.getExpected(), h2);
+ Future<?> f3 = greeter.greetMeAsync("PauseForTwoSecs " +
h3.getExpected(), h3);
+ Future<?> f4 = greeter.greetMeAsync("PauseForTwoSecs " +
h4.getExpected(), h4);
+ Future<?> f5 = greeter.greetMeAsync("PauseForTwoSecs " +
h5.getExpected(), h5);
+
+ long mid = System.currentTimeMillis();
+ assertEquals("Hello " + h1.getExpected(), f1.get());
+ assertEquals("Hello " + h2.getExpected(), f2.get());
+ assertEquals("Hello " + h3.getExpected(), f3.get());
+ assertEquals("Hello " + h4.getExpected(), f4.get());
+ assertEquals("Hello " + h5.getExpected(), f5.get());
+ long end = System.currentTimeMillis();
+
+ assertTrue("Time too long: " + (mid - start), (mid - start) < 1000);
+ assertTrue((end - mid) > 1000);
+ f1 = null;
+ f2 = null;
+ f3 = null;
+ f4 = null;
+ f5 = null;
+
+ greeter = null;
+ service = null;
+
+ System.gc();
+ }
+
}
Modified:
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/Server.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/Server.java?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/Server.java
(original)
+++
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/Server.java
Fri Apr 30 09:19:04 2010
@@ -36,6 +36,7 @@ public class Server extends AbstractBusT
Object impl4 = new GreeterByteMessageImpl();
Object impl5 = new SoapService6SoapPort6Impl();
Object impl6 = new JmsDestPubSubImpl();
+ Object impl7 = new SoapService7SoapPort7Impl();
Object i1 = new GreeterImplTwoWayJMSAppCorrelationIDNoPrefix();
Object i2 = new GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng();
Object i3 = new
GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales();
@@ -44,6 +45,7 @@ public class Server extends AbstractBusT
Object i6 = new
GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales();
Object i7 = new GreeterImplTwoWayJMSAppCorrelationIDEng();
Object i8 = new GreeterImplTwoWayJMSAppCorrelationIDSales();
+ Object i9 = new HelloWorldMessageIDAsCorrelationIDAsyncServiceImpl();
Object mtom = new JMSMTOMImpl();
Endpoint.publish(null, impleDoc);
@@ -54,6 +56,7 @@ public class Server extends AbstractBusT
Endpoint.publish("http://testaddr.not.required.byte/", impl4);
Endpoint.publish("http://testaddr.not.required.jms/", impl5);
Endpoint.publish("http://ignore", impl6);
+ Endpoint.publish("", impl7);
Endpoint.publish("", i1);
Endpoint.publish("", i2);
Endpoint.publish("", i3);
@@ -62,6 +65,7 @@ public class Server extends AbstractBusT
Endpoint.publish("", i6);
Endpoint.publish("", i7);
Endpoint.publish("", i8);
+ Endpoint.publish("", i9);
EndpointImpl ep =
(EndpointImpl)Endpoint.publish("http://cxf.apache.org/transports/jms", mtom);
Binding binding = ep.getBinding();
((SOAPBinding)binding).setMTOMEnabled(true);
Added:
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/SoapService7SoapPort7Impl.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/SoapService7SoapPort7Impl.java?rev=939594&view=auto
==============================================================================
---
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/SoapService7SoapPort7Impl.java
(added)
+++
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/SoapService7SoapPort7Impl.java
Fri Apr 30 09:19:04 2010
@@ -0,0 +1,30 @@
+/**
+ * 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 = "SOAPService7",
+ portName = "SoapPort7",
+ endpointInterface = "org.apache.hello_world_doc_lit.Greeter",
+ targetNamespace = "http://apache.org/hello_world_doc_lit",
+ wsdlLocation = "testutils/hello_world_doc_lit.wsdl")
+public class SoapService7SoapPort7Impl extends GreeterImplDocBase {
+
+}
Propchange:
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/SoapService7SoapPort7Impl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/SoapService7SoapPort7Impl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified:
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
(original)
+++
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
Fri Apr 30 09:19:04 2010
@@ -18,7 +18,11 @@
*/
package org.apache.cxf.systest.jms;
+import java.util.concurrent.Future;
+
import javax.annotation.Resource;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.MessageContext;
@@ -38,6 +42,15 @@ public class TwoWayJMSImplBase implement
@Resource
protected WebServiceContext wsContext;
public String greetMe(String me) {
+ if (me.startsWith("PauseForTwoSecs")) {
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ //ignore
+ }
+ me = me.substring("PauseForTwoSecs".length()).trim();
+ }
+
MessageContext mc = wsContext.getMessageContext();
JMSMessageHeadersType headers =
(JMSMessageHeadersType)
mc.get(JMSConstants.JMS_SERVER_REQUEST_HEADERS);
@@ -86,4 +99,34 @@ public class TwoWayJMSImplBase implement
return new TestRpcLitFaultResponse();
}
+ public Response<String> greetMeAsync(String stringParam0) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Future<?> greetMeAsync(String stringParam0, AsyncHandler<String>
asyncHandler) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Response<String> sayHiAsync() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Future<?> sayHiAsync(AsyncHandler<String> asyncHandler) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Response<TestRpcLitFaultResponse> testRpcLitFaultAsync(String in) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Future<?> testRpcLitFaultAsync(String in,
AsyncHandler<TestRpcLitFaultResponse> asyncHandler) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Modified:
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
(original)
+++
cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
Fri Apr 30 09:19:04 2010
@@ -24,15 +24,16 @@ import javax.xml.ws.WebServiceContext;
import org.apache.cxf.continuations.Continuation;
import org.apache.cxf.continuations.ContinuationProvider;
+import org.apache.cxf.hello_world_jms.types.TestRpcLitFaultResponse;
-
+import org.apache.cxf.systest.jms.TwoWayJMSImplBase;
@WebService(serviceName = "HelloWorldService",
portName = "HelloWorldPort",
endpointInterface =
"org.apache.cxf.hello_world_jms.HelloWorldPortType",
targetNamespace = "http://cxf.apache.org/hello_world_jms",
wsdlLocation = "testutils/jms_test.wsdl")
-public class GreeterImplWithContinuationsJMS {
+public class GreeterImplWithContinuationsJMS extends TwoWayJMSImplBase {
@Resource
protected WebServiceContext context;
@@ -46,7 +47,7 @@ public class GreeterImplWithContinuation
throw new UnsupportedOperationException();
}
- public void testRpcLitFault(String s) {
+ public TestRpcLitFaultResponse testRpcLitFault(String faultType) {
throw new UnsupportedOperationException();
}
Modified:
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl
(original)
+++
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl
Fri Apr 30 09:19:04 2010
@@ -239,6 +239,20 @@ targetNamespace="http://apache.org/hello
</wsdl:port>
</wsdl:service>
+ <wsdl:service name="SOAPService7">
+ <wsdl:port name="SoapPort7" binding="tns:Greeter_SOAPBinding">
+ <jms:clientConfig useMessageIDAsCorrelationID="true"/>
+ <jms:address
+ jndiConnectionFactoryName="ConnectionFactory"
+
jmsDestinationName="dynamicQueues/messageidascorrelationid.SOAPService7Q.text"
+
jmsReplyDestinationName="dynamicQueues/SoapService7.reply.queue">
+
+ <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>
+ </wsdl:port>
+ </wsdl:service>
+
<!-- XML Binding based Services-->
<wsdl:service name="XMLService1">
<wsdl:port name="XMLPort1" binding="tns:Greeter_XMLBinding">
Added:
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test-binding.xml
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test-binding.xml?rev=939594&view=auto
==============================================================================
---
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test-binding.xml
(added)
+++
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test-binding.xml
Fri Apr 30 09:19:04 2010
@@ -0,0 +1,28 @@
+<!--
+ 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.
+-->
+
+<bindings
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ wsdlLocation="jms_test.wsdl"
+ xmlns="http://java.sun.com/xml/ns/jaxws">
+ <bindings node="wsdl:definitions">
+ <enableAsyncMapping>true</enableAsyncMapping>
+ </bindings>
+</bindings>
Propchange:
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test-binding.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test-binding.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test-binding.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified:
cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl?rev=939594&r1=939593&r2=939594&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl
(original)
+++ cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl
Fri Apr 30 09:19:04 2010
@@ -595,7 +595,20 @@
<jms:server durableSubscriberName="CXF_subscriber"/>
</port>
- </service>
+ </service>
+
+ <service name="HelloWorldMessageIDAsCorrelationIDAsyncService">
+ <port binding="tns:HelloWorldPortBinding"
name="HelloWorldMessageIDAsCorrelationIDAsyncPort">
+ <jms:clientConfig useMessageIDAsCorrelationID="true"/>
+ <jms:address
+ jndiConnectionFactoryName="ConnectionFactory"
+
jndiDestinationName="dynamicQueues/test.jmstransport.text.message.id.as.correlation.id"
+
jndiReplyDestinationName="dynamicQueues/test.jmstransport.text.message.id.as.correlation.id.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>
</definitions>