Package org.apache.camel.component.quickfixj.examples.util

Examples of org.apache.camel.component.quickfixj.examples.util.CountDownLatchDecrementer


            public void configure() throws Exception {
                // Release latch when session logon events are received
                // We expect four logon events (four sessions)
                from("quickfix:examples/inprocess.cfg").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.SessionLogon)).
                    bean(new CountDownLatchDecrementer("logon", logonLatch));

                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:MARKET->TRADER").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived)).
                    to("trade-executor:market");

                from("trade-executor:market").to("quickfix:examples/inprocess.cfg");
               
                // Logger app messages as JSON
                from("quickfix:examples/inprocess.cfg").
                    filter(PredicateBuilder.or(
                        header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
                        header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageSent))).
                    bean(new QuickfixjMessageJsonPrinter());
               
                // Release latch when trader receives execution report
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:TRADER->MARKET").
                    filter(PredicateBuilder.and(
                        header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
                        header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.EXECUTION_REPORT))).
                    bean(new CountDownLatchDecrementer("execution report", executionReportLatch));
            }
        };
       
        context.addRoutes(routes);
       
View Full Code Here


                    bean(new CredentialInjector("PASSWORD"));

                // Release latch when the trader received a logout message
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:TRADER->MARKET").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.SessionLogoff)).
                    bean(new CountDownLatchDecrementer("logout", logoutLatch));

                // Reject all logons on market side
                // Demonstrates how to validate logons
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:MARKET->TRADER").
                    filter(PredicateBuilder.and(
View Full Code Here

            @Override
            public void configure() throws Exception {
                // Synchronize the logon so we don't start sending status requests too early
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:TRADER->MARKET").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.SessionLogon)).
                    bean(new CountDownLatchDecrementer("logon", logonLatch));

                // 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&exchangePattern=InOut")
                    .filter(header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.ORDER_STATUS_REQUEST))
View Full Code Here

            public void configure() throws Exception {
                // Release latch when session logon events are received
                // We expect four logon events (four sessions)
                from("quickfix:examples/gateway.cfg").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.SessionLogon)).
                    bean(new CountDownLatchDecrementer("logon", logonLatch));

                // Dynamic router -- Uses FIX DeliverTo tags
                from("quickfix:examples/gateway.cfg").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived)).
                    recipientList(method(new FixMessageRouter("quickfix:examples/gateway.cfg")));

                // Logger app messages as JSON
                from("quickfix:examples/gateway.cfg").
                    filter(PredicateBuilder.or(
                            header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
                            header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageSent))).
                    bean(new QuickfixjMessageJsonPrinter());
               
                // If the trader@2 session receives an email then release the latch
                from("quickfix:examples/gateway.cfg?sessionID=FIX.4.2:TRADER@2->GATEWAY").
                    filter(PredicateBuilder.and(
                            header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
                            header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.EMAIL))).
                    bean(new CountDownLatchDecrementer("message", receivedMessageLatch));
            }
        };
       
        context.addRoutes(routes);
       
View Full Code Here

            public void configure() throws Exception {
                // Release latch when session logon events are received
                // We expect two events, one for the trader session and one for the market session
                from("quickfix:examples/inprocess.cfg").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.SessionLogon)).
                    bean(new CountDownLatchDecrementer("logon", logonLatch));

                // For all received messages, print the JSON-formatted message to stdout
                from("quickfix:examples/inprocess.cfg").
                    filter(PredicateBuilder.or(
                            header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AdminMessageReceived),
                            header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived))).
                    bean(new QuickfixjMessageJsonPrinter());

                // If the market session receives an email then release the latch
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:MARKET->TRADER").
                    filter(header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.EMAIL)).
                    bean(new CountDownLatchDecrementer("message", receivedMessageLatch));
            }
        };
       
        context.addRoutes(routes);
       
View Full Code Here

            @Override
            public void configure() throws Exception {
                // Release latch when session logon events are received
                from("quickfix:examples/inprocess.cfg").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.SessionLogon)).
                    bean(new CountDownLatchDecrementer("logon", logonLatch));

                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:MARKET->TRADER").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived)).
                    to("trade-executor:market");

                from("trade-executor:market").to("quickfix:examples/inprocess.cfg");
               
                // Logger app messages as JSON
                from("quickfix:examples/inprocess.cfg").
                    filter(PredicateBuilder.or(
                        header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
                        header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageSent))).
                    bean(new QuickfixjMessageJsonPrinter());
               
                // Release latch when trader receives execution report
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:TRADER->MARKET").
                    filter(PredicateBuilder.and(
                        header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
                        header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.EXECUTION_REPORT))).
                    bean(new CountDownLatchDecrementer("execution report", executionReportLatch));
            }
        };
       
        context.addRoutes(routes);
       
View Full Code Here

                    bean(new CredentialInjector("PASSWORD"));

                // Release latch when the trader received a logout message
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:TRADER->MARKET").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.SessionLogoff)).
                    bean(new CountDownLatchDecrementer("logout", logoutLatch));

                // Reject all logons on market side
                // Demonstrates how to validate logons
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:MARKET->TRADER").
                    filter(PredicateBuilder.and(
View Full Code Here

            @Override
            public void configure() throws Exception {
                // Synchronize the logon so we don't start sending status requests too early
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:TRADER->MARKET").
                    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")
                    .filter(header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.ORDER_STATUS_REQUEST))
View Full Code Here

            public void configure() throws Exception {
                // Release latch when session logon events are received
                // We expect four logon events (four sessions)
                from("quickfix:examples/gateway.cfg").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.SessionLogon)).
                    bean(new CountDownLatchDecrementer("logon", logonLatch));

                // Dynamic router -- Uses FIX DeliverTo tags
                from("quickfix:examples/gateway.cfg").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived)).
                    recipientList(bean(new FixMessageRouter("quickfix:examples/gateway.cfg")));

                // Logger app messages as JSON
                from("quickfix:examples/gateway.cfg").
                    filter(PredicateBuilder.or(
                            header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
                            header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageSent))).
                    bean(new QuickfixjMessageJsonPrinter());
               
                // If the trader@2 session receives an email then release the latch
                from("quickfix:examples/gateway.cfg?sessionID=FIX.4.2:TRADER@2->GATEWAY").
                    filter(PredicateBuilder.and(
                            header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
                            header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.EMAIL))).
                    bean(new CountDownLatchDecrementer("message", receivedMessageLatch));
            }
        };
       
        context.addRoutes(routes);
       
View Full Code Here

                    bean(new CredentialInjector("PASSWORD"));

                // Release latch when the trader received a logout message
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:TRADER->MARKET").
                    filter(header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.SessionLogoff)).
                    bean(new CountDownLatchDecrementer("logout", logoutLatch));

                // Reject all logons on market side
                // Demonstrates how to validate logons
                from("quickfix:examples/inprocess.cfg?sessionID=FIX.4.2:MARKET->TRADER").
                    filter(PredicateBuilder.and(
View Full Code Here

TOP

Related Classes of org.apache.camel.component.quickfixj.examples.util.CountDownLatchDecrementer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.