Hi jens,
sorry for the delay. I just created a testcase for this as I found none
that was testing this case.
See below for the algorithm to determine the correlation id to send out.
So if you do not set a conduitSelectorPrefix and use a sync call and do
not set useConduitIdSelector then it should work. In this case CXF will
correlate using the message id.
That is at least the trunk setting. What version of CXF are you using?
Christian
---
The method in JMSConduit that determines the correlation id looks like
this now:
private String createCorrelationId(final Exchange exchange, String
userCID) {
String correlationId = null;
if (!exchange.isOneWay()) {
if (userCID != null) {
correlationId = userCID;
} else if (!jmsConfig.isSetConduitSelectorPrefix()
&& (exchange.isSynchronous() || exchange.isOneWay())
&& (!jmsConfig.isSetUseConduitIdSelector()
|| !jmsConfig.isUseConduitIdSelector())) {
// in this case the correlation id will be set to
// the message id later
correlationId = null;
} else {
String prefix = (jmsConfig.isUseConduitIdSelector())
? jmsConfig.getConduitSelectorPrefix() + conduitId
: jmsConfig.getConduitSelectorPrefix();
correlationId = JMSUtils.createCorrelationId(prefix,
messageCount.incrementAndGet());
}
}
return correlationId;
}
Am 27.09.2011 12:13, schrieb Jens:
Hi,
am I assuming correctly that the silence on this topic means it's not
currently possible to do this?
Seeing as the functionality was not ported to 2.3 in CXF-2760, does filing a
new issue on this make sense?
If I interpret the current code correctly, CXF uses the same semi-automatic
approach that the underlying Spring JMS classes implement: If the user
passes a correlationId use that for correlation, otherwise use the
messageId. That sounds like it should work in many cases. However, I'm using
WebSphereMQ which requires using a conduitSelectorPrefix. Unfortunatey, when
a conduitSelectorPrefix is given CXF constructs a correlationId itself,
thereby preempting the attempt to correlate on the messageId instead.
Thanks,
Jens
Jens wrote:
Let me try to phrase the question differently. It looks like the CXF JMS
transport by default correlates the correlationId, ie. the client sets a
correlationId on the request that it expects to be returned as the
correlationId of the response.
In my case I have a server that returns the messageId of the request as
the correlationId of the response. CXF obviously fails to correlate those
messages and eventually times out waiting for the message even though it
is sitting in the queue. In CXF prior to 2.3 the
useMessageIDAsCorrelationID property could be used to fix that issue. How
can I tell current CXF versions to change its correlation strategy?
Jens wrote:
In version 2.1 and 2.2 CXF had a property useMessageIDAsCorrelationID on
the JMSConfiguration to adjust how the client correlates JMS messages.
The property was introduced in CXF-2760, and in that issue Willem
mentions that in 2.3 (and later, I presume) CXF has a new way to achieve
the same result. What is that new way? I haven't been able to find
anything similar, and the old property is no longer available.
--
View this message in context:
http://cxf.547215.n5.nabble.com/JMS-Message-Correlation-in-CXF-2-3-tp4830121p4844782.html
Sent from the cxf-user mailing list archive at Nabble.com.
--
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com