You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bv...@apache.org on 2012/12/11 10:06:03 UTC
svn commit: r1420040 - in /camel/branches/camel-2.10.x: ./
components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java
Author: bvahdat
Date: Tue Dec 11 09:06:02 2012
New Revision: 1420040
URL: http://svn.apache.org/viewvc?rev=1420040&view=rev
Log:
Merged revisions 1420038 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r1420038 | bvahdat | 2012-12-11 10:02:41 +0100 (Di, 11 Dez 2012) | 1 line
CAMEL-5861: Be more clear about how and why we calculate the replySessionID.
........
Modified:
camel/branches/camel-2.10.x/ (props changed)
camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1420038
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java?rev=1420040&r1=1420039&r2=1420040&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java (original)
+++ camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java Tue Dec 11 09:06:02 2012
@@ -126,10 +126,14 @@ public class RequestReplyExample {
}
public static class OrderStatusRequestTransformer {
+ private static final Logger LOG = LoggerFactory.getLogger(OrderStatusRequestTransformer.class);
+
public void transform(Exchange exchange) throws FieldNotFound {
- // For the reply take the reverse sessionID into the account, that's the reverse of
- // exchange.getIn().getHeader("sessionID", String.class) which is equal to "FIX.4.2:TRADER->MARKET"
- String sessionID = "FIX.4.2:MARKET->TRADER";
+ // For the reply take the reverse sessionID into the account, see org.apache.camel.component.quickfixj.MessagePredicate
+ String requestSessionID = exchange.getIn().getHeader("sessionID", String.class);
+ String replySessionID = "FIX.4.2:MARKET->TRADER";
+ LOG.info("Given the requestSessionID '{}' calculated the replySessionID as '{}'", requestSessionID, replySessionID);
+
String orderID = exchange.getIn().getHeader("orderID", String.class);
OrderStatusRequest request = new OrderStatusRequest(new ClOrdID("XYZ"), new Symbol("GOOG"), new Side(Side.BUY));
@@ -139,7 +143,7 @@ public class RequestReplyExample {
// and having the requested OrderID. This is a loose correlation but the best
// we can do with FIX 4.2. Newer versions of FIX have an optional explicit correlation field.
exchange.setProperty(QuickfixjProducer.CORRELATION_CRITERIA_KEY, new MessagePredicate(
- new SessionID(sessionID), MsgType.ORDER_STATUS_REQUEST).withField(OrderID.FIELD, request.getString(OrderID.FIELD)));
+ new SessionID(replySessionID), MsgType.ORDER_STATUS_REQUEST).withField(OrderID.FIELD, request.getString(OrderID.FIELD)));
exchange.getIn().setBody(request);
}