camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject svn commit: r1421837 - in /camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples: RequestReplyExample.java trading/TradeExecutorComponent.java
Date Fri, 14 Dec 2012 13:02:35 GMT
Author: bvahdat
Date: Fri Dec 14 13:02:34 2012
New Revision: 1421837

URL: http://svn.apache.org/viewvc?rev=1421837&view=rev
Log:
Merged revisions 1421836 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1421836 | bvahdat | 2012-12-14 13:59:29 +0100 (Fr, 14 Dez 2012) | 1 line
  
  CAMEL-5861: Print both OrderStatusRequest as well as ExecutionReport in JSON format.
........

Modified:
    camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/RequestReplyExample.java
    camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/trading/TradeExecutorComponent.java

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=1421837&r1=1421836&r2=1421837&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
Fri Dec 14 13:02:34 2012
@@ -32,6 +32,7 @@ import org.apache.camel.component.quickf
 import org.apache.camel.component.quickfixj.QuickfixjEndpoint;
 import org.apache.camel.component.quickfixj.QuickfixjEventCategory;
 import org.apache.camel.component.quickfixj.QuickfixjProducer;
+import org.apache.camel.component.quickfixj.examples.transform.QuickfixjMessageJsonPrinter;
 import org.apache.camel.component.quickfixj.examples.transform.QuickfixjMessageJsonTransformer;
 import org.apache.camel.component.quickfixj.examples.util.CountDownLatchDecrementer;
 import org.apache.camel.impl.DefaultCamelContext;
@@ -77,11 +78,12 @@ public class RequestReplyExample {
                     filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.SessionLogon)).
                     bean(new CountDownLatchDecrementer("logon", logonLatch));
 
-                // Incoming status requests are converted to InOut exchange pattern and passed
to the
-                // order status service. The response is sent back to the session making
the request.
-                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:MARKET->TRADER&exchangePattern=InOut")
+                // Incoming status requests are passed to the order status service and afterwards
we print out that
+                // order status being delivered using the json printer.
+                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:MARKET->TRADER")
                     .filter(header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.ORDER_STATUS_REQUEST))
-                    .bean(new MarketOrderStatusService());
+                    .bean(new MarketOrderStatusService())
+                    .bean(new QuickfixjMessageJsonPrinter());
                 
                 from("jetty:" + orderStatusServiceUrl)
                     .bean(new OrderStatusRequestTransformer())
@@ -115,7 +117,7 @@ public class RequestReplyExample {
                 sb.append('\n');
                 line = orderStatusReply.readLine();
             }
-            LOG.info("Web request response:\n" + sb);
+            LOG.info("Web request:\n" + sb);
         }
         orderStatusReply.close();
         

Modified: camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/trading/TradeExecutorComponent.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/trading/TradeExecutorComponent.java?rev=1421837&r1=1421836&r2=1421837&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/trading/TradeExecutorComponent.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/trading/TradeExecutorComponent.java
Fri Dec 14 13:02:34 2012
@@ -35,6 +35,7 @@ import org.apache.camel.impl.DefaultComp
 import org.apache.camel.impl.DefaultConsumer;
 import org.apache.camel.impl.DefaultEndpoint;
 import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.util.ObjectHelper;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -117,7 +118,7 @@ public class TradeExecutorComponent exte
                 }
 
                 private void setOptionalField(Header header, SessionID sessionID, int tag,
String value) {
-                    if (value != null && value.length() > 0) {
+                    if (!ObjectHelper.isEmpty(value)) {
                         header.setString(tag, value);
                     }
                 }



Mime
View raw message