Skip to content

Commit e0569e3

Browse files
Feature #83454. [Core] FIX module
Change-Id: I90cdede3c6c85d394edaa6cffc5acb5768c320a2
1 parent 4be6aad commit e0569e3

27 files changed

+2930
-6
lines changed

.gitignore

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ clearth-modules/clearth-gui/build/
88
clearth-modules/clearth-style/build/
99
clearth-modules/clearth-swift/build/
1010
clearth-modules/clearth-xml/build/
11+
clearth-modules/clearth-json/build/
12+
clearth-modules/clearth-ibmmq/build/
13+
clearth-modules/clearth-activemq/build/
14+
clearth-modules/clearth-rh/build/
15+
clearth-modules/clearth-th2/build/
16+
clearth-modules/clearth-fix/build/
1117
/.project
1218
/.settings/org.eclipse.buildship.core.prefs
1319
/clearth-modules/.classpath
@@ -25,16 +31,40 @@ clearth-modules/clearth-xml/build/
2531
/clearth-modules/clearth-xml/.classpath
2632
/clearth-modules/clearth-xml/.project
2733
/clearth-modules/clearth-xml/.settings/org.eclipse.buildship.core.prefs
34+
/clearth-modules/clearth-json/.classpath
35+
/clearth-modules/clearth-json/.project
36+
/clearth-modules/clearth-json/.settings/org.eclipse.buildship.core.prefs
37+
/clearth-modules/clearth-ibmmq/.classpath
38+
/clearth-modules/clearth-ibmmq/.project
39+
/clearth-modules/clearth-ibmmq/.settings/org.eclipse.buildship.core.prefs
40+
/clearth-modules/clearth-activemq/.classpath
41+
/clearth-modules/clearth-activemq/.project
42+
/clearth-modules/clearth-activemq/.settings/org.eclipse.buildship.core.prefs
43+
/clearth-modules/clearth-rh/.classpath
44+
/clearth-modules/clearth-rh/.project
45+
/clearth-modules/clearth-rh/.settings/org.eclipse.buildship.core.prefs
46+
/clearth-modules/clearth-th2/.classpath
47+
/clearth-modules/clearth-th2/.project
48+
/clearth-modules/clearth-th2/.settings/org.eclipse.buildship.core.prefs
49+
/clearth-modules/clearth-fix/.classpath
50+
/clearth-modules/clearth-fix/.project
51+
/clearth-modules/clearth-fix/.settings/org.eclipse.buildship.core.prefs
2852
/clearth-core/value_generator_test.txt
2953
testOutput
3054
temp
31-
/clearth-modules/clearth-xml/bin
32-
/clearth-modules/clearth-swift/bin
3355
/clearth-modules/clearth-gui/bin
56+
/clearth-modules/clearth-style/bin
57+
/clearth-modules/clearth-swift/bin
58+
/clearth-modules/clearth-xml/bin
59+
/clearth-modules/clearth-json/bin
60+
/clearth-modules/clearth-ibmmq/bin
61+
/clearth-modules/clearth-activemq/bin
62+
/clearth-modules/clearth-rh/bin
63+
/clearth-modules/clearth-th2/bin
64+
/clearth-modules/clearth-fix/bin
3465
/clearth-core/test-output
3566
/connections/
36-
/clearth-modules/clearth-json/test-output
37-
/clearth-modules/clearth-json/bin
3867
/clearth-modules/clearth-gui/test-output
68+
/clearth-modules/clearth-json/test-output
3969
/clearth-modules/clearth-rh/test-output
4070
/clearth-modules/clearth-th2/test-output

