├── .gitignore ├── AGENTS.md ├── LICENSE ├── README.adoc ├── account.ad ├── account ├── README.adoc ├── img │ └── Chronicle-Services-Diagram.png ├── pom.xml ├── prompts │ ├── improve-code.adoc │ ├── improve-test-data.adoc │ └── requirements.adoc └── src │ ├── main │ └── java │ │ └── run │ │ └── chronicle │ │ └── account │ │ ├── AccountManagerBenchmarkMain.java │ │ ├── AccountManagerClientMain.java │ │ ├── AccountManagerGatewayMain.java │ │ ├── AccountManagerServiceMain.java │ │ ├── api │ │ ├── AccountManagerIn.java │ │ ├── AccountManagerOut.java │ │ ├── CreateAccountOut.java │ │ └── TransferOut.java │ │ ├── benchmark-results.txt │ │ ├── domain │ │ └── AccountService.java │ │ ├── dto │ │ ├── AbstractEvent.java │ │ ├── CheckPoint.java │ │ ├── CreateAccount.java │ │ ├── CreateAccountFailed.java │ │ ├── OnCreateAccount.java │ │ ├── OnTransfer.java │ │ ├── Transfer.java │ │ └── TransferFailed.java │ │ ├── impl │ │ └── AccountManagerImpl.java │ │ └── util │ │ ├── ErrorListener.java │ │ └── LogsAccountManagerOut.java │ └── test │ ├── java │ └── run │ │ └── chronicle │ │ └── account │ │ ├── AccountsTest.java │ │ ├── domain │ │ └── AccountServiceTest.java │ │ ├── dto │ │ ├── CreateAccountFailedTest.java │ │ ├── CreateAccountTest.java │ │ ├── OnCreateAccountTest.java │ │ ├── OnTransferTest.java │ │ ├── TransferFailedTest.java │ │ └── TransferTest.java │ │ ├── impl │ │ └── AccountManagerImplTest.java │ │ └── util │ │ └── LogsAccountManagerOutTest.java │ └── resources │ └── account │ ├── bard-gen │ ├── _setup.yaml │ ├── in.yaml │ ├── out-missing-field-amount.yaml │ ├── out-missing-field-balance.yaml │ ├── out-missing-field-reference.yaml │ ├── out-set-field-amount=-1.yaml │ ├── out-set-field-amount=NaN.yaml │ ├── out-set-field-balance=-1.yaml │ ├── out-set-field-balance=NaN.yaml │ └── out.yaml │ ├── bard-jinja │ ├── in.yaml │ ├── out-missing-field-balance.yaml │ ├── out-missing-field-name.yaml │ ├── out-missing-field-reference.yaml │ ├── out-missing-field-sender.yaml │ ├── out-missing-field-sendingTime.yaml │ ├── out-missing-field-target.yaml │ ├── out-set-field-balance=-1.yaml │ ├── out-set-field-balance=NaN.yaml │ ├── out-set-field-target=no-vault.yaml │ └── out.yaml │ ├── copilot │ ├── _setup.yaml │ ├── in.yaml │ ├── out-missing-field-balance.yaml │ ├── out-missing-field-name.yaml │ ├── out-missing-field-reference.yaml │ ├── out-missing-field-sendingTime.yaml │ ├── out-msg-0-duplicated.yaml │ ├── out-set-field-balance=-1.yaml │ ├── out-set-field-balance=NaN.yaml │ └── out.yaml │ ├── gpt-gen │ ├── _setup.yaml │ ├── in.yaml │ ├── out-missing-field-balance.yaml │ ├── out-missing-field-name.yaml │ ├── out-missing-field-reference.yaml │ ├── out-missing-field-sendingTime.yaml │ ├── out-set-field-balance=-1.yaml │ ├── out-set-field-balance=NaN.yaml │ └── out.yaml │ ├── gpt-jinja │ ├── in.yaml │ ├── out-account_simple.yaml │ ├── out-missing-field-account.yaml │ ├── out-missing-field-balance.yaml │ ├── out-missing-field-from.yaml │ ├── out-missing-field-name.yaml │ ├── out-missing-field-reference.yaml │ ├── out-missing-field-sendingTime.yaml │ ├── out-missing-field-to.yaml │ └── out.yaml │ ├── mixed │ ├── _setup.yaml │ ├── in.yaml │ ├── out-missing-field-reference.yaml │ └── out.yaml │ ├── o1-pro │ ├── README.adoc │ ├── _setup.yaml │ ├── in.yaml │ ├── out-missing-field-from.yaml │ ├── out-missing-field-name.yaml │ ├── out-missing-field-reference.yaml │ ├── out-missing-field-sendingTime.yaml │ ├── out-set-field-balance=-1.yaml │ ├── out-set-field-balance=NaN.yaml │ └── out.yaml │ ├── simple-gen │ ├── _setup.yaml │ ├── in.yaml │ ├── out-missing-field-amount.yaml │ ├── out-missing-field-currency.yaml │ ├── out-missing-field-reference.yaml │ ├── out-missing-field-sendingTime.yaml │ ├── out-missing-field-to.yaml │ ├── out-missing-msg-0.yaml │ ├── out-missing-msg-1.yaml │ ├── out-set-field-amount=-1.yaml │ ├── out-set-field-amount=NaN.yaml │ ├── out-set-field-currency=.yaml │ └── out.yaml │ ├── simple │ ├── _setup.yaml │ ├── in.yaml │ ├── out-account_bard-gen.yaml │ ├── out-account_simple-gen.yaml │ ├── out-missing-field-account.yaml │ ├── out-missing-field-amount.yaml │ ├── out-missing-field-balance.yaml │ ├── out-missing-field-currency.yaml │ ├── out-missing-field-from.yaml │ ├── out-missing-field-name.yaml │ ├── out-missing-field-reference.yaml │ ├── out-missing-field-sender.yaml │ ├── out-missing-field-sendingTime.yaml │ ├── out-missing-field-target.yaml │ ├── out-missing-field-to.yaml │ ├── out-missing-msg-0.yaml │ ├── out-msg-0-duplicated.yaml │ ├── out-set-field-amount=-1.yaml │ ├── out-set-field-amount=NaN.yaml │ ├── out-set-field-balance=-1.yaml │ ├── out-set-field-balance=NaN.yaml │ ├── out-set-field-currency=.yaml │ ├── out-set-field-target=no-vault.yaml │ └── out.yaml │ └── waterfall │ ├── _setup.yaml │ ├── in.yaml │ ├── out-missing-field-reference.yaml │ ├── out-missing-field-sendingTime.yaml │ ├── out-set-field-amount=-1.yaml │ ├── out-set-field-amount=NaN.yaml │ └── out.yaml ├── architecture.adoc ├── benchmarks ├── README.adoc ├── pom.xml ├── src │ └── main │ │ └── java │ │ ├── chronicle │ │ └── queue │ │ │ └── benchmark │ │ │ ├── LatencyDistributionMain.java │ │ │ ├── Main.java │ │ │ └── ThroughputMain.java │ │ └── run │ │ └── chronicle │ │ └── staged │ │ ├── IFacadeAll.java │ │ ├── IFacadeBase.java │ │ ├── IFacadeSon.java │ │ └── StagedPerformanceMain.java └── system.properties ├── docs └── images │ ├── hello-world-fig1.png │ ├── hello-world-fig2.png │ ├── hello-world-fig3.png │ └── source │ └── hello-world-fig1.svg ├── event-routing ├── pom.xml └── src │ ├── main │ ├── adoc │ │ └── event-routing-requirements.adoc │ └── java │ │ └── run │ │ └── chronicle │ │ └── routing │ │ ├── inout │ │ ├── ViaThreeFive.java │ │ ├── api │ │ │ ├── Value.java │ │ │ ├── ValueMessage.java │ │ │ ├── ViaIn.java │ │ │ ├── ViaOut.java │ │ │ └── package-info.java │ │ └── package-info.java │ │ └── out │ │ ├── SifterImpl.java │ │ ├── api │ │ ├── AllOut.java │ │ ├── Even.java │ │ ├── EvenIn.java │ │ ├── SifterIn.java │ │ ├── SifterOut.java │ │ ├── Triple.java │ │ ├── TripleIn.java │ │ └── package-info.java │ │ └── package-info.java │ └── test │ ├── java │ └── run │ │ └── chronicle │ │ └── routing │ │ ├── inout │ │ ├── ViaThreeFiveTest.java │ │ └── api │ │ │ └── ViaOutTextMethodWriter.java │ │ └── out │ │ └── SifterImplTest.java │ └── resources │ ├── sifter │ ├── in.yaml │ └── out.yaml │ ├── three-five-values │ ├── in.yaml │ └── out.yaml │ └── three-five │ ├── in.yaml │ └── out.yaml ├── hello-world ├── README.adoc ├── pom.xml └── src │ ├── main │ ├── adoc │ │ └── hello-world-requirements.adoc │ ├── hello-world-requirements.adoc │ ├── java │ │ └── event │ │ │ └── driven │ │ │ └── program │ │ │ ├── AddsExclamation.java │ │ │ ├── DirectWithExclamationMain.java │ │ │ ├── RecordInputAsYamlMain.java │ │ │ ├── RecordInputToConsoleMain.java │ │ │ ├── ReplayOutputMain.java │ │ │ ├── SaysInput.java │ │ │ ├── SaysOutput.java │ │ │ ├── api │ │ │ └── Says.java │ │ │ └── package-info.java │ └── resources │ │ └── says.yaml │ └── test │ ├── java │ └── event │ │ └── driven │ │ └── program │ │ └── AddsExclamationTest.java │ └── resources │ └── says │ ├── in.yaml │ └── out.yaml ├── images ├── AddJDK.png ├── Clone.png ├── JDKhome.png ├── OutputMain.png ├── Two-hop-latency.png ├── directory.png ├── gitpack.png ├── homegit.png ├── lotsafiles.png ├── queue.png ├── runin.png ├── runout.png ├── sayhello.png └── setJDK.png ├── md-pipeline ├── README.adoc ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── trading │ │ ├── AggregatorImpl.java │ │ ├── ExchangeSimulatorImpl.java │ │ ├── OMSImpl.java │ │ ├── Runner.java │ │ ├── StrategyImpl.java │ │ ├── api │ │ ├── AggregatorIn.java │ │ ├── AggregatorOut.java │ │ ├── All.java │ │ ├── OMSIn.java │ │ ├── OMSOut.java │ │ └── package-info.java │ │ ├── dto │ │ ├── BuySell.java │ │ ├── MarketDataIncrement.java │ │ ├── MarketDataSnapshot.java │ │ ├── NewOrderSingle.java │ │ └── package-info.java │ │ └── package-info.java │ └── test │ ├── java │ └── org │ │ └── trading │ │ ├── AggregatorTest.java │ │ └── StrategyTest.java │ └── resources │ ├── aggregator │ ├── in.yaml │ └── out.yaml │ └── strategy │ ├── in.yaml │ └── out.yaml ├── message-history-demo ├── README.adoc ├── pom.xml └── src │ └── main │ └── java │ └── town │ └── lost │ └── processor │ └── events │ ├── AbstractEvent.java │ ├── BridgeMain.java │ ├── DumpDecodedMain.java │ ├── DumpOutMain.java │ ├── EventOne.java │ ├── EventTwo.java │ ├── EventWithHistory.java │ ├── Events.java │ └── PublisherMain.java ├── messages-with-text ├── README.adoc ├── pom.xml └── src │ └── main │ └── java │ └── run │ └── chronicle │ └── queue │ ├── Message.java │ ├── MessageMain.java │ └── Messages.java ├── order-processor.ad ├── order-processor ├── README.adoc ├── pom.xml └── src │ ├── main │ ├── adoc │ │ ├── oms-api-requirements.adoc │ │ ├── oms-requirements.adoc │ │ ├── selected-fix-4.2.adoc │ │ └── test-requirements.adoc │ └── java │ │ └── town │ │ └── lost │ │ └── oms │ │ ├── OMSBenchmarkMain.java │ │ ├── OMSImpl.java │ │ ├── OrderAdderMain.java │ │ ├── OrderViewerMain.java │ │ ├── api │ │ ├── ErrorListener.java │ │ ├── OMSIn.java │ │ ├── OMSOut.java │ │ └── package-info.java │ │ └── dto │ │ ├── AbstractEvent.java │ │ ├── CancelAll.java │ │ ├── CancelOrderRequest.java │ │ ├── Ccy.java │ │ ├── ExecutionReport.java │ │ ├── NewOrderSingle.java │ │ ├── OrderCancelReject.java │ │ ├── OrderType.java │ │ ├── Side.java │ │ ├── TimeInForce.java │ │ ├── ValidateUtil.java │ │ └── package-info.java │ └── test │ ├── java │ └── town │ │ └── lost │ │ └── oms │ │ ├── OMSImplEdgeCaseTest.java │ │ └── OMSImplTest.java │ └── resources │ ├── cancelAll │ ├── in.yaml │ ├── out-missing-field-clOrdID.yaml │ ├── out-set-field-clOrdID=__.yaml │ ├── out-set-field-sendingTime=__.yaml │ └── out.yaml │ ├── cancelOrderRequest │ ├── in.yaml │ ├── out-missing-field-sender.yaml │ ├── out-missing-field-side.yaml │ ├── out-missing-field-target.yaml │ ├── out-set-field-sendingTime=__.yaml │ └── out.yaml │ ├── newOrderSingle │ ├── in.yaml │ ├── out-missing-field-account.yaml │ ├── out-missing-field-clOrdID.yaml │ ├── out-missing-field-currency.yaml │ ├── out-missing-field-ordType.yaml │ ├── out-missing-field-orderQty.yaml │ ├── out-missing-field-price.yaml │ ├── out-missing-field-sender.yaml │ ├── out-missing-field-sendingTime.yaml │ ├── out-missing-field-side.yaml │ ├── out-missing-field-symbol.yaml │ ├── out-missing-field-target.yaml │ ├── out-missing-field-timeInForce.yaml │ ├── out-missing-field-transactTime.yaml │ ├── out-set-field-clOrdID=__.yaml │ ├── out-set-field-ordType=__.yaml │ ├── out-set-field-orderQty=-1.yaml │ ├── out-set-field-orderQty=NaN.yaml │ ├── out-set-field-price=-1.yaml │ ├── out-set-field-price=NaN.yaml │ ├── out-set-field-sendingTime=__.yaml │ ├── out-set-field-side=__.yaml │ ├── out-set-field-symbol=__.yaml │ └── out.yaml │ └── newOrderSingleEquity │ ├── in.yaml │ ├── out-missing-field-account.yaml │ ├── out-missing-field-clOrdID.yaml │ ├── out-missing-field-ordType.yaml │ ├── out-missing-field-orderQty.yaml │ ├── out-missing-field-price.yaml │ ├── out-missing-field-sender.yaml │ ├── out-missing-field-sendingTime.yaml │ ├── out-missing-field-side.yaml │ ├── out-missing-field-symbol.yaml │ ├── out-missing-field-target.yaml │ ├── out-missing-field-timeInForce.yaml │ ├── out-missing-field-transactTime.yaml │ ├── out-missing-msg-0.yaml │ ├── out-msg-0-duplicated.yaml │ ├── out-newOrderSingleEquity.yaml │ ├── out-set-field-clOrdID=__.yaml │ ├── out-set-field-ordType=__.yaml │ ├── out-set-field-orderQty=-1.yaml │ ├── out-set-field-orderQty=NaN.yaml │ ├── out-set-field-price=-1.yaml │ ├── out-set-field-price=NaN.yaml │ ├── out-set-field-sendingTime=__.yaml │ ├── out-set-field-side=__.yaml │ ├── out-set-field-symbol=__.yaml │ └── out.yaml ├── pom.xml ├── reference.adoc ├── simple-avro-example ├── pom.xml └── src │ └── main │ ├── java │ └── net │ │ └── openhft │ │ └── chronicle │ │ └── queue │ │ └── simple │ │ └── avro │ │ ├── AvroHelper.java │ │ ├── InputMain.java │ │ └── OutputMain.java │ └── resources │ └── user.avsc ├── simple-input ├── README.adoc ├── pom.xml └── src │ └── main │ └── java │ └── net │ └── openhft │ └── chronicle │ └── queue │ └── simple │ └── input │ ├── InputMain.java │ ├── OutputMain.java │ ├── PrintQueueMain.java │ └── package-info.java ├── simple-translator ├── pom.xml └── src │ ├── main │ └── java │ │ └── net │ │ └── openhft │ │ └── chronicle │ │ └── queue │ │ └── simple │ │ └── translator │ │ ├── InputMain.java │ │ ├── MessageConsumer.java │ │ ├── OutputMain.java │ │ ├── PrintQueueMain.java │ │ ├── SimpleTranslator.java │ │ ├── TranslatorMain.java │ │ └── package-info.java │ └── test │ └── java │ └── net │ └── openhft │ └── chronicle │ └── queue │ └── simple │ └── translator │ ├── SimpleTranslator2Test.java │ └── SimpleTranslatorTest.java └── usage-and-tests.adoc /.gitignore: -------------------------------------------------------------------------------- 1 | # Temporarily exclude these files from aide to make the token size manageable 2 | #account/ 3 | #order-processor/ 4 | 5 | ### How to update 6 | # This is copied from OpenHFT/.gitignore 7 | # update the original and run OpenHFT/update_gitignore.sh 8 | 9 | ### Compiled class file 10 | *.class 11 | 12 | ### Package Files 13 | *.jar 14 | *.war 15 | *.ear 16 | 17 | ### Log file 18 | *.log 19 | 20 | ### IntelliJ 21 | *.iml 22 | *.ipr 23 | *.iws 24 | .idea 25 | .attach_pid* 26 | 27 | ### Virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 28 | hs_err_pid* 29 | 30 | ### Maven template 31 | target/ 32 | pom.xml.tag 33 | pom.xml.releaseBackup 34 | pom.xml.versionsBackup 35 | pom.xml.next 36 | release.properties 37 | 38 | ### Eclipse template 39 | *.pydevproject 40 | .metadata 41 | .gradle 42 | bin/ 43 | tmp/ 44 | *.tmp 45 | *.bak 46 | *.swp 47 | *~.nib 48 | local.properties 49 | .classpath 50 | .project 51 | .settings/ 52 | .loadpath 53 | 54 | ### Queue files 55 | *.cq4t 56 | *.cq4 -------------------------------------------------------------------------------- /account/img/Chronicle-Services-Diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/account/img/Chronicle-Services-Diagram.png -------------------------------------------------------------------------------- /account/src/main/java/run/chronicle/account/AccountManagerGatewayMain.java: -------------------------------------------------------------------------------- 1 | package run.chronicle.account; 2 | 3 | import net.openhft.chronicle.core.io.InvalidMarshallableException; 4 | import net.openhft.chronicle.wire.channel.ChronicleGatewayMain; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * This class acts as the main entry point for the AccountManagerGateway, 10 | * which extends the ChronicleGatewayMain class. 11 | */ 12 | public class AccountManagerGatewayMain extends ChronicleGatewayMain { 13 | 14 | /** 15 | * Constructor for AccountManagerGatewayMain. 16 | * 17 | * @param url The URL for the ChronicleGateway. 18 | * @throws InvalidMarshallableException Thrown if the gateway URL is invalid. 19 | */ 20 | public AccountManagerGatewayMain(String url) throws InvalidMarshallableException { 21 | super(url); 22 | } 23 | 24 | /** 25 | * Main method to start the gateway. 26 | * 27 | * @param args The command line arguments. Optionally, the first argument can be the gateway URL. 28 | * @throws IOException If an IO error occurs during gateway initialization. 29 | * @throws InvalidMarshallableException Thrown if the gateway URL is invalid. 30 | */ 31 | public static void main(String... args) throws IOException, InvalidMarshallableException { 32 | // The main() method in ChronicleGatewayMain expects a factory method for creating the gateway 33 | // and a URL as arguments. If no command-line arguments are given, an empty string is used as the URL. 34 | main(AccountManagerGatewayMain.class, AccountManagerGatewayMain::new, args.length == 0 ? "" : args[0]) 35 | .run(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /account/src/main/java/run/chronicle/account/api/AccountManagerOut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2022 chronicle.software 3 | * 4 | * https://chronicle.software 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package run.chronicle.account.api; 20 | 21 | import run.chronicle.account.dto.CheckPoint; 22 | 23 | /** 24 | * This interface extends both the CreateAccountOut and TransferOut interfaces. 25 | * It provides methods to manage account operations including account creation, 26 | * transfers, and checkpoint handling. 27 | */ 28 | public interface AccountManagerOut extends CreateAccountOut, TransferOut { 29 | 30 | /** 31 | * This method initiates a checkpoint operation. 32 | * 33 | * @param checkPoint a CheckPoint object encapsulating the details of the 34 | * checkpoint that started the following state dump. 35 | */ 36 | void startCheckpoint(CheckPoint checkPoint); 37 | 38 | /** 39 | * This method concludes a checkpoint operation. 40 | * 41 | * @param checkPoint a CheckPoint object encapsulating the details of the 42 | * checkpoint that started the previous state dump. 43 | */ 44 | void endCheckpoint(CheckPoint checkPoint); 45 | } 46 | -------------------------------------------------------------------------------- /account/src/main/java/run/chronicle/account/api/CreateAccountOut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2022 chronicle.software 3 | * 4 | * https://chronicle.software 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package run.chronicle.account.api; 20 | 21 | import run.chronicle.account.dto.CreateAccountFailed; 22 | import run.chronicle.account.dto.OnCreateAccount; 23 | import run.chronicle.account.util.ErrorListener; 24 | 25 | /** 26 | * This interface extends the ErrorListener interface. It is used to define methods related to 27 | * account creation. This includes notifying about the creation of an account and handling failures 28 | * during account creation. 29 | */ 30 | public interface CreateAccountOut extends ErrorListener { 31 | 32 | /** 33 | * Method to notify about the creation of an account. 34 | * 35 | * @param onCreateAccount an object of type OnCreateAccount which encapsulates the details of 36 | * the created account. 37 | */ 38 | void onCreateAccount(OnCreateAccount onCreateAccount); 39 | 40 | /** 41 | * Method to handle failures during account creation. 42 | * 43 | * @param createAccountFailed an object of type CreateAccountFailed which encapsulates the 44 | * details of the account creation failure. 45 | */ 46 | void createAccountFailed(CreateAccountFailed createAccountFailed); 47 | } 48 | -------------------------------------------------------------------------------- /account/src/main/java/run/chronicle/account/api/TransferOut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2022 chronicle.software 3 | * 4 | * https://chronicle.software 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package run.chronicle.account.api; 20 | 21 | import net.openhft.chronicle.bytes.MethodId; 22 | import run.chronicle.account.dto.OnTransfer; 23 | import run.chronicle.account.dto.TransferFailed; 24 | import run.chronicle.account.util.ErrorListener; 25 | 26 | /** 27 | * This interface extends the ErrorListener interface. It is used to define methods related to 28 | * money transfers between accounts. This includes notifying about a successful transfer and 29 | * handling failures during a transfer. 30 | */ 31 | public interface TransferOut extends ErrorListener { 32 | 33 | /** 34 | * Method to notify about a successful transfer. 35 | * 36 | * @param onTransfer an object of type OnTransfer which encapsulates the details of the 37 | * successful transfer. 38 | */ 39 | @MethodId('T') 40 | void onTransfer(OnTransfer onTransfer); 41 | 42 | /** 43 | * Method to handle failures during a transfer. 44 | * 45 | * @param transferFailed an object of type TransferFailed which encapsulates the details of 46 | * the transfer failure. 47 | */ 48 | void transferFailed(TransferFailed transferFailed); 49 | } 50 | -------------------------------------------------------------------------------- /account/src/main/java/run/chronicle/account/benchmark-results.txt: -------------------------------------------------------------------------------- 1 | -Xmx64m -Dthroughput=100000 -DrunTime=30 -Dbuffered=false -Durl=tcp://localhost:1248 -DaccountForCoordinatedOmission=false 2 | -------------------------------- SUMMARY (end to end) us ------------------------------------------- 3 | Percentile run1 run2 run3 run4 run5 % Variation 4 | 50.0: 10.99 10.99 11.02 11.02 10.99 0.19 5 | 90.0: 18.02 17.89 15.70 11.22 11.12 28.86 6 | 99.0: 20.96 19.94 15.86 15.86 15.79 14.89 7 | 99.7: 34.11 21.02 16.11 15.92 15.89 17.73 8 | 99.9: 42.18 22.62 16.67 16.34 16.18 21.00 9 | 99.97: 2021.38 26.08 18.21 17.44 17.25 25.45 10 | 99.99: 5480.45 60.48 44.48 22.82 47.68 52.39 11 | 99.997: 6938.62 332.29 426.50 80.26 451.07 75.49 12 | worst: 7593.98 728.06 820.22 303.62 838.66 54.02 13 | 14 | Windows 11 laptop, i7-1360P, Java 11 15 | -Dthroughput=20000 -Durl=internal:// 16 | -------------------------------- SUMMARY (end to end) us ------------------------------------------- 17 | Percentile run1 run2 run3 run4 run5 % Variation 18 | 50.0: 1.60 1.70 1.60 1.60 1.60 3.84 19 | 90.0: 2.10 2.10 2.10 2.10 2.00 3.16 20 | 99.0: 23.39 22.62 22.18 20.70 17.12 17.65 21 | 99.7: 155.90 168.19 191.74 177.92 170.24 8.54 22 | 99.9: 857.09 723.97 824.32 816.13 764.93 8.46 23 | 24 | -Dthroughput=20000 25 | -------------------------------- SUMMARY (end to end) us ------------------------------------------- 26 | Percentile run1 run2 run3 run4 run5 % Variation 27 | 50.0: 24.93 24.67 24.93 24.80 24.93 0.69 28 | 90.0: 37.95 35.26 38.34 35.52 35.14 5.72 29 | 99.0: 1198.08 250.62 1243.14 469.50 477.70 72.53 30 | -------------------------------------------------------------------------------- /account/src/main/java/run/chronicle/account/dto/CheckPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2022 chronicle.software 3 | * 4 | * https://chronicle.software 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package run.chronicle.account.dto; 19 | 20 | 21 | /** 22 | * The {@code CheckPoint} class represents a request to produce a snapshot 23 | * (or "dump") of the entire current system state at a given moment in time. 24 | * This includes all accounts and their balances, ensuring that the state 25 | * can be recorded for audit, recovery, or analysis. 26 | *
27 | * A valid {@code CheckPoint} event must have all these fields set; validation 28 | * is performed automatically when the event is processed. 29 | * 30 | *
Usage example: 31 | *
{@code 32 | * CheckPoint cp = new CheckPoint() 33 | * .sender(gw2Id) 34 | * .target(vaultId) 35 | * .sendingTime(SystemTimeProvider.CLOCK.currentTimeNanos()); 36 | * }37 | */ 38 | public class CheckPoint extends AbstractEvent
25 | * Using a replicated queue, this can be done on another machine to avoid 26 | * the impact of GC or IO the monitoring system might have. 27 | * 28 | *
Example usage: 29 | *
30 | * public class LoggingErrorListener implements ErrorListener { 31 | * public void jvmError(String msg) { 32 | * // Log the error to monitoring system, a file, or console 33 | * logger.error(msg); 34 | * } 35 | * }36 | * 37 | *
By providing different {@code ErrorListener} implementations, the system 38 | * can adapt to various environments (production vs. development) or integrate 39 | * with different error-handling frameworks. 40 | */ 41 | @FunctionalInterface 42 | public interface ErrorListener { 43 | 44 | /** 45 | * Handles a critical JVM-level error. 46 | *
47 | * Implementations may choose to: 48 | *
This package includes:
5 | *The goal of this package is to offer a flexible and extensible means of routing messages in various formats and protocols, supporting different input/output strategies.
13 | * 14 | * @since 2023-07-29 15 | */ 16 | package run.chronicle.routing.inout.api; 17 | 18 | -------------------------------------------------------------------------------- /event-routing/src/main/java/run/chronicle/routing/inout/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package, run.chronicle.routing.inout, includes classes related to handling, routing, and processing 3 | * messages from multiple sources and routing them to multiple destinations. 4 | * 5 | *This package includes:
6 | *4 | * It includes: 5 | * 6 | * - SifterImpl: A class implementing the SifterIn interface. This class processes a Value object based on 7 | * whether its 'val' property is an even number or divisible by 3. The processing logic decides how the Value 8 | * object will be routed out. 9 | *
10 | * The aim of this package is to provide classes and logic for output operations. This includes taking 11 | * the processed input data, and routing it to the appropriate channels for further use. 12 | */ 13 | package run.chronicle.routing.out; 14 | -------------------------------------------------------------------------------- /event-routing/src/test/java/run/chronicle/routing/inout/ViaThreeFiveTest.java: -------------------------------------------------------------------------------- 1 | package run.chronicle.routing.inout; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | // ViaThreeFiveTest is a test class for testing the ViaThreeFive class. 8 | @SuppressWarnings("deprecation") 9 | public class ViaThreeFiveTest { 10 | 11 | // The `via` method is a unit test for the `via` method in the ViaThreeFive class. 12 | @Test 13 | public void via() { 14 | doTest("three-five"); 15 | } 16 | 17 | @Test 18 | public void values() { 19 | doTest("three-five-values"); 20 | } 21 | 22 | private static void doTest(String path) { 23 | // yt is an instance of YamlTester. The `runTest` method runs a test on the ViaThreeFive class with the input. 24 | final net.openhft.chronicle.wire.utils.YamlTester yt = net.openhft.chronicle.wire.utils.YamlTester.runTest(ViaThreeFive.class, path); 25 | 26 | // Asserts that the expected result is equal to the actual result. 27 | // The `replace` method replaces any occurrences of "---\n---" in the actual result with "---". 28 | assertEquals(yt.expected(), yt.actual().replace("---\n---", "---")); 29 | } 30 | } -------------------------------------------------------------------------------- /event-routing/src/test/java/run/chronicle/routing/out/SifterImplTest.java: -------------------------------------------------------------------------------- 1 | package run.chronicle.routing.out; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | // SifterImplTest is a test class for testing the SifterImpl class. 8 | @SuppressWarnings("deprecation") 9 | public class SifterImplTest { 10 | 11 | // The `value` method is a unit test for the `value` method in the SifterImpl class. 12 | @Test 13 | public void value() { 14 | // yt is an instance of YamlTester. The `runTest` method runs a test on the SifterImpl class with the input "sifter". 15 | final net.openhft.chronicle.wire.utils.YamlTester yt = net.openhft.chronicle.wire.utils.YamlTester.runTest(SifterImpl.class, "sifter"); 16 | 17 | // Asserts that the expected result is equal to the actual result. 18 | // The `replace` method replaces any occurrences of "---\n---" in the actual result with "---". 19 | assertEquals(yt.expected(), yt.actual().replace("---\n---", "---")); 20 | } 21 | } -------------------------------------------------------------------------------- /event-routing/src/test/resources/sifter/in.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | value: { 3 | val: 1 4 | } 5 | ... 6 | --- 7 | value: { 8 | val: 2 9 | } 10 | ... 11 | --- 12 | value: { 13 | val: 3 14 | } 15 | ... 16 | --- 17 | value: { 18 | val: 4 19 | } 20 | ... 21 | --- 22 | value: { 23 | val: 5 24 | } 25 | ... 26 | --- 27 | value: { 28 | val: 6 29 | } 30 | ... 31 | --- 32 | value: { 33 | val: 15 34 | } 35 | ... 36 | -------------------------------------------------------------------------------- /event-routing/src/test/resources/sifter/out.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | out: "" 3 | value: { 4 | val: 1 5 | } 6 | ... 7 | --- 8 | evens: "" 9 | even: { 10 | val: 2 11 | } 12 | ... 13 | out: "" 14 | value: { 15 | val: 2 16 | } 17 | ... 18 | --- 19 | triples: "" 20 | triple: { 21 | val: 3 22 | } 23 | ... 24 | out: "" 25 | value: { 26 | val: 3 27 | } 28 | ... 29 | --- 30 | evens: "" 31 | even: { 32 | val: 4 33 | } 34 | ... 35 | out: "" 36 | value: { 37 | val: 4 38 | } 39 | ... 40 | --- 41 | out: "" 42 | value: { 43 | val: 5 44 | } 45 | ... 46 | --- 47 | evens: "" 48 | even: { 49 | val: 6 50 | } 51 | ... 52 | triples: "" 53 | triple: { 54 | val: 6 55 | } 56 | ... 57 | out: "" 58 | value: { 59 | val: 6 60 | } 61 | ... 62 | --- 63 | triples: "" 64 | triple: { 65 | val: 15 66 | } 67 | ... 68 | out: "" 69 | value: { 70 | val: 15 71 | } 72 | ... -------------------------------------------------------------------------------- /event-routing/src/test/resources/three-five-values/in.yaml: -------------------------------------------------------------------------------- 1 | # Scenario: 6 -> expect route to "three" 2 | --- 3 | in: eff 4 | value: { val: 6 } 5 | ... 6 | # Scenario: 15 -> expect route to "three" and "five" 7 | --- 8 | in: eff 9 | value: { val: 15 } 10 | ... 11 | # Scenario: Negative -1 -> error 12 | --- 13 | in: eff 14 | value: { val: -1 } 15 | ... 16 | # Scenario: No match (like val=2) 17 | --- 18 | in: eff 19 | value: { val: 2 } 20 | ... 21 | -------------------------------------------------------------------------------- /event-routing/src/test/resources/three-five-values/out.yaml: -------------------------------------------------------------------------------- 1 | # Scenario: 6 -> expect route to "three" 2 | --- 3 | out: "" 4 | value: { 5 | val: 6 6 | } 7 | ... 8 | # Scenario: 15 -> expect route to "three" and "five" 9 | --- 10 | out: "" 11 | value: { 12 | val: 15 13 | } 14 | ... 15 | # Scenario: Negative -1 -> error 16 | --- 17 | via: error 18 | value: { 19 | val: -1 20 | } 21 | ... 22 | out: "" 23 | value: { 24 | val: -1 25 | } 26 | ... 27 | # Scenario: No match (like val=2) 28 | --- 29 | out: "" 30 | value: { 31 | val: 2 32 | } 33 | ... 34 | -------------------------------------------------------------------------------- /event-routing/src/test/resources/three-five/in.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | in: "" 3 | value: { 4 | val: 0 5 | } 6 | ... 7 | --- 8 | via: aye 9 | value: { 10 | val: 1 11 | } 12 | ... 13 | --- 14 | via: bee 15 | value: { 16 | val: 2 17 | } 18 | ... 19 | --- 20 | via: cee 21 | value: { 22 | val: 3 23 | } 24 | ... 25 | --- 26 | via: dee 27 | value: { 28 | val: 4 29 | } 30 | ... 31 | --- 32 | via: ee 33 | value: { 34 | val: 5 35 | } 36 | ... 37 | --- 38 | via: eff 39 | value: { 40 | val: 6 41 | } 42 | ... 43 | --- 44 | via: oh 45 | value: { 46 | val: 15 47 | } 48 | ... 49 | -------------------------------------------------------------------------------- /event-routing/src/test/resources/three-five/out.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | out: "" 3 | value: { 4 | val: 0 5 | } 6 | ... 7 | --- 8 | out: "" 9 | value: { 10 | val: 1 11 | } 12 | ... 13 | --- 14 | out: "" 15 | value: { 16 | val: 2 17 | } 18 | ... 19 | --- 20 | via: three 21 | value: { 22 | val: 3 23 | } 24 | ... 25 | out: "" 26 | value: { 27 | val: 3 28 | } 29 | ... 30 | --- 31 | out: "" 32 | value: { 33 | val: 4 34 | } 35 | ... 36 | --- 37 | via: five 38 | value: { 39 | val: 5 40 | } 41 | ... 42 | out: "" 43 | value: { 44 | val: 5 45 | } 46 | ... 47 | --- 48 | via: three 49 | value: { 50 | val: 6 51 | } 52 | ... 53 | out: "" 54 | value: { 55 | val: 6 56 | } 57 | ... 58 | --- 59 | out: "" 60 | value: { 61 | val: 15 62 | } 63 | ... -------------------------------------------------------------------------------- /hello-world/src/main/hello-world-requirements.adoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/hello-world/src/main/hello-world-requirements.adoc -------------------------------------------------------------------------------- /hello-world/src/main/java/event/driven/program/AddsExclamation.java: -------------------------------------------------------------------------------- 1 | package event.driven.program; 2 | 3 | import event.driven.program.api.Says; 4 | 5 | /** 6 | * This is an AddsExclamation class implementing the {@link Says} interface. 7 | * It decorates a given {@link Says} object, adding an exclamation mark to the end of each input message before delegating the call. 8 | */ 9 | public class AddsExclamation implements Says { 10 | // The Says object to which the decorated calls will be delegated. 11 | private final Says out; 12 | 13 | /** 14 | * Constructs a new AddsExclamation object that decorates the given Says object. 15 | * 16 | * @param out the original Says object to be decorated 17 | */ 18 | public AddsExclamation(Says out) { 19 | this.out = out; 20 | } 21 | 22 | /** 23 | * Says the given words with an added exclamation mark at the end. 24 | * It adds the exclamation mark to the words and delegates the call to the original Says object. 25 | * 26 | * @param words The text to be spoken, with an added exclamation mark. 27 | */ 28 | public void say(String words) { 29 | // Adds an exclamation mark before delegating the call 30 | this.out.say(words + "!"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /hello-world/src/main/java/event/driven/program/DirectWithExclamationMain.java: -------------------------------------------------------------------------------- 1 | package event.driven.program; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * This is a DirectWithExclamationMain class. 7 | * It reads lines of text from the standard input, adds an exclamation mark to the end of each line, and then prints the result to the console. 8 | * This class leverages the {@link AddsExclamation} and {@link SaysOutput} implementations to achieve this functionality. 9 | */ 10 | public class DirectWithExclamationMain { 11 | /** 12 | * This method creates a new {@link AddsExclamation} object that wraps a {@link SaysOutput} object. 13 | * It will add an exclamation mark to the end of each input message and then print the result to the console. 14 | * This behavior is orchestrated by the {@link SaysInput} class, which reads the input and forwards it to the given {@link SaysInput} implementation. 15 | * 16 | * @param args Command-line arguments, not used in this implementation. 17 | * @throws IOException If an I/O error occurs while reading from the standard input. 18 | */ 19 | public static void main(String[] args) throws IOException { 20 | // Create a new AddsExclamation object that wraps a SaysOutput object. 21 | // This will add an exclamation mark to the end of each input message, 22 | // and then print the result to the console. 23 | SaysInput.input(new AddsExclamation(new SaysOutput())); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /hello-world/src/main/java/event/driven/program/RecordInputAsYamlMain.java: -------------------------------------------------------------------------------- 1 | package event.driven.program; 2 | 3 | import event.driven.program.api.Says; 4 | import net.openhft.chronicle.wire.Wires; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * This is a RecordInputAsYamlMain class. 10 | * It reads lines of text from the standard input and forwards them to a YAML-formatted logger, which writes the interactions to the console. 11 | * This class leverages the {@link Wires} utility class to create a proxy that records method calls in YAML format. 12 | */ 13 | public class RecordInputAsYamlMain { 14 | /** 15 | * This method obtains a proxy of the {@link Says} interface that writes method calls and their arguments in YAML format 16 | * to the given PrintStream (in this case, standard output). It takes each line of input from the user and calls the {@code say} method 17 | * each time, allowing the says proxy to log the call in YAML format. 18 | * 19 | * @param args Command-line arguments, not used in this implementation. 20 | * @throws IOException If an I/O error occurs while reading from the standard input. 21 | */ 22 | public static void main(String[] args) throws IOException { 23 | // Obtains a proxy of the Says interface that writes method calls and their arguments 24 | // in YAML format to the given PrintStream (in this case, standard output). 25 | final Says says = Wires.recordAsYaml(Says.class, System.out); 26 | 27 | // Takes each line of input from the user and calls the say(theLine) method each time, 28 | // allowing the says proxy to log the call in YAML format. 29 | SaysInput.input(says); 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /hello-world/src/main/java/event/driven/program/RecordInputToConsoleMain.java: -------------------------------------------------------------------------------- 1 | package event.driven.program; 2 | 3 | import event.driven.program.api.Says; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * This is a RecordInputToConsoleMain class. 9 | * It reads lines of text from the standard input and forwards them to the {@link SaysOutput} class, which prints them to the console. 10 | */ 11 | public class RecordInputToConsoleMain { 12 | /** 13 | * This method creates a new {@link SaysOutput} object that writes text to the console in each call to the {@code say} method. 14 | * It utilizes the {@link SaysInput} class to take each line of input from the user and calls the {@code say} method on the {@link Says} object each time. 15 | * In this instance, the {@link Says} object is configured to write directly to the console. 16 | * 17 | * @param args Command-line arguments, not used in this implementation. 18 | * @throws IOException If an I/O error occurs while reading from the standard input. 19 | */ 20 | public static void main(String[] args) throws IOException { 21 | // Creates a new SaysOutput object that writes text to the console 22 | // in each call to the say(line) method. 23 | final Says says = new SaysOutput(); 24 | 25 | // Utilizes the SaysInput class to take each line of input from the user 26 | // and calls the say(line) method on the Says object each time. 27 | // In this instance, the Says object is configured to write directly to the console. 28 | SaysInput.input(says); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /hello-world/src/main/java/event/driven/program/ReplayOutputMain.java: -------------------------------------------------------------------------------- 1 | package event.driven.program; 2 | 3 | import net.openhft.chronicle.wire.Wires; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * This is a ReplayOutputMain class. 9 | * It reads the content of a specified YAML file and replays it using the {@link SaysOutput} class, printing the interactions to the console. 10 | */ 11 | public class ReplayOutputMain { 12 | /** 13 | * This method reads the content of a YAML file specified by the first command-line argument (args[0]) 14 | * and feeds it to a {@link SaysOutput} object, which handles printing the text to the console. 15 | * By doing so, it effectively replays the interactions stored in the YAML file. 16 | * 17 | * @param args Command-line arguments, where the first argument specifies the path to the YAML file. 18 | * @throws IOException If an I/O error occurs while reading the YAML file. 19 | */ 20 | public static void main(String[] args) throws IOException { 21 | // Reads the content of a YAML file specified by the first command-line argument (args[0]) 22 | // and feeds it to the SaysOutput object, effectively replaying the interactions stored in the YAML file. 23 | Wires.replay(args[0], new SaysOutput()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /hello-world/src/main/java/event/driven/program/SaysInput.java: -------------------------------------------------------------------------------- 1 | package event.driven.program; 2 | 3 | import event.driven.program.api.Says; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.IOException; 7 | import java.io.InputStreamReader; 8 | 9 | /** 10 | * This is a SaysInput class. 11 | * It provides a static method to read text lines from the standard input and forward them to a provided {@link Says} implementation. 12 | */ 13 | public class SaysInput { 14 | 15 | /** 16 | * This method reads text lines from the standard input and calls the {@code say} method of the provided {@link Says} object for each line. 17 | * It continues reading and processing lines until the end of the input is reached (i.e., the input returns {@code null}). 18 | * 19 | * @param says An implementation of the {@link Says} interface that will handle the lines of text read from the input. 20 | * @throws IOException If an I/O error occurs while reading from the input. 21 | */ 22 | public static void input(Says says) throws IOException { 23 | // Creates a BufferedReader to read lines from the standard input 24 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 25 | // Continuously reads lines from the standard input until reaching the end 26 | for (String line; ((line = br.readLine()) != null); ) 27 | // Calls the say method of the provided Says object with the read line 28 | says.say(line); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /hello-world/src/main/java/event/driven/program/SaysOutput.java: -------------------------------------------------------------------------------- 1 | package event.driven.program; 2 | 3 | import event.driven.program.api.Says; 4 | 5 | /** 6 | * This is a SaysOutput class. 7 | * It provides an implementation of the {@link Says} interface that outputs the given words directly to the standard output. 8 | */ 9 | public class SaysOutput implements Says { 10 | 11 | /** 12 | * This method implements the {@code say} method of the {@link Says} interface. 13 | * It takes a string of words and prints them directly to the standard output. 14 | * 15 | * @param words The words to be printed to the standard output. 16 | */ 17 | public void say(String words) { 18 | // Prints the given words directly to the standard output 19 | System.out.println(words); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /hello-world/src/main/java/event/driven/program/api/Says.java: -------------------------------------------------------------------------------- 1 | package event.driven.program.api; 2 | 3 | /** 4 | * This is a Says interface. 5 | * It defines a contract for classes that need to handle speaking or outputting words. 6 | * Implementations of this interface are responsible for determining how the words are said or output. 7 | */ 8 | public interface Says { 9 | 10 | /** 11 | * This method is expected to be implemented to say or output the given words. 12 | * The specific behavior of how the words are said or output depends on the implementing class. 13 | * 14 | * @param words The text to be said or output. 15 | */ 16 | void say(String words); 17 | } -------------------------------------------------------------------------------- /hello-world/src/main/java/event/driven/program/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains classes and interfaces related to an event-driven programming model. 3 | * Event-driven programming is a paradigm in which the flow of the program is determined by events, 4 | * such as user actions, sensor outputs, or messages from other programs or threads. 5 | * 6 | *
Classes in this package may define specific events, listeners, and mechanisms to handle events
7 | * within an application. Implementations can vary widely depending on the requirements of the system.
8 | */
9 | package event.driven.program;
10 |
--------------------------------------------------------------------------------
/hello-world/src/main/resources/says.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | say: One
3 | ...
4 | ---
5 | say: Two
6 | ...
7 | ---
8 | say: Three
9 | ...
10 |
11 |
--------------------------------------------------------------------------------
/hello-world/src/test/java/event/driven/program/AddsExclamationTest.java:
--------------------------------------------------------------------------------
1 | package event.driven.program;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.assertEquals;
6 |
7 | @SuppressWarnings("deprecation")
8 | public class AddsExclamationTest {
9 | // Test method for the 'say' functionality in the AddsExclamation class
10 | @Test
11 | public void say() {
12 | // Create a YamlTester object by running a test on AddsExclamation class with the provided data file 'says'
13 | net.openhft.chronicle.wire.utils.YamlTester yt = net.openhft.chronicle.wire.utils.YamlTester.runTest(AddsExclamation.class, "says");
14 |
15 | // Assert that the expected value matches the actual value returned by the 'say' method
16 | assertEquals(yt.expected(), yt.actual());
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/hello-world/src/test/resources/says/in.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | say: One
3 | ...
4 | ---
5 | say: Two
6 | ...
7 | ---
8 | say: Three
9 | ...
--------------------------------------------------------------------------------
/hello-world/src/test/resources/says/out.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | say: One!
3 | ...
4 | ---
5 | say: Two!
6 | ...
7 | ---
8 | say: Three!
9 | ...
--------------------------------------------------------------------------------
/images/AddJDK.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/AddJDK.png
--------------------------------------------------------------------------------
/images/Clone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/Clone.png
--------------------------------------------------------------------------------
/images/JDKhome.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/JDKhome.png
--------------------------------------------------------------------------------
/images/OutputMain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/OutputMain.png
--------------------------------------------------------------------------------
/images/Two-hop-latency.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/Two-hop-latency.png
--------------------------------------------------------------------------------
/images/directory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/directory.png
--------------------------------------------------------------------------------
/images/gitpack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/gitpack.png
--------------------------------------------------------------------------------
/images/homegit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/homegit.png
--------------------------------------------------------------------------------
/images/lotsafiles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/lotsafiles.png
--------------------------------------------------------------------------------
/images/queue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/queue.png
--------------------------------------------------------------------------------
/images/runin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/runin.png
--------------------------------------------------------------------------------
/images/runout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/runout.png
--------------------------------------------------------------------------------
/images/sayhello.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/sayhello.png
--------------------------------------------------------------------------------
/images/setJDK.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Queue-Demo/9c63d74b63ac47a74a33df11ff8763d266441de0/images/setJDK.png
--------------------------------------------------------------------------------
/md-pipeline/README.adoc:
--------------------------------------------------------------------------------
1 | = Chronicle-Queue-Sample
2 | :imagesdir: ../images
3 |
4 | == Market Data Pipeline
5 |
6 | This example is code for the article link:https://chronicle.software/unix-philosophy-for-low-latency[The Unix Philosophy for Low Latency]
7 |
8 | === To run
9 |
10 | Start up three terminal screens and run the the following in the `md-pipeline` directory to start the services
11 |
12 | ```
13 | mvn exec:java@generate
14 | ```
15 |
16 | ```
17 | mvn exec:java@aggregator
18 | ```
19 |
20 | ```
21 | mvn exec:java@strategy
22 | ```
23 |
24 | And to watch the output from each service start up three more screens
25 |
26 | ```
27 | mvn exec:java@tailf -Dqueue=agg-in
28 | ```
29 |
30 | ```
31 | mvn exec:java@tailf -Dqueue=agg-out
32 | ```
33 |
34 | ```
35 | mvn exec:java@tailf -Dqueue=strat-out
36 | ```
37 |
38 |
--------------------------------------------------------------------------------
/md-pipeline/src/main/java/org/trading/AggregatorImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-2022 Chronicle Software Ltd
3 | */
4 |
5 | package org.trading;
6 |
7 | import org.trading.api.AggregatorIn;
8 | import org.trading.api.AggregatorOut;
9 | import org.trading.dto.BuySell;
10 | import org.trading.dto.MarketDataIncrement;
11 | import org.trading.dto.MarketDataSnapshot;
12 |
13 | import java.util.HashMap;
14 | import java.util.Map;
15 |
16 | /**
17 | * This is an implementation of the AggregatorIn interface, known as AggregatorImpl.
18 | * It maintains a map of market data snapshots and interfaces with an AggregatorOut object
19 | * to process and handle aggregated market data.
20 | */
21 | public class AggregatorImpl implements AggregatorIn {
22 |
23 | // A map holding market data snapshots, keyed by a long identifier
24 | private final Map
9 | * In a FIX-based system, errors might also be reflected in Reject messages or
10 | * {@code jvmError(msg)} calls if the framework intercepts an unhandled exception.
11 | */
12 | public interface ErrorListener {
13 |
14 | /**
15 | * Called when any critical system error occurs.
16 | *
17 | * @param msg A descriptive message about the JVM error or exception.
18 | */
19 | void jvmError(String msg);
20 | }
21 |
--------------------------------------------------------------------------------
/order-processor/src/main/java/town/lost/oms/api/OMSIn.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-2024 Chronicle Software Ltd
3 | */
4 |
5 | package town.lost.oms.api;
6 |
7 | import net.openhft.chronicle.bytes.MethodId;
8 | import town.lost.oms.dto.CancelAll;
9 | import town.lost.oms.dto.CancelOrderRequest;
10 | import town.lost.oms.dto.NewOrderSingle;
11 |
12 | /**
13 | * The {@code OMSIn} interface defines inbound operations for an Order Management System (OMS).
14 | *
15 | * In FIX 4.2 terms, these methods handle the logical equivalents of:
16 | *
14 | * In FIX 4.2 terms, these correspond to:
15 | * This package includes the following interfaces:
5 | *
6 | * Each interface includes methods that correspond to specific actions within the OMS, facilitating communication between clients and the OMS.
12 | *
13 | * For more details, refer to the documentation for each individual interface.
14 | */
15 | package town.lost.oms.api;
16 |
17 |
--------------------------------------------------------------------------------
/order-processor/src/main/java/town/lost/oms/dto/OrderType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-2024 Chronicle Software Ltd
3 | */
4 |
5 | package town.lost.oms.dto;
6 | /**
7 | * Enumeration for the types of orders in a trading system.
8 | *
9 | * It contains two values: MARKET and LIMIT, which represent the two main types of orders that can be placed
10 | * in a trading system. A MARKET order is an order to buy or sell a security at the current market price,
11 | * whereas a LIMIT order is an order to buy or sell a security at a specific price or better.
12 | *
13 | * This enumeration can be used when creating trading orders, like so:
14 | *
15 | * Note that the order type is indicated by the {@link OrderType} used in the 'ordType' field of the order.
28 | */
29 | public enum OrderType {
30 | /**
31 | * Market order type, which means the order should be executed at the current market price.
32 | */
33 | MARKET,
34 |
35 | /**
36 | * Limit order type, which means the order should be executed at a specific price or better.
37 | */
38 | LIMIT,
39 |
40 | /**
41 | * Pegged order type, where the price is pegged to a benchmark price, such as the best bid or ask.
42 | */
43 | PEGGED,
44 |
45 | /**
46 | * Fill or Kill order type, which must be executed immediately in its entirety or cancelled.
47 | */
48 | FILL_OR_KILL,
49 |
50 | /**
51 | * Immediate or Cancel order type, which executes all or part immediately and cancels any unfilled portion.
52 | */
53 | IMMEDIATE_OR_CANCEL,
54 | }
55 |
56 |
--------------------------------------------------------------------------------
/order-processor/src/main/java/town/lost/oms/dto/Side.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-2024 Chronicle Software Ltd
3 | */
4 |
5 | package town.lost.oms.dto;
6 |
7 | /**
8 | * Enumeration for the direction of a trade order.
9 | *
10 | * It contains two values: BUY and SELL, which represents the direction of the order. BUY (+1) means the order is to
11 | * purchase, while SELL (-1) implies the order is to sell.
12 | *
13 | * This enumeration can be used to create trading orders, like so:
14 | *
15 | * Note that the direction is indicated by the {@link Side} used in the 'side' field of the order.
28 | */
29 | public enum Side {
30 | /**
31 | * Buy order direction, represented by an integer value of +1.
32 | * Indicates an order to purchase.
33 | */
34 | BUY(+1),
35 |
36 | /**
37 | * Sell order direction, represented by an integer value of -1.
38 | * Indicates an order to sell.
39 | */
40 | SELL(-1);
41 |
42 | /**
43 | * The direction of the order.
44 | */
45 | public final int direction;
46 |
47 | /**
48 | * Constructs a BuySell enum with the specified direction.
49 | *
50 | * @param direction the direction of the order (+1 for buy, -1 for sell)
51 | */
52 | Side(int direction) {
53 | this.direction = direction;
54 | }
55 |
56 | /**
57 | * Gets the direction indicator of the order.
58 | *
59 | * @return the direction indicator as an integer
60 | */
61 | public int direction() {
62 | return direction;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/order-processor/src/main/java/town/lost/oms/dto/ValidateUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-2024 Chronicle Software Ltd
3 | */
4 | package town.lost.oms.dto;
5 |
6 | /**
7 | * The {@code ValidateUtil} class provides utility methods for validating numerical values such as price and quantity.
8 | *
9 | * This class is final and cannot be instantiated. It contains static methods that check whether a given price or quantity
10 | * is valid according to predefined business rules.
11 | *
12 | * Example usage:
13 | *
14 | * A price is considered invalid if it is not a finite number or if it is less than or equal to zero.
33 | *
34 | * @param price the price to validate
35 | * @return {@code true} if the price is invalid; {@code false} otherwise
36 | */
37 | public static boolean invalidPrice(double price) {
38 | return !Double.isFinite(price) || (price <= 0);
39 | }
40 |
41 | /**
42 | * Checks if the provided quantity is invalid.
43 | *
44 | * A quantity is considered invalid if it is not a finite number or if it is less than zero.
45 | *
46 | * @param quantity the quantity to validate
47 | * @return {@code true} if the quantity is invalid; {@code false} otherwise
48 | */
49 | public static boolean invalidQuantity(double quantity) {
50 | return !Double.isFinite(quantity) || (quantity < 0);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/order-processor/src/main/java/town/lost/oms/dto/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides the classes and interfaces necessary to create and manage Order Management System (OMS) data transfer objects (DTOs) aligned with
3 | * the FIX 4.2 specification (https://www.fixtrading.org/standards/fix-4-2/).
4 | *
5 | * This package includes the following key components:
6 | *
7 | * Each class is designed to be marshalled and unmarshalled efficiently for high-performance data transfer, leveraging serialization optimizations provided by Chronicle Wire.
33 | *
34 | * For more details, refer to the documentation of each individual class.
35 | */
36 | package town.lost.oms.dto;
37 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelAll/in.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Scenario: Cancel a single existing order
3 | # This is a test for the CancelOrderRequest operation.
4 | # The CLIENT1 (sender) is sending a request to the Order Management System (OMS1, the target)
5 | # to cancel an order that was previously placed. The order is identified by its unique ID (clOrdID).
6 |
7 | cancelOrderRequest: {
8 | sender: CLIENT1,
9 | target: OMS1,
10 | sendingTime: 2019-12-03T09:54:37.134475,
11 | symbol: EURUSD,
12 | account: ACC-12345,
13 | clOrdID: dkj4378fwh,
14 | origClOrdID: ABC1234567,
15 | side: BUY
16 | }
17 | ...
18 | ---
19 | # Scenario: Cancel all orders for EURUSD
20 | # The CLIENT1 (sender) sends a request to the OMS1 (target) to cancel all orders.
21 | cancelAll: {
22 | sender: CLIENT1,
23 | target: OMS1,
24 | sendingTime: 2019-12-03T09:54:37.134475,
25 | symbol: EURUSD,
26 | clOrdID: CANCEL_ALL,
27 | }
28 | ...
29 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelAll/out-missing-field-clOrdID.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Cancel a single existing order
2 | # This is a test for the CancelOrderRequest operation.
3 | # The CLIENT1 (sender) is sending a request to the Order Management System (OMS1, the target)
4 | # to cancel an order that was previously placed. The order is identified by its unique ID (clOrdID).
5 | # missing clOrdID: dkj4378fwh,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: clOrdID is required"
7 | ...
8 | # Scenario: Cancel all orders for EURUSD
9 | # The CLIENT1 (sender) sends a request to the OMS1 (target) to cancel all orders.
10 | # missing clOrdID: CANCEL_ALL,
11 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: clOrdID is required"
12 | ...
13 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelAll/out-set-field-clOrdID=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Cancel a single existing order
2 | # This is a test for the CancelOrderRequest operation.
3 | # The CLIENT1 (sender) is sending a request to the Order Management System (OMS1, the target)
4 | # to cancel an order that was previously placed. The order is identified by its unique ID (clOrdID).
5 | # override clOrdID: dkj4378fwh to clOrdID: ''
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: clOrdID is required"
7 | ...
8 | # Scenario: Cancel all orders for EURUSD
9 | # The CLIENT1 (sender) sends a request to the OMS1 (target) to cancel all orders.
10 | # override clOrdID: CANCEL_ALL to clOrdID: ''
11 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: clOrdID is required"
12 | ...
13 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelAll/out-set-field-sendingTime=__.yaml:
--------------------------------------------------------------------------------
1 | jvmError: "Unhandled Exception net.openhft.chronicle.core.io.InvalidMarshallableException: sendingTime is required"
2 | ...
3 | # Scenario: Cancel all orders for EURUSD
4 | # The CLIENT1 (sender) sends a request to the OMS1 (target) to cancel all orders.
5 | # override sendingTime: 2019-12-03T09:54:37.134475 to sendingTime: ''
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: sendingTime is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelAll/out.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Cancel a single existing order
2 | # This is a test for the CancelOrderRequest operation.
3 | # The CLIENT1 (sender) is sending a request to the Order Management System (OMS1, the target)
4 | # to cancel an order that was previously placed. The order is identified by its unique ID (clOrdID).
5 | ---
6 | orderCancelReject: {
7 | sender: OMS1,
8 | target: CLIENT1,
9 | sendingTime: 2019-12-03T09:54:37.134475,
10 | symbol: EURUSD,
11 | clOrdID: dkj4378fwh,
12 | reason: No such order
13 | }
14 | ...
15 | # Scenario: Cancel all orders for EURUSD
16 | # The CLIENT1 (sender) sends a request to the OMS1 (target) to cancel all orders.
17 | ---
18 | orderCancelReject: {
19 | sender: OMS1,
20 | target: CLIENT1,
21 | sendingTime: 2019-12-03T09:54:37.134475,
22 | symbol: EURUSD,
23 | clOrdID: CANCEL_ALL,
24 | reason: No orders to cancel
25 | }
26 | ...
27 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelOrderRequest/in.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Scenario: Cancel a single existing order
3 | # This is a test for the CancelOrderRequest operation.
4 | # The CLIENT1 (sender) is sending a request to the Order Management System (OMS1, the target)
5 | # to cancel an order that was previously placed. The order is identified by its unique ID (clOrdID).
6 |
7 | cancelOrderRequest: {
8 | sender: CLIENT1,
9 | target: OMS1,
10 | sendingTime: 2019-12-03T09:54:37.134475,
11 | symbol: EURUSD,
12 | account: ACC-12345,
13 | clOrdID: dkj4378fwh,
14 | origClOrdID: ABC1234567,
15 | side: BUY
16 | }
17 | ...
18 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelOrderRequest/out-missing-field-sender.yaml:
--------------------------------------------------------------------------------
1 | jvmError: "Unhandled Exception net.openhft.chronicle.core.io.InvalidMarshallableException: target is required"
2 | ...
3 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelOrderRequest/out-missing-field-side.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Cancel a single existing order
2 | # This is a test for the CancelOrderRequest operation.
3 | # The CLIENT1 (sender) is sending a request to the Order Management System (OMS1, the target)
4 | # to cancel an order that was previously placed. The order is identified by its unique ID (clOrdID).
5 | # missing side: BUY
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: side is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelOrderRequest/out-missing-field-target.yaml:
--------------------------------------------------------------------------------
1 | jvmError: "Unhandled Exception net.openhft.chronicle.core.io.InvalidMarshallableException: sender is required"
2 | ...
3 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelOrderRequest/out-set-field-sendingTime=__.yaml:
--------------------------------------------------------------------------------
1 | jvmError: "Unhandled Exception net.openhft.chronicle.core.io.InvalidMarshallableException: sendingTime is required"
2 | ...
3 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/cancelOrderRequest/out.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Cancel a single existing order
2 | # This is a test for the CancelOrderRequest operation.
3 | # The CLIENT1 (sender) is sending a request to the Order Management System (OMS1, the target)
4 | # to cancel an order that was previously placed. The order is identified by its unique ID (clOrdID).
5 | ---
6 | orderCancelReject: {
7 | sender: OMS1,
8 | target: CLIENT1,
9 | sendingTime: 2019-12-03T09:54:37.134475,
10 | symbol: EURUSD,
11 | clOrdID: dkj4378fwh,
12 | reason: No such order
13 | }
14 | ...
15 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/in.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Scenario: Basic NewOrderSingle for EURUSD
3 | # This is a test for the NewOrderSingle operation.
4 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
5 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
6 |
7 | newOrderSingle: {
8 | sender: CLIENT,
9 | target: OMS,
10 | sendingTime: 2019-12-03T09:54:37.134475,
11 | symbol: EURUSD,
12 | transactTime: 2019-12-03T09:54:37.344751,
13 | account: ACC-12345,
14 | orderQty: 10E6,
15 | price: 1.2123,
16 | side: BUY,
17 | clOrdID: dkj4378fwh,
18 | ordType: LIMIT,
19 | timeInForce: GTC,
20 | currency: USD
21 | }
22 | ...
23 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-account.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing account: ACC-12345,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: account is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-clOrdID.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing clOrdID: dkj4378fwh,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: clOrdID is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-currency.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing currency: USD
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: currency is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-ordType.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing ordType: LIMIT,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: ordType is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-orderQty.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing orderQty: 10E6,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: orderQty is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-price.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing price: 1.2123,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: price is invalid"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-sender.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing sender: CLIENT,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: sender is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-sendingTime.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing sendingTime: 2019-12-03T09:54:37.134475,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: sendingTime is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-side.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing side: BUY,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: side is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-symbol.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing symbol: EURUSD,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: symbol is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-target.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing target: OMS,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: target is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-timeInForce.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing timeInForce: GTC,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: timeInForce is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-missing-field-transactTime.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # missing transactTime: 2019-12-03T09:54:37.344751,
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: transactTime is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-set-field-clOrdID=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # override clOrdID: dkj4378fwh to clOrdID: ''
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: clOrdID is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-set-field-ordType=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # override ordType: LIMIT to ordType: ''
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: ordType is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-set-field-orderQty=-1.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # override orderQty: 10E6 to orderQty: -1
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: orderQty is invalid"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-set-field-orderQty=NaN.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # override orderQty: 10E6 to orderQty: NaN
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: orderQty is invalid"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-set-field-price=-1.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # override price: 1.2123 to price: -1
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: price is invalid"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-set-field-price=NaN.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # override price: 1.2123 to price: NaN
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: price is invalid"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-set-field-sendingTime=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # override sendingTime: 2019-12-03T09:54:37.134475 to sendingTime: ''
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: sendingTime is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-set-field-side=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # override side: BUY to side: ''
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: side is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out-set-field-symbol=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | # override symbol: EURUSD to symbol: ''
6 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: symbol is required"
7 | ...
8 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingle/out.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Basic NewOrderSingle for EURUSD
2 | # This is a test for the NewOrderSingle operation.
3 | # The client (sender) is sending a new order to the Order Management System (OMS, the target).
4 | # The order details such as the trading symbol, order quantity, price, and the order type are specified.
5 | ---
6 | executionReport: {
7 | sender: OMS,
8 | target: CLIENT,
9 | sendingTime: 2019-12-03T09:54:37.134475,
10 | symbol: EURUSD,
11 | transactTime: 2019-12-03T09:54:37.344751,
12 | orderQty: 10E6,
13 | price: 1.2123,
14 | orderID: 2019-12-03T09:54:37.345679,
15 | lastPx: 0.0,
16 | leavesQty: 0.0,
17 | cumQty: 0.0,
18 | avgPx: 0.0,
19 | side: BUY,
20 | ordType: LIMIT,
21 | clOrdID: dkj4378fwh,
22 | text: Not ready
23 | }
24 | ...
25 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/in.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Scenario: Submit a new AAPL equity order
3 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
4 | newOrderSingle: {
5 | sender: CLIENT1,
6 | target: OMS1,
7 | sendingTime: 2023-10-20T14:25:37.134475,
8 | symbol: AAPL,
9 | transactTime: 2023-10-20T14:25:37.134475,
10 | account: ACC-12345,
11 | orderQty: 1000,
12 | price: 150.25,
13 | side: BUY,
14 | clOrdID: ABC1234567,
15 | ordType: LIMIT,
16 | timeInForce: DAY,
17 | currency: USD
18 | }
19 | ...
20 | ---
21 | # Scenario: Submit a new GOOGL equity order
22 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
23 | newOrderSingle: {
24 | sender: CLIENT2,
25 | target: OMS1,
26 | sendingTime: 2023-10-20T14:27:15.987654,
27 | symbol: GOOGL,
28 | transactTime: 2023-10-20T14:27:15.987654,
29 | account: ACC-67890,
30 | orderQty: 500,
31 | price: 2750.50,
32 | side: SELL,
33 | clOrdID: XYZ7654321,
34 | ordType: MARKET,
35 | timeInForce: DAY,
36 | currency: USD
37 | }
38 | ...
39 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-account.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing account: ACC-12345,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: account is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing account: ACC-67890,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: account is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-clOrdID.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing clOrdID: ABC1234567,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: clOrdID is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing clOrdID: XYZ7654321,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: clOrdID is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-ordType.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing ordType: LIMIT,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: ordType is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing ordType: MARKET,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: ordType is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-orderQty.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing orderQty: 1000,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: orderQty is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing orderQty: 500,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: orderQty is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-price.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing price: 150.25,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: price is invalid"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing price: 2750.50,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: price is invalid"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-sender.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing sender: CLIENT1,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: sender is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing sender: CLIENT2,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: sender is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-sendingTime.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing sendingTime: 2023-10-20T14:25:37.134475,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: sendingTime is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing sendingTime: 2023-10-20T14:27:15.987654,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: sendingTime is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-side.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing side: BUY,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: side is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing side: SELL,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: side is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-symbol.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing symbol: AAPL,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: symbol is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing symbol: GOOGL,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: symbol is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-target.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing target: OMS1,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: target is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing target: OMS1,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: target is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-timeInForce.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing timeInForce: DAY,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: timeInForce is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing timeInForce: DAY,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: timeInForce is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-field-transactTime.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # missing transactTime: 2023-10-20T14:25:37.134475,
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: transactTime is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # missing transactTime: 2023-10-20T14:27:15.987654,
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: transactTime is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-missing-msg-0.yaml:
--------------------------------------------------------------------------------
1 | # Missing message 0
2 | # Scenario: Submit a new GOOGL equity order
3 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
4 | ---
5 | executionReport: {
6 | sender: OMS1,
7 | target: CLIENT2,
8 | sendingTime: 2023-10-20T14:27:15.987654,
9 | symbol: GOOGL,
10 | transactTime: 2023-10-20T14:27:15.987654,
11 | orderQty: 500.0,
12 | price: 2750.5,
13 | orderID: 2019-12-03T09:54:37.345679,
14 | lastPx: 0.0,
15 | leavesQty: 0.0,
16 | cumQty: 0.0,
17 | avgPx: 0.0,
18 | side: SELL,
19 | ordType: MARKET,
20 | clOrdID: XYZ7654321,
21 | text: Not ready
22 | }
23 | ...
24 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-msg-0-duplicated.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | ---
4 | executionReport: {
5 | sender: OMS1,
6 | target: CLIENT1,
7 | sendingTime: 2023-10-20T14:25:37.134475,
8 | symbol: AAPL,
9 | transactTime: 2023-10-20T14:25:37.134475,
10 | orderQty: 1E3,
11 | price: 150.25,
12 | orderID: 2019-12-03T09:54:37.345679,
13 | lastPx: 0.0,
14 | leavesQty: 0.0,
15 | cumQty: 0.0,
16 | avgPx: 0.0,
17 | side: BUY,
18 | ordType: LIMIT,
19 | clOrdID: ABC1234567,
20 | text: Not ready
21 | }
22 | ...
23 | # Scenario: Submit a new GOOGL equity order
24 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
25 | ---
26 | executionReport: {
27 | sender: OMS1,
28 | target: CLIENT2,
29 | sendingTime: 2023-10-20T14:27:15.987654,
30 | symbol: GOOGL,
31 | transactTime: 2023-10-20T14:27:15.987654,
32 | orderQty: 500.0,
33 | price: 2750.5,
34 | orderID: 2019-12-03T09:54:38.345679,
35 | lastPx: 0.0,
36 | leavesQty: 0.0,
37 | cumQty: 0.0,
38 | avgPx: 0.0,
39 | side: SELL,
40 | ordType: MARKET,
41 | clOrdID: XYZ7654321,
42 | text: Not ready
43 | }
44 | ...
45 | # Scenario: Submit a new AAPL equity order
46 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
47 | ---
48 | executionReport: {
49 | sender: OMS1,
50 | target: CLIENT1,
51 | sendingTime: 2023-10-20T14:25:37.134475,
52 | symbol: AAPL,
53 | transactTime: 2023-10-20T14:25:37.134475,
54 | orderQty: 1E3,
55 | price: 150.25,
56 | orderID: 2019-12-03T09:54:39.345679,
57 | lastPx: 0.0,
58 | leavesQty: 0.0,
59 | cumQty: 0.0,
60 | avgPx: 0.0,
61 | side: BUY,
62 | ordType: LIMIT,
63 | clOrdID: ABC1234567,
64 | text: Not ready
65 | }
66 | ...
67 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-set-field-clOrdID=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # override clOrdID: ABC1234567 to clOrdID: ''
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: clOrdID is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # override clOrdID: XYZ7654321 to clOrdID: ''
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: clOrdID is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-set-field-ordType=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # override ordType: LIMIT to ordType: ''
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: ordType is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # override ordType: MARKET to ordType: ''
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: ordType is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-set-field-orderQty=-1.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # override orderQty: 1000 to orderQty: -1
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: orderQty is invalid"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # override orderQty: 500 to orderQty: -1
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: orderQty is invalid"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-set-field-orderQty=NaN.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # override orderQty: 1000 to orderQty: NaN
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: orderQty is invalid"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # override orderQty: 500 to orderQty: NaN
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: orderQty is invalid"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-set-field-price=-1.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # override price: 150.25 to price: -1
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: price is invalid"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # override price: 2750.50 to price: -1
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: price is invalid"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-set-field-price=NaN.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # override price: 150.25 to price: NaN
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: price is invalid"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # override price: 2750.50 to price: NaN
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: price is invalid"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-set-field-sendingTime=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # override sendingTime: 2023-10-20T14:25:37.134475 to sendingTime: ''
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: sendingTime is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # override sendingTime: 2023-10-20T14:27:15.987654 to sendingTime: ''
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: sendingTime is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-set-field-side=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # override side: BUY to side: ''
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: side is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # override side: SELL to side: ''
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: side is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out-set-field-symbol=__.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | # override symbol: AAPL to symbol: ''
4 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: symbol is required"
5 | ...
6 | # Scenario: Submit a new GOOGL equity order
7 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
8 | # override symbol: GOOGL to symbol: ''
9 | jvmError: "net.openhft.chronicle.core.io.InvalidMarshallableException: symbol is required"
10 | ...
11 |
--------------------------------------------------------------------------------
/order-processor/src/test/resources/newOrderSingleEquity/out.yaml:
--------------------------------------------------------------------------------
1 | # Scenario: Submit a new AAPL equity order
2 | # Sample `NewOrderSingle` message representing a client's new order sent to the Order Management System (OMS).
3 | ---
4 | executionReport: {
5 | sender: OMS1,
6 | target: CLIENT1,
7 | sendingTime: 2023-10-20T14:25:37.134475,
8 | symbol: AAPL,
9 | transactTime: 2023-10-20T14:25:37.134475,
10 | orderQty: 1E3,
11 | price: 150.25,
12 | orderID: 2019-12-03T09:54:37.345679,
13 | lastPx: 0.0,
14 | leavesQty: 0.0,
15 | cumQty: 0.0,
16 | avgPx: 0.0,
17 | side: BUY,
18 | ordType: LIMIT,
19 | clOrdID: ABC1234567,
20 | text: Not ready
21 | }
22 | ...
23 | # Scenario: Submit a new GOOGL equity order
24 | # Sample `NewOrderSingle` message representing another client's new order sent to the Order Management System (OMS).
25 | ---
26 | executionReport: {
27 | sender: OMS1,
28 | target: CLIENT2,
29 | sendingTime: 2023-10-20T14:27:15.987654,
30 | symbol: GOOGL,
31 | transactTime: 2023-10-20T14:27:15.987654,
32 | orderQty: 500.0,
33 | price: 2750.5,
34 | orderID: 2019-12-03T09:54:38.345679,
35 | lastPx: 0.0,
36 | leavesQty: 0.0,
37 | cumQty: 0.0,
38 | avgPx: 0.0,
39 | side: SELL,
40 | ordType: MARKET,
41 | clOrdID: XYZ7654321,
42 | text: Not ready
43 | }
44 | ...
45 |
--------------------------------------------------------------------------------
/simple-avro-example/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | Classes included: These examples showcase basic usage patterns of Chronicle Queue, illustrating how to write to and read from a queue,
12 | * and how to dump the queue contents. The examples demonstrate inter-process communication,
15 | * one of the main features of Chronicle Queue.
6 | * Implementations of this interface define the strategy for handling or processing
7 | * messages that have been translated from one language to another.
8 | *
17 | *
21 | * The framework typically validates each DTO before calling these methods. On success or failure,
22 | * an appropriate outbound message (e.g., ExecutionReport, OrderCancelReject) is generated by
23 | * the OMS implementation.
24 | */
25 | public interface OMSIn {
26 |
27 | /**
28 | * Processes a new single-order submission (FIX 4.2 MsgType=35=D).
29 | *
30 | * @param nos The {@link NewOrderSingle} representing the details of the new order.
31 | */
32 | @MethodId('D')
33 | void newOrderSingle(NewOrderSingle nos);
34 |
35 | /**
36 | * Processes a request to cancel a specific order (FIX 4.2 MsgType=35=F).
37 | *
38 | * @param cor The {@link CancelOrderRequest} representing the details of the cancel request.
39 | */
40 | @MethodId('F')
41 | void cancelOrderRequest(CancelOrderRequest cor);
42 |
43 | /**
44 | * Processes a request to cancel all orders for a particular symbol or filter
45 | * (custom extension beyond FIX 4.2).
46 | *
47 | * @param cancelAll The {@link CancelAll} object representing the mass-cancel request.
48 | */
49 | void cancelAll(CancelAll cancelAll);
50 | }
51 |
--------------------------------------------------------------------------------
/order-processor/src/main/java/town/lost/oms/api/OMSOut.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-2024 Chronicle Software Ltd
3 | */
4 |
5 | package town.lost.oms.api;
6 |
7 | import net.openhft.chronicle.bytes.MethodId;
8 | import town.lost.oms.dto.ExecutionReport;
9 | import town.lost.oms.dto.OrderCancelReject;
10 |
11 | /**
12 | * The {@code OMSOut} interface defines outbound operations from the Order Management System (OMS).
13 | *
16 | *
19 | * This interface also extends {@link ErrorListener} to handle critical errors.
20 | * Typically, these methods are called by {@code OMSImpl} once inbound requests
21 | * have been processed and an outcome is determined.
22 | */
23 | public interface OMSOut extends ErrorListener {
24 |
25 | /**
26 | * Handles an execution report (FIX 4.2 MsgType=35=8), which might indicate a new,
27 | * partially filled, filled, or canceled order status.
28 | *
29 | * @param er The {@link ExecutionReport} object representing the order’s current state.
30 | */
31 | @MethodId(11)
32 | void executionReport(ExecutionReport er);
33 |
34 | /**
35 | * Handles an order-cancel-reject (FIX 4.2 MsgType=35=9), indicating that a cancellation
36 | * request could not be honored (e.g., no such order).
37 | *
38 | * @param ocr The {@link OrderCancelReject} object representing the reason for rejection.
39 | */
40 | @MethodId(12)
41 | void orderCancelReject(OrderCancelReject ocr);
42 | }
43 |
--------------------------------------------------------------------------------
/order-processor/src/main/java/town/lost/oms/api/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides the API interfaces for interactions with the Order Management System (OMS) in the 'town.lost.oms' project.
3 | *
4 | *
7 | *
10 | *
11 | *
16 | * NewOrderSingle nos = new NewOrderSingle()
17 | * .sender(ShortText.parse("client"))
18 | * .target(ShortText.parse("OMS"))
19 | * .clOrdID("clOrdID")
20 | * .orderQty(1e6)
21 | * .price(1.6)
22 | * .symbol(ShortText.parse("AUDUSD"))
23 | * .ordType(OrderType.LIMIT)
24 | * .side(BuySell.BUY);
25 | *
26 | *
27 | * {@code
16 | * NewOrderSingle nos = new NewOrderSingle()
17 | * .sender(toLong("sender"))
18 | * .target(toLong("target"))
19 | * .transactTime(now())
20 | * .sendingTime(now())
21 | * .orderQty(1)
22 | * .ordType(OrderType.MARKET)
23 | * .side(Side.BUY)
24 | * .symbol(toLong("EURUSD"));
25 | * }
26 | *
27 | * {@code
15 | * double price = 100.0;
16 | * if (ValidateUtil.invalidPrice(price)) {
17 | * throw new IllegalArgumentException("Invalid price");
18 | * }
19 | * }
20 | */
21 | public final class ValidateUtil {
22 |
23 | /**
24 | * Private constructor to prevent instantiation.
25 | */
26 | private ValidateUtil() {
27 | }
28 |
29 | /**
30 | * Checks if the provided price is invalid.
31 | *
32 | *
8 | *
31 | *
32 | *
10 | *
16 | *
19 | *
24 | *
27 | *
29 | *
6 | *
10 | *
11 | *