Skip to content

Commit f9c4d26

Browse files
authored
Add custom build example for FIX Latest messages
Added a complete example for building custom FIX messages using FIX Orchestra for FIX Latest, including project structure, pom.xml configuration, and custom FIX Orchestra file details.
1 parent 8a5ee3d commit f9c4d26

File tree

1 file changed

+236
-0
lines changed

1 file changed

+236
-0
lines changed

BUILD_WITH_CUSTOM_MESSAGES.md

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,242 @@ mvn clean install
568568

569569
---
570570

571+
## Example: Complete Custom Build for FIX Latest
572+
573+
Here's a complete example using FIX Orchestra for FIX Latest:
574+
575+
### Project Structure
576+
577+
```
578+
yourapp-fixmessages-latest/
579+
├── pom.xml
580+
└── src/
581+
└── main/
582+
└── resources/
583+
└── FIXLatest_Custom.xml
584+
```
585+
586+
### pom.xml for FIX Latest
587+
588+
```xml
589+
<?xml version="1.0" encoding="UTF-8"?>
590+
<project xmlns="http://maven.apache.org/POM/4.0.0"
591+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
592+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
593+
http://maven.apache.org/xsd/maven-4.0.0.xsd">
594+
<modelVersion>4.0.0</modelVersion>
595+
596+
<groupId>com.yourcompany</groupId>
597+
<artifactId>yourapp-fixmessages-latest</artifactId>
598+
<version>1.0.0</version>
599+
<packaging>jar</packaging>
600+
601+
<name>Your Application - FIX Latest Custom Messages</name>
602+
603+
<properties>
604+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
605+
<maven.compiler.source>1.8</maven.compiler.source>
606+
<maven.compiler.target>1.8</maven.compiler.target>
607+
<quickfixj.version>3.0.0</quickfixj.version>
608+
<quickfixj-orchestra.version>3.0.0</quickfixj-orchestra.version>
609+
<generator.decimal>false</generator.decimal>
610+
</properties>
611+
612+
<dependencies>
613+
<dependency>
614+
<groupId>org.quickfixj</groupId>
615+
<artifactId>quickfixj-base</artifactId>
616+
<version>${quickfixj.version}</version>
617+
</dependency>
618+
619+
<!-- Optional: Include standard FIXT1.1 messages -->
620+
<dependency>
621+
<groupId>org.quickfixj</groupId>
622+
<artifactId>quickfixj-messages-fixt11</artifactId>
623+
<version>${quickfixj.version}</version>
624+
</dependency>
625+
626+
<!-- Required for Orchestra code generation -->
627+
<dependency>
628+
<groupId>org.quickfixj</groupId>
629+
<artifactId>quickfixj-orchestration</artifactId>
630+
<version>${quickfixj-orchestra.version}</version>
631+
<scope>provided</scope>
632+
</dependency>
633+
</dependencies>
634+
635+
<build>
636+
<plugins>
637+
<plugin>
638+
<groupId>org.quickfixj</groupId>
639+
<artifactId>quickfixj-from-fix-orchestra-code-generator-maven-plugin</artifactId>
640+
<version>${quickfixj-orchestra.version}</version>
641+
<executions>
642+
<execution>
643+
<id>generate-fixlatest-messages</id>
644+
<phase>generate-sources</phase>
645+
<goals>
646+
<goal>generate</goal>
647+
</goals>
648+
<configuration>
649+
<!-- Path to your custom Orchestra file -->
650+
<orchestrationFilePath>src/main/resources/FIXLatest_Custom.xml</orchestrationFilePath>
651+
652+
<!-- Output directory for generated sources -->
653+
<outputBaseDirectory>target/generated-sources</outputBaseDirectory>
654+
655+
<!-- Use BigDecimal for decimal types (optional) -->
656+
<generateBigDecimal>${generator.decimal}</generateBigDecimal>
657+
658+
<!-- Generate only application layer messages (exclude session) -->
659+
<generateOnlySession>false</generateOnlySession>
660+
661+
<!-- Set to true to exclude session layer messages -->
662+
<excludeSession>false</excludeSession>
663+
664+
<!-- Generate FIXT1.1 in separate package -->
665+
<generateFixt11Package>true</generateFixt11Package>
666+
</configuration>
667+
</execution>
668+
</executions>
669+
</plugin>
670+
671+
<plugin>
672+
<groupId>org.codehaus.mojo</groupId>
673+
<artifactId>build-helper-maven-plugin</artifactId>
674+
<version>3.3.0</version>
675+
<executions>
676+
<execution>
677+
<id>add-generated-sources</id>
678+
<phase>generate-sources</phase>
679+
<goals>
680+
<goal>add-source</goal>
681+
</goals>
682+
<configuration>
683+
<sources>
684+
<source>target/generated-sources</source>
685+
</sources>
686+
</configuration>
687+
</execution>
688+
</executions>
689+
</plugin>
690+
691+
<plugin>
692+
<groupId>org.apache.maven.plugins</groupId>
693+
<artifactId>maven-compiler-plugin</artifactId>
694+
<version>3.11.0</version>
695+
<configuration>
696+
<source>1.8</source>
697+
<target>1.8</target>
698+
</configuration>
699+
</plugin>
700+
</plugins>
701+
</build>
702+
</project>
703+
```
704+
705+
### Custom FIX Orchestra File
706+
707+
Create `src/main/resources/FIXLatest_Custom.xml`. You can start with the standard FIX Orchestra repository from the `quickfixj-orchestration` module and customize it:
708+
709+
```xml
710+
<?xml version="1.0" encoding="UTF-8"?>
711+
<fixr:repository xmlns:fixr="http://fixprotocol.io/2020/orchestra/repository"
712+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
713+
xsi:schemaLocation="http://fixprotocol.io/2020/orchestra/repository
714+
https://www.fixtrading.org/FIXimate/FIXimate3.0/Base/Orchestra_repository_2020.xsd"
715+
name="FIXLatest_Custom"
716+
version="FIXLatest"
717+
specUrl="http://www.fixtradingcommunity.org/pg/structure/tech-specs/fix-version/fix-latest">
718+
719+
<!-- Define custom datatypes -->
720+
<fixr:datatypes>
721+
<!-- Include standard datatypes and add custom ones -->
722+
</fixr:datatypes>
723+
724+
<!-- Define custom fields -->
725+
<fixr:fields>
726+
<!-- Example custom field -->
727+
<fixr:field id="10000" name="MyCustomField" type="String">
728+
<fixr:annotation>
729+
<fixr:documentation>Custom field for specific use case</fixr:documentation>
730+
</fixr:annotation>
731+
</fixr:field>
732+
</fixr:fields>
733+
734+
<!-- Define custom components -->
735+
<fixr:components>
736+
<!-- Add custom components here -->
737+
</fixr:components>
738+
739+
<!-- Define custom messages -->
740+
<fixr:messages>
741+
<!-- Extend or customize messages -->
742+
<fixr:message name="NewOrderSingle" id="68" msgType="D" category="SingleGeneralOrderHandling">
743+
<fixr:structure>
744+
<!-- Add your custom field to the message -->
745+
<fixr:fieldRef id="10000" presence="optional"/>
746+
</fixr:structure>
747+
</fixr:message>
748+
</fixr:messages>
749+
750+
</fixr:repository>
751+
```
752+
753+
**Note**: For a complete starting point, extract the Orchestra file from the `quickfixj-orchestration` artifact:
754+
755+
```bash
756+
# Download and extract the standard FIX Orchestra file
757+
mvn dependency:get -Dartifact=org.quickfixj:quickfixj-orchestration:3.0.0
758+
# Extract from your local Maven repository: ~/.m2/repository/org/quickfixj/quickfixj-orchestration/3.0.0/
759+
```
760+
761+
### Build Command
762+
763+
```bash
764+
mvn clean install
765+
```
766+
767+
This will:
768+
1. Generate FIX Latest message classes from your custom Orchestra file
769+
2. Compile them into a JAR
770+
3. Install the JAR to your local Maven repository
771+
772+
### Use in Your Application
773+
774+
```xml
775+
<dependencies>
776+
<dependency>
777+
<groupId>org.quickfixj</groupId>
778+
<artifactId>quickfixj-core</artifactId>
779+
<version>3.0.0</version>
780+
</dependency>
781+
<dependency>
782+
<groupId>com.yourcompany</groupId>
783+
<artifactId>yourapp-fixmessages-latest</artifactId>
784+
<version>1.0.0</version>
785+
</dependency>
786+
</dependencies>
787+
```
788+
789+
### Key Differences from FIX 4.4 Example
790+
791+
1. **Uses FIX Orchestra format** instead of QuickFIX Dictionary XML
792+
2. **Different Maven plugin**: `quickfixj-from-fix-orchestra-code-generator-maven-plugin`
793+
3. **More configuration options** for session vs application layer messages
794+
4. **FIXT1.1 integration** - can generate or depend on standard FIXT1.1
795+
5. **Richer metadata** - Orchestra includes workflow rules and annotations
796+
797+
### Configuration Options Explained
798+
799+
- **orchestrationFilePath**: Path to your custom FIX Orchestra XML file
800+
- **generateBigDecimal**: Use `BigDecimal` instead of `Double` for decimal types
801+
- **generateOnlySession**: Set to `true` to generate only session layer messages
802+
- **excludeSession**: Set to `true` to exclude session layer messages (generate only application layer)
803+
- **generateFixt11Package**: Generate FIXT1.1 messages in a separate package
804+
---
805+
806+
571807
## Additional Resources
572808

573809
- [QuickFIX/J Messages README](https://github.com/quickfix-j/quickfixj/blob/main/quickfixj-messages/readme.md)

0 commit comments

Comments
 (0)