clearth-modules/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static Node addConnectionTypeInfo(Node rootNode, Tuple4<String, String, String,
143143
typeNode.appendNode('name', connectionTypeInfo.first)
144144
typeNode.appendNode('connectionClass', connectionTypeInfo.second)
145145
typeNode.appendNode('directory', connectionTypeInfo.third)
146-
if (connectionTypeInfo && !connectionTypeInfo.isEmpty()) {
146+
if (connectionTypeInfo.fourth && !connectionTypeInfo.fourth.isEmpty()) {
147147
Node rulesNode = typeNode.appendNode('validationRules')
148148
connectionTypeInfo.fourth.forEach {rulesNode.appendNode('ruleClass', it)}
149149
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
dependencies {
2+
implementation 'org.quickfixj:quickfixj-core:2.3.1'
3+
}
4+
5+
publishing {
6+
publications {
7+
fix(MavenPublication) {
8+
groupId = "${group}"
9+
artifactId = 'clearth-fix'
10+
version = "${version}"
11+
12+
from components.java
13+
}
14+
}
15+
}
16+
17+
artifactoryPublish {
18+
publications(publishing.publications.fix)
19+
}
20+
21+
ext {
22+
moduleName = 'FIX'
23+
moduleImpl = 'com.exactprosystems.clearth:clearth-fix'
24+
25+
if (!project.hasProperty('clearthDir'))
26+
clearthDir = undef
27+
}
28+
29+
task installModule {
30+
doLast {
31+
def installationDir = "${projectDir}/installation"
32+
def codec = file("${installationDir}/codec.xml").text
33+
def actions = file("${installationDir}/actions.cfg").text
34+
def clearthCfgDir = "${clearthDir}/cfg/"
35+
36+
def type = new Tuple4("FIX",
37+
"com.exactprosystems.clearth.connectivity.fix.FixConnection",
38+
"connections/fix",
39+
null)
40+
41+
installModule(clearthDir, moduleName, moduleImpl,
42+
[
43+
{ addConnectionTypeToCfg(type, clearthDir) },
44+
{ putCodec(codec, moduleName, clearthDir) },
45+
{ putFile("fixsettings.cfg", installationDir, clearthCfgDir) },
46+
{ putActions(clearthDir, actions) }
47+
]
48+
)
49+
}
50+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# FIX module actions
3+
SendFixMessage=%coreactions%.fix.SendFixMessage
4+
ReceiveFixMessage=%coreactions%.fix.ReceiveFixMessage
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<CodecConfig>
2+
<Name>FIX</Name>
3+
<AltName>fix</AltName>
4+
<DictionaryFile>FIX50.xml</DictionaryFile>
5+
<Dictionary>com.exactprosystems.clearth.connectivity.fix.FixDictionary</Dictionary>
6+
<DictionaryParameters>
7+
<Parameter name="TransportDictionary" value="FIXT11.xml" />
8+
</DictionaryParameters>
9+
<Codec>com.exactprosystems.clearth.connectivity.fix.FixCodec</Codec>
10+
</CodecConfig>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# default settings for sessions
2+
[DEFAULT]
3+
ConnectionType=initiator
4+
LogonTimeout=30
5+
ReconnectInterval=30
6+
ResetOnLogon=Y
7+
ValidateFieldsOutOfOrder=N
8+
ValidateFieldsHaveValues=N
9+
ValidateUserDefinedFields=N
10+
ValidateUnorderedGroupFields=N
11+
ValidateIncomingMessage=N
12+
ValidateSequenceNumbers=N
13+
CheckCompID=N
14+
CheckLatency=N
15+
SenderCompID=SENDER
16+
FileLogPath=logs/fix/
17+
FileStorePath=../temp/fix/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/******************************************************************************
2+
* Copyright 2009-2023 Exactpro Systems Limited
3+
* https://www.exactpro.com
4+
* Build Software to Test 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 com.exactprosystems.clearth.automation.actions.fix;
20+
21+
import com.exactprosystems.clearth.automation.GlobalContext;
22+
import com.exactprosystems.clearth.automation.actions.ReceiveMessageAction;
23+
import com.exactprosystems.clearth.automation.exceptions.ResultException;
24+
import com.exactprosystems.clearth.connectivity.fix.FixCodec;
25+
import com.exactprosystems.clearth.connectivity.iface.SimpleClearThMessage;
26+
import com.exactprosystems.clearth.connectivity.iface.SimpleClearThMessageBuilder;
27+
import com.exactprosystems.clearth.messages.MessageBuilder;
28+
29+
import java.util.List;
30+
import java.util.Set;
31+
32+
public class ReceiveFixMessage extends ReceiveMessageAction<SimpleClearThMessage>
33+
{
34+
@Override
35+
protected void afterSearch(GlobalContext globalContext, List<SimpleClearThMessage> messages) throws ResultException
36+
{
37+
}
38+
39+
@Override
40+
public MessageBuilder<SimpleClearThMessage> getMessageBuilder(Set<String> serviceParameters, Set<String> metaFields)
41+
{
42+
return new SimpleClearThMessageBuilder(serviceParameters, metaFields);
43+
}
44+
45+
@Override
46+
protected String getDefaultCodecName()
47+
{
48+
return FixCodec.DEFAULT_CODEC_NAME;
49+
}
50+
51+
@Override
52+
public boolean isIncoming()
53+
{
54+
return true;
55+
}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/******************************************************************************
2+
* Copyright 2009-2023 Exactpro Systems Limited
3+
* https://www.exactpro.com
4+
* Build Software to Test 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 com.exactprosystems.clearth.automation.actions.fix;
20+
21+
import com.exactprosystems.clearth.automation.actions.SendMessageAction;
22+
import com.exactprosystems.clearth.connectivity.fix.FixCodec;
23+
import com.exactprosystems.clearth.connectivity.iface.SimpleClearThMessage;
24+
import com.exactprosystems.clearth.connectivity.iface.SimpleClearThMessageBuilder;
25+
import com.exactprosystems.clearth.messages.MessageBuilder;
26+
27+
import java.util.Set;
28+
29+
public class SendFixMessage extends SendMessageAction<SimpleClearThMessage>
30+
{
31+
@Override
32+
public MessageBuilder<SimpleClearThMessage> getMessageBuilder(Set<String> serviceParameters, Set<String> metaFields)
33+
{
34+
return new SimpleClearThMessageBuilder(serviceParameters, metaFields);
35+
}
36+
37+
@Override
38+
protected String getDefaultCodecName()
39+
{
40+
return FixCodec.DEFAULT_CODEC_NAME;
41+
}
42+
}

0 commit comments

Comments
 (0)