You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/10/20 16:55:13 UTC
[camel] 01/01: CAMEL-14832: Data format for SWIFT financial message conversion support
This is an automated email from the ASF dual-hosted git repository.
nfilotto pushed a commit to branch CAMEL-14832/swift-dataformat
in repository https://gitbox.apache.org/repos/asf/camel.git
commit ff68d9ad2afd978861fb9b04cde635adff6c541e
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Thu Oct 20 18:54:31 2022 +0200
CAMEL-14832: Data format for SWIFT financial message conversion support
---
bom/camel-bom/pom.xml | 5 +
camel-dependencies/pom.xml | 1 +
catalog/camel-allcomponents/pom.xml | 4 +
.../apache/camel/catalog/dataformats.properties | 2 +
.../apache/camel/catalog/dataformats/swiftMt.json | 22 +++
.../apache/camel/catalog/dataformats/swiftMx.json | 25 +++
.../org/apache/camel/catalog/models.properties | 2 +
.../apache/camel/catalog/models/dataFormats.json | 2 +-
.../org/apache/camel/catalog/models/marshal.json | 2 +-
.../org/apache/camel/catalog/models/swiftMt.json | 19 ++
.../org/apache/camel/catalog/models/swiftMx.json | 22 +++
.../org/apache/camel/catalog/models/unmarshal.json | 2 +-
.../apache/camel/catalog/schemas/camel-spring.xsd | 119 +++++++++++++
components/camel-swift/pom.xml | 88 ++++++++++
.../swift/SwiftMtDataFormatConfigurer.java | 26 +++
.../swift/SwiftMxDataFormatConfigurer.java | 28 +++
.../swift/SwiftMxTypeConvertersLoader.java | 51 ++++++
.../swift/mt/SwiftMtDataFormatConfigurer.java | 28 +++
.../swift/mx/SwiftMxDataFormatConfigurer.java | 30 ++++
.../swift/mx/SwiftMxTypeConvertersLoader.java | 54 ++++++
.../services/org/apache/camel/TypeConverterLoader | 2 +
.../org/apache/camel/configurer/swiftMt-dataformat | 2 +
.../org/apache/camel/configurer/swiftMx-dataformat | 2 +
.../org/apache/camel/dataformat.properties | 7 +
.../services/org/apache/camel/dataformat/swiftMt | 2 +
.../services/org/apache/camel/dataformat/swiftMx | 2 +
.../apache/camel/dataformat/swift/mt/swiftMt.json | 22 +++
.../apache/camel/dataformat/swift/mx/swiftMx.json | 25 +++
.../org/apache/camel/dataformat/swift/swiftMt.json | 22 +++
.../org/apache/camel/dataformat/swift/swiftMx.json | 25 +++
.../src/main/docs/swiftMt-dataformat.adoc | 108 ++++++++++++
.../src/main/docs/swiftMx-dataformat.adoc | 108 ++++++++++++
.../dataformat/swift/mt/SwiftMtDataFormat.java | 89 ++++++++++
.../dataformat/swift/mx/ReadConfiguration.java | 35 ++++
.../dataformat/swift/mx/SwiftMxDataFormat.java | 192 +++++++++++++++++++++
.../dataformat/swift/mx/SwiftMxTypeConverters.java | 44 +++++
.../dataformat/swift/mx/WriteConfiguration.java | 76 ++++++++
.../swift/mt/SpringSwiftMxDataFormatTest.java | 127 ++++++++++++++
.../dataformat/swift/mt/SwiftMxDataFormatTest.java | 155 +++++++++++++++++
.../swift/mx/SpringSwiftMtDataFormatTest.java | 90 ++++++++++
.../dataformat/swift/mx/SwiftMtDataFormatTest.java | 106 ++++++++++++
.../src/test/resources/log4j2.properties | 28 +++
.../camel-swift/src/test/resources/mt/message1.txt | 55 ++++++
.../src/test/resources/mt/message2.json | 118 +++++++++++++
.../camel-swift/src/test/resources/mt/message2.txt | 20 +++
.../camel-swift/src/test/resources/mx/message1.xml | 38 ++++
.../src/test/resources/mx/message2.json | 169 ++++++++++++++++++
.../camel-swift/src/test/resources/mx/message2.xml | 129 ++++++++++++++
.../camel-swift/src/test/resources/mx/message3.xml | 43 +++++
.../routes/SpringSwiftMtDataFormatTest.xml | 53 ++++++
.../routes/SpringSwiftMxDataFormatTest.xml | 74 ++++++++
components/pom.xml | 1 +
.../services/org/apache/camel/model.properties | 2 +
.../apache/camel/model/dataformat/dataFormats.json | 2 +-
.../org/apache/camel/model/dataformat/jaxb.index | 2 +
.../org/apache/camel/model/dataformat/swiftMt.json | 19 ++
.../org/apache/camel/model/dataformat/swiftMx.json | 22 +++
.../resources/org/apache/camel/model/marshal.json | 2 +-
.../org/apache/camel/model/unmarshal.json | 2 +-
.../org/apache/camel/builder/DataFormatClause.java | 58 +++++++
.../org/apache/camel/model/MarshalDefinition.java | 4 +
.../apache/camel/model/UnmarshalDefinition.java | 4 +
.../model/dataformat/DataFormatsDefinition.java | 2 +
.../camel/model/dataformat/SwiftMtDataFormat.java | 61 +++++++
.../camel/model/dataformat/SwiftMxDataFormat.java | 156 +++++++++++++++++
.../DataFormatTransformerDefinition.java | 4 +
.../reifier/dataformat/DataFormatReifier.java | 6 +
.../dataformat/SwiftMtDataFormatReifier.java | 35 ++++
.../dataformat/SwiftMxDataFormatReifier.java | 38 ++++
.../org/apache/camel/main/dataformats.properties | 2 +
.../java/org/apache/camel/xml/in/ModelParser.java | 23 +++
.../modules/dataformats/examples/json/swiftMt.json | 1 +
.../modules/dataformats/examples/json/swiftMx.json | 1 +
docs/components/modules/dataformats/nav.adoc | 2 +
.../dataformats/pages/swiftMt-dataformat.adoc | 1 +
.../dataformats/pages/swiftMx-dataformat.adoc | 1 +
.../dsl/yaml/deserializers/ModelDeserializers.java | 172 ++++++++++++++++++
.../deserializers/ModelDeserializersResolver.java | 6 +
.../generated/resources/schema/camel-yaml-dsl.json | 59 +++++++
.../generated/resources/schema/camelYamlDsl.json | 59 +++++++
parent/pom.xml | 6 +
81 files changed, 3247 insertions(+), 6 deletions(-)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index cf37403f2d9..8520c9cd7e3 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -1999,6 +1999,11 @@
<artifactId>camel-swagger-java</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-swift</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-syslog</artifactId>
diff --git a/camel-dependencies/pom.xml b/camel-dependencies/pom.xml
index bbe0be03342..7a3a617a457 100644
--- a/camel-dependencies/pom.xml
+++ b/camel-dependencies/pom.xml
@@ -457,6 +457,7 @@
<protobuf-version>3.19.6</protobuf-version>
<protonpack-version>1.8</protonpack-version>
<protostream-version>4.5.0.Final</protostream-version>
+ <prowide-version>SRU2022-9.3.2</prowide-version>
<pubnub-version>4.25.0</pubnub-version>
<pulsar-version>2.10.1</pulsar-version>
<qpid-broker-version>8.0.6</qpid-broker-version>
diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index 8d867487ccb..d7c9cbd5696 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -1357,6 +1357,10 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-swagger-java</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-swift</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-syslog</artifactId>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties
index 251737ada16..36b9ab17fd1 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats.properties
@@ -33,6 +33,8 @@ protobufJackson
rss
snakeYaml
soap
+swiftMt
+swiftMx
syslog
tarFile
thrift
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/swiftMt.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/swiftMt.json
new file mode 100644
index 00000000000..bad9274d957
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/swiftMt.json
@@ -0,0 +1,22 @@
+{
+ "dataformat": {
+ "kind": "dataformat",
+ "name": "swiftMt",
+ "title": "SWIFT MT",
+ "description": "Encode and decode SWIFT MT messages.",
+ "deprecated": false,
+ "firstVersion": "3.20.0",
+ "label": "dataformat,transformation,swift,mt",
+ "javaType": "org.apache.camel.dataformat.swift.mt.SwiftMtDataFormat",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-swift",
+ "version": "3.20.0-SNAPSHOT",
+ "modelName": "swiftMt",
+ "modelJavaType": "org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "properties": {
+ "writeInJson": { "kind": "attribute", "displayName": "Write In Json", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." },
+ "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }
+ }
+}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/swiftMx.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/swiftMx.json
new file mode 100644
index 00000000000..8142b41e6a9
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/dataformats/swiftMx.json
@@ -0,0 +1,25 @@
+{
+ "dataformat": {
+ "kind": "dataformat",
+ "name": "swiftMx",
+ "title": "SWIFT MX",
+ "description": "Encode and decode SWIFT MX messages.",
+ "deprecated": false,
+ "firstVersion": "3.20.0",
+ "label": "dataformat,transformation,swift,mx",
+ "javaType": "org.apache.camel.dataformat.swift.SwiftMxDataFormat",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-swift",
+ "version": "3.20.0-SNAPSHOT",
+ "modelName": "swiftMx",
+ "modelJavaType": "org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
+ "properties": {
+ "writeConfigRef": { "kind": "attribute", "displayName": "Write Config Ref", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when marshalling a message to lookup from the registry." },
+ "writeInJson": { "kind": "attribute", "displayName": "Write In Json", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." },
+ "readMessageId": { "kind": "attribute", "displayName": "Read Message Id", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used." },
+ "readConfigRef": { "kind": "attribute", "displayName": "Read Config Ref", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry." },
+ "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }
+ }
+}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties
index 95ba79e116d..2b523bcd46f 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties
@@ -179,6 +179,8 @@ step
sticky
stop
stream-config
+swiftMt
+swiftMx
syslog
tarFile
templateBean
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/dataFormats.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/dataFormats.json
index 49515239ef2..f3512e463ec 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/dataFormats.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/dataFormats.json
@@ -12,6 +12,6 @@
"output": false
},
"properties": {
- "dataFormats": { "kind": "element", "displayName": "Data Formats", "required": true, "type": "array", "javaType": "java.util.List<org.apache.camel.model.DataFormatDefinition>", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "syslog", "tarFile", "thrift", "tidyM [...]
+ "dataFormats": { "kind": "element", "displayName": "Data Formats", "required": true, "type": "array", "javaType": "java.util.List<org.apache.camel.model.DataFormatDefinition>", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarF [...]
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/marshal.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/marshal.json
index 1a33084eccb..c290002203d 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/marshal.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/marshal.json
@@ -12,7 +12,7 @@
"output": false
},
"properties": {
- "dataFormatType": { "kind": "element", "displayName": "Data Format Type", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "syslog", "tarFile", "thrift", "tidyMarkup", [...]
+ "dataFormatType": { "kind": "element", "displayName": "Data Format Type", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "t [...]
"disabled": { "kind": "attribute", "displayName": "Disabled", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of this node" },
"description": { "kind": "element", "displayName": "Description", "required": false, "type": "object", "javaType": "org.apache.camel.model.DescriptionDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the description of this node" }
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/swiftMt.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/swiftMt.json
new file mode 100644
index 00000000000..0a6697f0504
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/swiftMt.json
@@ -0,0 +1,19 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "swiftMt",
+ "title": "SWIFT MT",
+ "description": "Encode and decode SWIFT MT messages.",
+ "deprecated": false,
+ "firstVersion": "3.20.0",
+ "label": "dataformat,transformation,swift,mt",
+ "javaType": "org.apache.camel.model.dataformat.SwiftMtDataFormat",
+ "abstract": false,
+ "input": false,
+ "output": false
+ },
+ "properties": {
+ "writeInJson": { "kind": "attribute", "displayName": "Write In Json", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." },
+ "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }
+ }
+}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/swiftMx.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/swiftMx.json
new file mode 100644
index 00000000000..8643814e47d
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/swiftMx.json
@@ -0,0 +1,22 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "swiftMx",
+ "title": "SWIFT MX",
+ "description": "Encode and decode SWIFT MX messages.",
+ "deprecated": false,
+ "firstVersion": "3.20.0",
+ "label": "dataformat,transformation,swift,mx",
+ "javaType": "org.apache.camel.model.dataformat.SwiftMxDataFormat",
+ "abstract": false,
+ "input": false,
+ "output": false
+ },
+ "properties": {
+ "writeConfigRef": { "kind": "attribute", "displayName": "Write Config Ref", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when marshalling a message to lookup from the registry." },
+ "writeInJson": { "kind": "attribute", "displayName": "Write In Json", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." },
+ "readMessageId": { "kind": "attribute", "displayName": "Read Message Id", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used." },
+ "readConfigRef": { "kind": "attribute", "displayName": "Read Config Ref", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry." },
+ "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }
+ }
+}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/unmarshal.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/unmarshal.json
index 84ae283857f..45dccff325a 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/unmarshal.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/unmarshal.json
@@ -12,7 +12,7 @@
"output": false
},
"properties": {
- "dataFormatType": { "kind": "element", "displayName": "Data Format Type", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "syslog", "tarFile", "thrift", "tidyMarkup", [...]
+ "dataFormatType": { "kind": "element", "displayName": "Data Format Type", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "t [...]
"allowNullBody": { "kind": "attribute", "displayName": "Allow Null Body", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Indicates whether null is allowed as value of a body to unmarshall." },
"disabled": { "kind": "attribute", "displayName": "Disabled", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of this node" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
index 837f1fd8ac0..25db02dca09 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
@@ -2032,6 +2032,26 @@ Stream caching configuration.
</xs:annotation>
</xs:element>
+ <xs:element name="swiftMt" type="tns:swiftMtDataFormat">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ <![CDATA[
+Encode and decode SWIFT MT messages.
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="swiftMx" type="tns:swiftMxDataFormat">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ <![CDATA[
+Encode and decode SWIFT MX messages.
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+
<xs:element name="syslog" type="tns:syslogDataFormat">
<xs:annotation>
<xs:documentation xml:lang="en">
@@ -9159,6 +9179,10 @@ it reaches the end when Camel is shut down. Default value: false
<xs:element ref="tns:soap"/>
+ <xs:element ref="tns:swiftMt"/>
+
+ <xs:element ref="tns:swiftMx"/>
+
<xs:element ref="tns:syslog"/>
<xs:element ref="tns:tarFile"/>
@@ -11961,6 +11985,89 @@ multiple schema files by using the ',' character.
</xs:complexType>
+ <xs:complexType name="swiftMtDataFormat">
+
+ <xs:complexContent>
+
+ <xs:extension base="tns:dataFormat">
+
+ <xs:sequence/>
+
+ <xs:attribute name="writeInJson" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ <![CDATA[
+The flag indicating that messages must be marshalled in a JSON format. Default
+value: false
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ </xs:extension>
+
+ </xs:complexContent>
+
+ </xs:complexType>
+
+ <xs:complexType name="swiftMxDataFormat">
+
+ <xs:complexContent>
+
+ <xs:extension base="tns:dataFormat">
+
+ <xs:sequence/>
+
+ <xs:attribute name="writeConfigRef" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ <![CDATA[
+Refers to a specific configuration to use when marshalling a message to lookup
+from the registry.
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="writeInJson" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ <![CDATA[
+The flag indicating that messages must be marshalled in a JSON format. Default
+value: false
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="readMessageId" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ <![CDATA[
+The type of MX message to produce when unmarshalling an input stream. If not
+set, it will be automatically detected from the namespace used.
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="readConfigRef" type="xs:string">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">
+ <![CDATA[
+Refers to a specific configuration to use when unmarshalling an input stream to
+lookup from the registry.
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ </xs:extension>
+
+ </xs:complexContent>
+
+ </xs:complexType>
+
<xs:complexType name="syslogDataFormat">
<xs:complexContent>
@@ -18616,6 +18723,10 @@ Sets a reference to use for lookup the policy in the registry.
<xs:element ref="tns:soap"/>
+ <xs:element ref="tns:swiftMt"/>
+
+ <xs:element ref="tns:swiftMx"/>
+
<xs:element ref="tns:syslog"/>
<xs:element ref="tns:tarFile"/>
@@ -20015,6 +20126,10 @@ Set a reference to a custom Expression to use.
<xs:element ref="tns:soap"/>
+ <xs:element ref="tns:swiftMt"/>
+
+ <xs:element ref="tns:swiftMx"/>
+
<xs:element ref="tns:syslog"/>
<xs:element ref="tns:tarFile"/>
@@ -22420,6 +22535,10 @@ To configure a special tag for the operations within this rest definition.
<xs:element ref="tns:soap"/>
+ <xs:element ref="tns:swiftMt"/>
+
+ <xs:element ref="tns:swiftMx"/>
+
<xs:element ref="tns:syslog"/>
<xs:element ref="tns:tarFile"/>
diff --git a/components/camel-swift/pom.xml b/components/camel-swift/pom.xml
new file mode 100644
index 00000000000..8b5be7ba07a
--- /dev/null
+++ b/components/camel-swift/pom.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>components</artifactId>
+ <version>3.20.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-swift</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: Swift</name>
+ <description>Camel Swift data format support</description>
+
+ <properties>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-support</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.prowidesoftware</groupId>
+ <artifactId>pw-iso20022</artifactId>
+ <version>${prowide-version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>io.github.classgraph</groupId>
+ <artifactId>classgraph</artifactId>
+ <version>4.8.149</version>
+ </dependency>
+
+ <!-- testing -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-spring-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/SwiftMtDataFormatConfigurer.java b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/SwiftMtDataFormatConfigurer.java
new file mode 100644
index 00000000000..b0c76673674
--- /dev/null
+++ b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/SwiftMtDataFormatConfigurer.java
@@ -0,0 +1,26 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.dataformat.swift;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.dataformat.swift.mt.SwiftMtDataFormat;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public class SwiftMtDataFormatConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+ SwiftMtDataFormat dataformat = (SwiftMtDataFormat) target;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "writeinjson":
+ case "writeInJson": dataformat.setWriteInJson(property(camelContext, boolean.class, value)); return true;
+ default: return false;
+ }
+ }
+
+}
+
diff --git a/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/SwiftMxDataFormatConfigurer.java b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/SwiftMxDataFormatConfigurer.java
new file mode 100644
index 00000000000..01fd2415e61
--- /dev/null
+++ b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/SwiftMxDataFormatConfigurer.java
@@ -0,0 +1,28 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.dataformat.swift;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.dataformat.swift.mx.SwiftMxDataFormat;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public class SwiftMxDataFormatConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+ SwiftMxDataFormat dataformat = (SwiftMxDataFormat) target;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "writeinjson":
+ case "writeInJson": dataformat.setWriteInJson(property(camelContext, boolean.class, value)); return true;
+ case "readmessageid":
+ case "readMessageId": dataformat.setReadMessageId(property(camelContext, com.prowidesoftware.swift.model.MxId.class, value)); return true;
+ default: return false;
+ }
+ }
+
+}
+
diff --git a/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/SwiftMxTypeConvertersLoader.java b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/SwiftMxTypeConvertersLoader.java
new file mode 100644
index 00000000000..da7dc50dac2
--- /dev/null
+++ b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/SwiftMxTypeConvertersLoader.java
@@ -0,0 +1,51 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.dataformat.swift;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.DeferredContextBinding;
+import org.apache.camel.TypeConverterLoaderException;
+import org.apache.camel.dataformat.swift.mx.SwiftMxTypeConverters;
+import org.apache.camel.spi.TypeConverterLoader;
+import org.apache.camel.spi.TypeConverterRegistry;
+import org.apache.camel.support.SimpleTypeConverter;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+@DeferredContextBinding
+public final class SwiftMxTypeConvertersLoader implements TypeConverterLoader, CamelContextAware {
+
+ private CamelContext camelContext;
+
+ public SwiftMxTypeConvertersLoader() {
+ }
+
+ @Override
+ public void setCamelContext(CamelContext camelContext) {
+ this.camelContext = camelContext;
+ }
+
+ @Override
+ public CamelContext getCamelContext() {
+ return camelContext;
+ }
+
+ @Override
+ public void load(TypeConverterRegistry registry) throws TypeConverterLoaderException {
+ registerConverters(registry);
+ }
+
+ private void registerConverters(TypeConverterRegistry registry) {
+ addTypeConverter(registry, com.prowidesoftware.swift.model.MxId.class, byte[].class, false,
+ (type, exchange, value) -> SwiftMxTypeConverters.toMxId((byte[]) value));
+ addTypeConverter(registry, com.prowidesoftware.swift.model.MxId.class, java.lang.String.class, false,
+ (type, exchange, value) -> SwiftMxTypeConverters.toMxId((java.lang.String) value));
+ }
+
+ private static void addTypeConverter(TypeConverterRegistry registry, Class<?> toType, Class<?> fromType, boolean allowNull, SimpleTypeConverter.ConversionMethod method) {
+ registry.addTypeConverter(toType, fromType, new SimpleTypeConverter(allowNull, method));
+ }
+
+}
diff --git a/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mt/SwiftMtDataFormatConfigurer.java b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mt/SwiftMtDataFormatConfigurer.java
new file mode 100644
index 00000000000..37c5f7c02be
--- /dev/null
+++ b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mt/SwiftMtDataFormatConfigurer.java
@@ -0,0 +1,28 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.dataformat.swift.mt;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public class SwiftMtDataFormatConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+ SwiftMtDataFormat dataformat = (SwiftMtDataFormat) target;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "writeinjson":
+ case "writeInJson": dataformat.setWriteInJson(property(camelContext, boolean.class, value)); return true;
+ default: return false;
+ }
+ }
+
+}
+
diff --git a/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormatConfigurer.java b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormatConfigurer.java
new file mode 100644
index 00000000000..e412b7632fb
--- /dev/null
+++ b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormatConfigurer.java
@@ -0,0 +1,30 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.dataformat.swift.mx;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public class SwiftMxDataFormatConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+ SwiftMxDataFormat dataformat = (SwiftMxDataFormat) target;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "writeinjson":
+ case "writeInJson": dataformat.setWriteInJson(property(camelContext, boolean.class, value)); return true;
+ case "readmessageid":
+ case "readMessageId": dataformat.setReadMessageId(property(camelContext, com.prowidesoftware.swift.model.MxId.class, value)); return true;
+ default: return false;
+ }
+ }
+
+}
+
diff --git a/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mx/SwiftMxTypeConvertersLoader.java b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mx/SwiftMxTypeConvertersLoader.java
new file mode 100644
index 00000000000..6dd0bbc1a7b
--- /dev/null
+++ b/components/camel-swift/src/generated/java/org/apache/camel/dataformat/swift/mx/SwiftMxTypeConvertersLoader.java
@@ -0,0 +1,54 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.dataformat.swift.mx;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.DeferredContextBinding;
+import org.apache.camel.Exchange;
+import org.apache.camel.TypeConversionException;
+import org.apache.camel.TypeConverterLoaderException;
+import org.apache.camel.spi.TypeConverterLoader;
+import org.apache.camel.spi.TypeConverterRegistry;
+import org.apache.camel.support.SimpleTypeConverter;
+import org.apache.camel.support.TypeConverterSupport;
+import org.apache.camel.util.DoubleMap;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+@DeferredContextBinding
+public final class SwiftMxTypeConvertersLoader implements TypeConverterLoader, CamelContextAware {
+
+ private CamelContext camelContext;
+
+ public SwiftMxTypeConvertersLoader() {
+ }
+
+ @Override
+ public void setCamelContext(CamelContext camelContext) {
+ this.camelContext = camelContext;
+ }
+
+ @Override
+ public CamelContext getCamelContext() {
+ return camelContext;
+ }
+
+ @Override
+ public void load(TypeConverterRegistry registry) throws TypeConverterLoaderException {
+ registerConverters(registry);
+ }
+
+ private void registerConverters(TypeConverterRegistry registry) {
+ addTypeConverter(registry, com.prowidesoftware.swift.model.MxId.class, byte[].class, false,
+ (type, exchange, value) -> org.apache.camel.dataformat.swift.mx.SwiftMxTypeConverters.toMxId((byte[]) value));
+ addTypeConverter(registry, com.prowidesoftware.swift.model.MxId.class, java.lang.String.class, false,
+ (type, exchange, value) -> org.apache.camel.dataformat.swift.mx.SwiftMxTypeConverters.toMxId((java.lang.String) value));
+ }
+
+ private static void addTypeConverter(TypeConverterRegistry registry, Class<?> toType, Class<?> fromType, boolean allowNull, SimpleTypeConverter.ConversionMethod method) {
+ registry.addTypeConverter(toType, fromType, new SimpleTypeConverter(allowNull, method));
+ }
+
+}
diff --git a/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader
new file mode 100644
index 00000000000..475946539e2
--- /dev/null
+++ b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+org.apache.camel.dataformat.swift.mx.SwiftMxTypeConvertersLoader
diff --git a/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/configurer/swiftMt-dataformat b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/configurer/swiftMt-dataformat
new file mode 100644
index 00000000000..0e6e889546a
--- /dev/null
+++ b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/configurer/swiftMt-dataformat
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.dataformat.swift.mt.SwiftMtDataFormatConfigurer
diff --git a/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/configurer/swiftMx-dataformat b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/configurer/swiftMx-dataformat
new file mode 100644
index 00000000000..4f18fc5da79
--- /dev/null
+++ b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/configurer/swiftMx-dataformat
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.dataformat.swift.mx.SwiftMxDataFormatConfigurer
diff --git a/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties
new file mode 100644
index 00000000000..b731cced524
--- /dev/null
+++ b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/dataformat.properties
@@ -0,0 +1,7 @@
+# Generated by camel build tools - do NOT edit this file!
+dataFormats=swiftMt swiftMx
+groupId=org.apache.camel
+artifactId=camel-swift
+version=3.20.0-SNAPSHOT
+projectName=Camel :: Swift
+projectDescription=Camel Swift data format support
diff --git a/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/dataformat/swiftMt b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/dataformat/swiftMt
new file mode 100644
index 00000000000..4c5a87b4c5e
--- /dev/null
+++ b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/dataformat/swiftMt
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.dataformat.swift.mt.SwiftMtDataFormat
diff --git a/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/dataformat/swiftMx b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/dataformat/swiftMx
new file mode 100644
index 00000000000..22dd4acfe1b
--- /dev/null
+++ b/components/camel-swift/src/generated/resources/META-INF/services/org/apache/camel/dataformat/swiftMx
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.dataformat.swift.mx.SwiftMxDataFormat
diff --git a/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/mt/swiftMt.json b/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/mt/swiftMt.json
new file mode 100644
index 00000000000..bad9274d957
--- /dev/null
+++ b/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/mt/swiftMt.json
@@ -0,0 +1,22 @@
+{
+ "dataformat": {
+ "kind": "dataformat",
+ "name": "swiftMt",
+ "title": "SWIFT MT",
+ "description": "Encode and decode SWIFT MT messages.",
+ "deprecated": false,
+ "firstVersion": "3.20.0",
+ "label": "dataformat,transformation,swift,mt",
+ "javaType": "org.apache.camel.dataformat.swift.mt.SwiftMtDataFormat",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-swift",
+ "version": "3.20.0-SNAPSHOT",
+ "modelName": "swiftMt",
+ "modelJavaType": "org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "properties": {
+ "writeInJson": { "kind": "attribute", "displayName": "Write In Json", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." },
+ "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }
+ }
+}
diff --git a/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/mx/swiftMx.json b/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/mx/swiftMx.json
new file mode 100644
index 00000000000..e96d53e50ee
--- /dev/null
+++ b/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/mx/swiftMx.json
@@ -0,0 +1,25 @@
+{
+ "dataformat": {
+ "kind": "dataformat",
+ "name": "swiftMx",
+ "title": "SWIFT MX",
+ "description": "Encode and decode SWIFT MX messages.",
+ "deprecated": false,
+ "firstVersion": "3.20.0",
+ "label": "dataformat,transformation,swift,mx",
+ "javaType": "org.apache.camel.dataformat.swift.mx.SwiftMxDataFormat",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-swift",
+ "version": "3.20.0-SNAPSHOT",
+ "modelName": "swiftMx",
+ "modelJavaType": "org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
+ "properties": {
+ "writeConfigRef": { "kind": "attribute", "displayName": "Write Config Ref", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when marshalling a message to lookup from the registry." },
+ "writeInJson": { "kind": "attribute", "displayName": "Write In Json", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." },
+ "readMessageId": { "kind": "attribute", "displayName": "Read Message Id", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used." },
+ "readConfigRef": { "kind": "attribute", "displayName": "Read Config Ref", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry." },
+ "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }
+ }
+}
diff --git a/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/swiftMt.json b/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/swiftMt.json
new file mode 100644
index 00000000000..d70df425269
--- /dev/null
+++ b/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/swiftMt.json
@@ -0,0 +1,22 @@
+{
+ "dataformat": {
+ "kind": "dataformat",
+ "name": "swiftMt",
+ "title": "SWIFT MT",
+ "description": "Encode and decode SWIFT MT messages.",
+ "deprecated": false,
+ "firstVersion": "3.20.0",
+ "label": "dataformat,transformation,swift,mt",
+ "javaType": "org.apache.camel.dataformat.swift.SwiftMtDataFormat",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-swift",
+ "version": "3.20.0-SNAPSHOT",
+ "modelName": "swiftMt",
+ "modelJavaType": "org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "properties": {
+ "writeInJson": { "kind": "attribute", "displayName": "Write In Json", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." },
+ "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }
+ }
+}
diff --git a/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/swiftMx.json b/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/swiftMx.json
new file mode 100644
index 00000000000..8142b41e6a9
--- /dev/null
+++ b/components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/swiftMx.json
@@ -0,0 +1,25 @@
+{
+ "dataformat": {
+ "kind": "dataformat",
+ "name": "swiftMx",
+ "title": "SWIFT MX",
+ "description": "Encode and decode SWIFT MX messages.",
+ "deprecated": false,
+ "firstVersion": "3.20.0",
+ "label": "dataformat,transformation,swift,mx",
+ "javaType": "org.apache.camel.dataformat.swift.SwiftMxDataFormat",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-swift",
+ "version": "3.20.0-SNAPSHOT",
+ "modelName": "swiftMx",
+ "modelJavaType": "org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
+ "properties": {
+ "writeConfigRef": { "kind": "attribute", "displayName": "Write Config Ref", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when marshalling a message to lookup from the registry." },
+ "writeInJson": { "kind": "attribute", "displayName": "Write In Json", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." },
+ "readMessageId": { "kind": "attribute", "displayName": "Read Message Id", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used." },
+ "readConfigRef": { "kind": "attribute", "displayName": "Read Config Ref", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry." },
+ "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }
+ }
+}
diff --git a/components/camel-swift/src/main/docs/swiftMt-dataformat.adoc b/components/camel-swift/src/main/docs/swiftMt-dataformat.adoc
new file mode 100644
index 00000000000..d4927fde14f
--- /dev/null
+++ b/components/camel-swift/src/main/docs/swiftMt-dataformat.adoc
@@ -0,0 +1,108 @@
+= SWIFT MT DataFormat
+:doctitle: SWIFT MT
+:shortname: swiftMt
+:artifactid: camel-swift
+:description: Encode and decode SWIFT MT messages.
+:since: 3.20
+:supportlevel: Preview
+
+*Since Camel {since}*
+
+The Swift MT data format is used to encode and decode Swift MT messages.
+
+== Options
+
+// dataformat options: START
+include::partial$dataformat-options.adoc[]
+// dataformat options: END
+
+In Spring DSL, you configure the data format using this tag:
+
+[source,xml]
+----
+<camelContext>
+ <dataFormats>
+ <swiftMt id="swiftInJson" writeInJson="true"/>
+ </dataFormats>
+ ...
+</camelContext>
+----
+
+Then you can use it later by its reference:
+
+[source,xml]
+----
+<route>
+ <from uri="direct:startEncode" />
+ marshal ref="swiftInJson" />
+ <to uri="mock:result" />
+</route>
+----
+
+Most of the time, you won't need to declare the data format if you use
+the default options. In that case, you can declare the data format
+inline as shown below.
+
+== Marshal
+
+In this example, we marshal the messages read from a JMS queue in SWIFT format before storing the result into a file.
+
+[source,java]
+----
+from("jms://myqueue")
+ .marshal().swiftMt()
+ .to("file://data.bin");
+----
+
+In Spring DSL:
+
+[source,xml]
+----
+ <from uri="jms://myqueue">
+ <marshal>
+ <swiftMt/>
+ </marshal>
+ <to uri="file://data.bin"/>
+----
+
+== Unmarshal
+
+In this example, we unmarshal the content of a file to get SWIFT MT
+objects before processing it by the `newOrder` processor.
+
+[source,java]
+----
+from("file://data.bin")
+ .unmarshal().swiftMt()
+ .process("newOrder");
+----
+
+In Spring DSL:
+
+[source,xml]
+----
+ <from uri="file://data.bin">
+ <unmarshal>
+ <swiftMt/>
+ </unmarshal>
+ <to uri="bean:newOrder"/>
+----
+
+== Dependencies
+
+To use SWIFT MT in your Camel routes you need to add a dependency on
+*camel-swift* which implements this data format.
+
+If you use Maven you can just add the following to your pom.xml:
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-swift</artifactId>
+ <version>x.x.x</version> <!-- use the same version as your Camel core version -->
+</dependency>
+----
+
+
+include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-swift/src/main/docs/swiftMx-dataformat.adoc b/components/camel-swift/src/main/docs/swiftMx-dataformat.adoc
new file mode 100644
index 00000000000..283c3b44510
--- /dev/null
+++ b/components/camel-swift/src/main/docs/swiftMx-dataformat.adoc
@@ -0,0 +1,108 @@
+= SWIFT MX DataFormat
+:doctitle: SWIFT MX
+:shortname: swiftMx
+:artifactid: camel-swift
+:description: Encode and decode SWIFT MX messages.
+:since: 3.20
+:supportlevel: Preview
+
+*Since Camel {since}*
+
+The Swift MX data format is used to encode and decode Swift MX messages.
+
+== Options
+
+// dataformat options: START
+include::partial$dataformat-options.adoc[]
+// dataformat options: END
+
+In Spring DSL, you configure the data format using this tag:
+
+[source,xml]
+----
+<camelContext>
+ <dataFormats>
+ <swiftMx id="swiftInJson" writeInJson="true"/>
+ </dataFormats>
+ ...
+</camelContext>
+----
+
+Then you can use it later by its reference:
+
+[source,xml]
+----
+<route>
+ <from uri="direct:startEncode" />
+ <marshal ref="swiftInJson" />
+ <to uri="mock:result" />
+</route>
+----
+
+Most of the time, you won't need to declare the data format if you use
+the default options. In that case, you can declare the data format
+inline as shown below.
+
+== Marshal
+
+In this example, we marshal the messages read from a JMS queue in SWIFT format before storing the result into a file.
+
+[source,java]
+----
+from("jms://myqueue")
+ .marshal().swiftMx()
+ .to("file://data.bin");
+----
+
+In Spring DSL:
+
+[source,xml]
+----
+ <from uri="jms://myqueue">
+ <marshal>
+ <swiftMx/>
+ </marshal>
+ <to uri="file://data.bin"/>
+----
+
+== Unmarshal
+
+In this example, we unmarshal the content of a file to get SWIFT MX
+objects before processing it by the `newOrder` processor.
+
+[source,java]
+----
+from("file://data.bin")
+ .unmarshal().swiftMx()
+ .process("newOrder");
+----
+
+In Spring DSL:
+
+[source,xml]
+----
+ <from uri="file://data.bin">
+ <unmarshal>
+ <swiftMx/>
+ </unmarshal>
+ <to uri="bean:newOrder"/>
+----
+
+== Dependencies
+
+To use SWIFT MX in your Camel routes you need to add a dependency on
+*camel-swift* which implements this data format.
+
+If you use Maven you can just add the following to your pom.xml:
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-swift</artifactId>
+ <version>x.x.x</version> <!-- use the same version as your Camel core version -->
+</dependency>
+----
+
+
+include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mt/SwiftMtDataFormat.java b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mt/SwiftMtDataFormat.java
new file mode 100644
index 00000000000..5aacac46d74
--- /dev/null
+++ b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mt/SwiftMtDataFormat.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.swift.mt;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
+
+import com.prowidesoftware.JsonSerializable;
+import com.prowidesoftware.swift.model.mt.AbstractMT;
+import org.apache.camel.Exchange;
+import org.apache.camel.spi.DataFormat;
+import org.apache.camel.spi.DataFormatName;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.annotations.Dataformat;
+import org.apache.camel.support.service.ServiceSupport;
+
+/**
+ * {@code SwiftMtDataFormat} is a specific {@link DataFormat} leveraging
+ * <a href="https://github.com/prowide/prowide-core">Prowide Core</a> to encode and decode SWIFT MT messages.
+ */
+@Dataformat("swiftMt")
+@Metadata(firstVersion = "3.20.0", title = "Swift MT")
+public class SwiftMtDataFormat extends ServiceSupport implements DataFormat, DataFormatName {
+
+ /**
+ * The flag indicating that messages must be marshalled in a JSON format.
+ */
+ private boolean writeInJson;
+
+ /**
+ * Constructs a {@code SwiftMtDataFormat} with the default configuration.
+ */
+ public SwiftMtDataFormat() {
+ }
+
+ /**
+ * Constructs a {@code SwiftMtDataFormat} with the given parameter.
+ *
+ * @param writeInJson the flag indicating that messages must be marshalled in a JSON format.
+ */
+ public SwiftMtDataFormat(boolean writeInJson) {
+ this.writeInJson = writeInJson;
+ }
+
+ @Override
+ public String getDataFormatName() {
+ return "swiftMt";
+ }
+
+ @Override
+ public void marshal(Exchange exchange, Object object, OutputStream stream) throws Exception {
+ if (writeInJson) {
+ stream.write(((JsonSerializable) object).toJson().getBytes(StandardCharsets.UTF_8));
+ } else {
+ ((AbstractMT) object).write(stream);
+ }
+ }
+
+ @Override
+ public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
+ return AbstractMT.parse(stream);
+ }
+
+ /**
+ * @return {@code true} if messages must be marshalled in a JSON format, {@code false} otherwise.
+ */
+ public boolean isWriteInJson() {
+ return writeInJson;
+ }
+
+ public void setWriteInJson(boolean writeInJson) {
+ this.writeInJson = writeInJson;
+ }
+}
diff --git a/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/ReadConfiguration.java b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/ReadConfiguration.java
new file mode 100644
index 00000000000..676572182e8
--- /dev/null
+++ b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/ReadConfiguration.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.swift.mx;
+
+import com.prowidesoftware.swift.model.mx.MxReadConfiguration;
+import com.prowidesoftware.swift.model.mx.adapters.TypeAdaptersConfiguration;
+
+/**
+ * {@code ReadConfiguration} is a class for easy setup of a {@link MxReadConfiguration} in a Spring application
+ * configured in XML, because it provides the setters.
+ */
+public class ReadConfiguration extends MxReadConfiguration {
+
+ public TypeAdaptersConfiguration getAdapters() {
+ return adapters;
+ }
+
+ public void setAdapters(TypeAdaptersConfiguration adapters) {
+ this.adapters = adapters;
+ }
+}
diff --git a/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormat.java b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormat.java
new file mode 100644
index 00000000000..2e26c6f7f64
--- /dev/null
+++ b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/SwiftMxDataFormat.java
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.swift.mx;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
+
+import com.prowidesoftware.JsonSerializable;
+import com.prowidesoftware.swift.model.MxId;
+import com.prowidesoftware.swift.model.mx.AbstractMX;
+import com.prowidesoftware.swift.model.mx.MxReadConfiguration;
+import com.prowidesoftware.swift.model.mx.MxWriteConfiguration;
+import org.apache.camel.Exchange;
+import org.apache.camel.spi.DataFormat;
+import org.apache.camel.spi.DataFormatName;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.annotations.Dataformat;
+import org.apache.camel.support.ExchangeHelper;
+import org.apache.camel.support.service.ServiceSupport;
+
+/**
+ * {@code SwiftMxDataFormat} is a specific {@link DataFormat} leveraging
+ * <a href="https://github.com/prowide/prowide-iso20022">Prowide ISO 20022</a> to encode and decode SWIFT MX messages.
+ */
+@Dataformat("swiftMx")
+@Metadata(firstVersion = "3.20.0", title = "Swift MX")
+public class SwiftMxDataFormat extends ServiceSupport implements DataFormat, DataFormatName {
+ /**
+ * The specific configuration to use when marshalling a message. Ignored if {@code writeInJson} is set to
+ * {@code true}.
+ */
+ private MxWriteConfiguration writeConfig;
+ /**
+ * The flag indicating that messages must be marshalled in a JSON format. If {@code true}, the value of
+ * {@code writeConfig} is ignored.
+ */
+ private boolean writeInJson;
+ /**
+ * The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically
+ * detected from the namespace used.
+ */
+ private MxId readMessageId;
+ /**
+ * The specific configuration to use when unmarshalling an input stream.
+ */
+ private MxReadConfiguration readConfig;
+
+ /**
+ * Constructs a {@code SwiftMxDataFormat} with the default configuration.
+ */
+ public SwiftMxDataFormat() {
+ }
+
+ /**
+ * Constructs a {@code SwiftMxDataFormat} with the given parameters.
+ *
+ * @param writeInJson the flag indicating that messages must be marshalled in a JSON format.
+ * @param readMessageId the type of MX message to produce when unmarshalling an input stream. If not set, it will be
+ * automatically detected from the namespace used.
+ * @param readConfig the specific configuration to use when unmarshalling an input stream.
+ */
+ public SwiftMxDataFormat(boolean writeInJson, MxId readMessageId, MxReadConfiguration readConfig) {
+ this.writeInJson = writeInJson;
+ this.readMessageId = readMessageId;
+ this.readConfig = readConfig;
+ }
+
+ /**
+ * Constructs a {@code SwiftMxDataFormat} with the given parameters.
+ *
+ * @param writeConfig the specific configuration to use when marshalling a message.
+ * @param readMessageId the type of MX message to produce when unmarshalling an input stream. If not set, it will be
+ * automatically detected from the namespace used.
+ * @param readConfig the specific configuration to use when unmarshalling an input stream.
+ */
+ public SwiftMxDataFormat(MxWriteConfiguration writeConfig, MxId readMessageId, MxReadConfiguration readConfig) {
+ this.writeConfig = writeConfig;
+ this.readMessageId = readMessageId;
+ this.readConfig = readConfig;
+ }
+
+ @Override
+ public String getDataFormatName() {
+ return "swiftMx";
+ }
+
+ @Override
+ public void marshal(Exchange exchange, Object object, OutputStream stream) throws Exception {
+ final String output;
+ if (writeInJson) {
+ output = ((JsonSerializable) object).toJson();
+ } else {
+ output = ((AbstractMX) object).message(writeConfig);
+ }
+ stream.write(output.getBytes(StandardCharsets.UTF_8));
+ }
+
+ @Override
+ public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
+ return AbstractMX.parse(
+ new String(ExchangeHelper.convertToMandatoryType(exchange, byte[].class, stream), StandardCharsets.UTF_8),
+ readMessageId, readConfig);
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ if (writeConfig == null) {
+ writeConfig = new MxWriteConfiguration();
+ }
+ if (readConfig == null) {
+ readConfig = new MxReadConfiguration();
+ }
+ }
+
+ /**
+ * @return the specific configuration to use when marshalling a message. Ignored if {@code writeInJson} is set to
+ * {@code true}.
+ */
+ public MxWriteConfiguration getWriteConfig() {
+ return writeConfig;
+ }
+
+ public void setWriteConfig(Object writeConfig) {
+ if (writeConfig != null) {
+ if (writeConfig instanceof MxWriteConfiguration) {
+ this.writeConfig = (MxWriteConfiguration) writeConfig;
+ } else {
+ throw new IllegalArgumentException(
+ String.format("The argument for setWriteConfig should be subClass of %s",
+ MxWriteConfiguration.class.getName()));
+ }
+ }
+ }
+
+ /**
+ * @return the type of MX message to produce when unmarshalling an input stream. If not set, it will be
+ * automatically detected from the namespace used.
+ */
+ public MxId getReadMessageId() {
+ return readMessageId;
+ }
+
+ public void setReadMessageId(MxId readMessageId) {
+ this.readMessageId = readMessageId;
+ }
+
+ /**
+ * @return the specific configuration to use when unmarshalling an input stream.
+ */
+ public MxReadConfiguration getReadConfig() {
+ return readConfig;
+ }
+
+ public void setReadConfig(Object readConfig) {
+ if (readConfig != null) {
+ if (readConfig instanceof MxReadConfiguration) {
+ this.readConfig = (MxReadConfiguration) readConfig;
+ } else {
+ throw new IllegalArgumentException(
+ String.format("The argument for setReadConfig should be subClass of %s",
+ MxReadConfiguration.class.getName()));
+ }
+ }
+ }
+
+ /**
+ * @return {@code true} if messages must be marshalled in a JSON format, {@code false} otherwise.
+ */
+ public boolean isWriteInJson() {
+ return writeInJson;
+ }
+
+ public void setWriteInJson(boolean writeInJson) {
+ this.writeInJson = writeInJson;
+ }
+}
diff --git a/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/SwiftMxTypeConverters.java b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/SwiftMxTypeConverters.java
new file mode 100644
index 00000000000..4ac584570cc
--- /dev/null
+++ b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/SwiftMxTypeConverters.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.swift.mx;
+
+import java.nio.charset.StandardCharsets;
+
+import com.prowidesoftware.swift.model.MxId;
+import org.apache.camel.Converter;
+
+/**
+ * {@code SwiftMxTypeConverters} provide some basic {@link org.apache.camel.TypeConverter}s that could be needed when
+ * marshalling/unmarshalling SWIFT MX messages.
+ */
+@Converter(generateLoader = true)
+public final class SwiftMxTypeConverters {
+
+ private SwiftMxTypeConverters() {
+ // Helper class
+ }
+
+ @Converter
+ public static MxId toMxId(String namespace) {
+ return new MxId(namespace);
+ }
+
+ @Converter
+ public static MxId toMxId(byte[] namespace) {
+ return new MxId(new String(namespace, StandardCharsets.UTF_8));
+ }
+}
diff --git a/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/WriteConfiguration.java b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/WriteConfiguration.java
new file mode 100644
index 00000000000..779ba8da4d1
--- /dev/null
+++ b/components/camel-swift/src/main/java/org/apache/camel/dataformat/swift/mx/WriteConfiguration.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.swift.mx;
+
+import com.prowidesoftware.swift.model.mx.EscapeHandler;
+import com.prowidesoftware.swift.model.mx.MxWriteConfiguration;
+import com.prowidesoftware.swift.model.mx.adapters.TypeAdaptersConfiguration;
+
+/**
+ * {@code WriteConfiguration} is a class for easy setup of a {@link MxWriteConfiguration} in a Spring application
+ * configured in XML, because it provides the setters.
+ */
+public class WriteConfiguration extends MxWriteConfiguration {
+
+ public String getRootElement() {
+ return rootElement;
+ }
+
+ public void setRootElement(String rootElement) {
+ this.rootElement = rootElement;
+ }
+
+ public boolean isIncludeXMLDeclaration() {
+ return includeXMLDeclaration;
+ }
+
+ public void setIncludeXMLDeclaration(boolean includeXMLDeclaration) {
+ this.includeXMLDeclaration = includeXMLDeclaration;
+ }
+
+ public EscapeHandler getEscapeHandler() {
+ return escapeHandler;
+ }
+
+ public void setEscapeHandler(EscapeHandler escapeHandler) {
+ this.escapeHandler = escapeHandler;
+ }
+
+ public String getHeaderPrefix() {
+ return headerPrefix;
+ }
+
+ public void setHeaderPrefix(String headerPrefix) {
+ this.headerPrefix = headerPrefix;
+ }
+
+ public String getDocumentPrefix() {
+ return documentPrefix;
+ }
+
+ public void setDocumentPrefix(String documentPrefix) {
+ this.documentPrefix = documentPrefix;
+ }
+
+ public TypeAdaptersConfiguration getAdapters() {
+ return adapters;
+ }
+
+ public void setAdapters(TypeAdaptersConfiguration adapters) {
+ this.adapters = adapters;
+ }
+}
diff --git a/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mt/SpringSwiftMxDataFormatTest.java b/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mt/SpringSwiftMxDataFormatTest.java
new file mode 100644
index 00000000000..c9cec4d9144
--- /dev/null
+++ b/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mt/SpringSwiftMxDataFormatTest.java
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.swift.mt;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.prowidesoftware.swift.model.mx.MxCamt04800103;
+import com.prowidesoftware.swift.model.mx.MxPacs00800107;
+import com.prowidesoftware.swift.model.mx.sys.MxXsys01100102;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.dataformat.swift.mx.SwiftMxDataFormat;
+import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
+import org.apache.commons.io.IOUtils;
+import org.junit.jupiter.api.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * The unit test for {@link SwiftMxDataFormat} testing the XML DSL.
+ */
+class SpringSwiftMxDataFormatTest extends CamelSpringTestSupport {
+
+ @Test
+ void testUnmarshal() throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:unmarshal");
+ mockEndpoint.expectedMessageCount(1);
+
+ Object result
+ = template.requestBody("direct:unmarshal",
+ Files.readAllBytes(Paths.get("src/test/resources/mx/message1.xml")));
+ assertNotNull(result);
+ assertInstanceOf(MxCamt04800103.class, result);
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Test
+ void testUnmarshalFull() throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:unmarshalFull");
+ mockEndpoint.expectedMessageCount(1);
+
+ Object result
+ = template.requestBody("direct:unmarshalFull",
+ Files.readAllBytes(Paths.get("src/test/resources/mx/message3.xml")));
+ assertNotNull(result);
+ assertInstanceOf(MxXsys01100102.class, result);
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Test
+ void testMarshal() throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:marshal");
+ mockEndpoint.expectedMessageCount(1);
+
+ MxPacs00800107 message = MxPacs00800107.parse(Files.readString(Paths.get("src/test/resources/mx/message2.xml")));
+ Object result
+ = template.requestBody("direct:marshal", message);
+ assertNotNull(result);
+ assertInstanceOf(InputStream.class, result);
+ MxPacs00800107 actual = MxPacs00800107.parse(IOUtils.toString((InputStream) result, StandardCharsets.UTF_8));
+ assertEquals(message.message(), actual.message());
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Test
+ void testMarshalJson() throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:marshalJson");
+ mockEndpoint.expectedMessageCount(1);
+
+ MxPacs00800107 message = MxPacs00800107.parse(Files.readString(Paths.get("src/test/resources/mx/message2.xml")));
+ Object result
+ = template.requestBody("direct:marshalJson", message);
+ assertNotNull(result);
+ assertInstanceOf(InputStream.class, result);
+
+ ObjectMapper mapper = new ObjectMapper();
+ assertEquals(mapper.readTree(Files.readString(Paths.get("src/test/resources/mx/message2.json"))),
+ mapper.readTree((InputStream) result));
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Test
+ void testMarshalFull() throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:marshalFull");
+ mockEndpoint.expectedMessageCount(1);
+
+ MxPacs00800107 message = MxPacs00800107.parse(Files.readString(Paths.get("src/test/resources/mx/message2.xml")));
+ Object result
+ = template.requestBody("direct:marshalFull", message);
+ assertNotNull(result);
+ assertInstanceOf(InputStream.class, result);
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader((InputStream) result, StandardCharsets.UTF_8));
+ String line = reader.readLine();
+ assertFalse(line.contains("<?xml"), String.format("Should not start with the xml header, the first line was %s", line));
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Override
+ protected AbstractApplicationContext createApplicationContext() {
+ return new ClassPathXmlApplicationContext("routes/SpringSwiftMxDataFormatTest.xml");
+ }
+}
diff --git a/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mt/SwiftMxDataFormatTest.java b/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mt/SwiftMxDataFormatTest.java
new file mode 100644
index 00000000000..dd2473095d6
--- /dev/null
+++ b/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mt/SwiftMxDataFormatTest.java
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.swift.mt;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.prowidesoftware.swift.model.mx.MxCamt04800103;
+import com.prowidesoftware.swift.model.mx.MxPacs00800107;
+import com.prowidesoftware.swift.model.mx.MxReadConfiguration;
+import com.prowidesoftware.swift.model.mx.MxWriteConfiguration;
+import com.prowidesoftware.swift.model.mx.sys.MxXsys01100102;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.model.dataformat.SwiftMxDataFormat;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.apache.commons.io.IOUtils;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * The unit test for {@link org.apache.camel.dataformat.swift.mx.SwiftMxDataFormat} testing the Java DSL.
+ */
+class SwiftMxDataFormatTest extends CamelTestSupport {
+
+ @ParameterizedTest
+ @ValueSource(strings = { "", "dsl" })
+ void testUnmarshal(String mode) throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint(String.format("mock:unmarshal%s", mode));
+ mockEndpoint.expectedMessageCount(1);
+
+ Object result
+ = template.requestBody(String.format("direct:unmarshal%s", mode),
+ Files.readAllBytes(Paths.get("src/test/resources/mx/message1.xml")));
+ assertNotNull(result);
+ assertInstanceOf(MxCamt04800103.class, result);
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = { "", "dsl" })
+ void testUnmarshalFull(String mode) throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint(String.format("mock:unmarshalFull%s", mode));
+ mockEndpoint.expectedMessageCount(1);
+
+ Object result
+ = template.requestBody(String.format("direct:unmarshalFull%s", mode),
+ Files.readAllBytes(Paths.get("src/test/resources/mx/message3.xml")));
+ assertNotNull(result);
+ assertInstanceOf(MxXsys01100102.class, result);
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = { "", "dsl" })
+ void testMarshal(String mode) throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint(String.format("mock:marshal%s", mode));
+ mockEndpoint.expectedMessageCount(1);
+
+ MxPacs00800107 message = MxPacs00800107.parse(Files.readString(Paths.get("src/test/resources/mx/message2.xml")));
+ Object result
+ = template.requestBody(String.format("direct:marshal%s", mode), message);
+ assertNotNull(result);
+ assertInstanceOf(InputStream.class, result);
+ MxPacs00800107 actual = MxPacs00800107.parse(IOUtils.toString((InputStream) result, StandardCharsets.UTF_8));
+ assertEquals(message.message(), actual.message());
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = { "", "dsl" })
+ void testMarshalJson(String mode) throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint(String.format("mock:marshalJson%s", mode));
+ mockEndpoint.expectedMessageCount(1);
+
+ MxPacs00800107 message = MxPacs00800107.parse(Files.readString(Paths.get("src/test/resources/mx/message2.xml")));
+ Object result
+ = template.requestBody(String.format("direct:marshalJson%s", mode), message);
+ assertNotNull(result);
+ assertInstanceOf(InputStream.class, result);
+
+ ObjectMapper mapper = new ObjectMapper();
+ assertEquals(mapper.readTree(Files.readString(Paths.get("src/test/resources/mx/message2.json"))),
+ mapper.readTree((InputStream) result));
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = { "", "dsl" })
+ void testMarshalFull(String mode) throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint(String.format("mock:marshalFull%s", mode));
+ mockEndpoint.expectedMessageCount(1);
+
+ MxPacs00800107 message = MxPacs00800107.parse(Files.readString(Paths.get("src/test/resources/mx/message2.xml")));
+ Object result
+ = template.requestBody(String.format("direct:marshalFull%s", mode), message);
+ assertNotNull(result);
+ assertInstanceOf(InputStream.class, result);
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader((InputStream) result, StandardCharsets.UTF_8));
+ String line = reader.readLine();
+ assertFalse(line.contains("<?xml"), String.format("Should not start with the xml header, the first line was %s", line));
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:unmarshal").unmarshal(new SwiftMxDataFormat()).to("mock:unmarshal");
+ from("direct:unmarshaldsl").unmarshal().swiftMx().to("mock:unmarshaldsl");
+ MxReadConfiguration readConfig = new MxReadConfiguration();
+ from("direct:unmarshalFull")
+ .unmarshal(new SwiftMxDataFormat(false, "urn:swift:xsd:xsys.011.001.02", readConfig))
+ .to("mock:unmarshalFull");
+ from("direct:unmarshalFulldsl").unmarshal()
+ .swiftMx(false, "urn:swift:xsd:xsys.011.001.02", readConfig).to("mock:unmarshalFulldsl");
+ from("direct:marshal").marshal(new SwiftMxDataFormat()).to("mock:marshal");
+ from("direct:marshaldsl").marshal().swiftMx().to("mock:marshaldsl");
+ MxWriteConfiguration writeConfiguration = new MxWriteConfiguration();
+ writeConfiguration.includeXMLDeclaration = false;
+ from("direct:marshalFull").marshal(new SwiftMxDataFormat(writeConfiguration, null, null))
+ .to("mock:marshalFull");
+ from("direct:marshalFulldsl").marshal().swiftMx(writeConfiguration, null, null).to("mock:marshalFulldsl");
+ from("direct:marshalJson").marshal(new SwiftMxDataFormat(true)).to("mock:marshalJson");
+ from("direct:marshalJsondsl").marshal().swiftMx(true).to("mock:marshalJsondsl");
+ }
+ };
+ }
+}
diff --git a/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mx/SpringSwiftMtDataFormatTest.java b/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mx/SpringSwiftMtDataFormatTest.java
new file mode 100644
index 00000000000..6bafc5125ce
--- /dev/null
+++ b/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mx/SpringSwiftMtDataFormatTest.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.swift.mx;
+
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.prowidesoftware.swift.model.mt.mt1xx.MT103;
+import com.prowidesoftware.swift.model.mt.mt5xx.MT515;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.dataformat.swift.mt.SwiftMtDataFormat;
+import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * The unit test for {@link SwiftMtDataFormat} testing the XML DSL.
+ */
+class SpringSwiftMtDataFormatTest extends CamelSpringTestSupport {
+
+ @Test
+ void testUnmarshal() throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:unmarshal");
+ mockEndpoint.expectedMessageCount(1);
+
+ Object result
+ = template.requestBody("direct:unmarshal", Files.readAllBytes(Paths.get("src/test/resources/mt/message1.txt")));
+ assertNotNull(result);
+ assertInstanceOf(MT515.class, result);
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Test
+ void testMarshal() throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:marshal");
+ mockEndpoint.expectedMessageCount(1);
+
+ MT103 message = MT103.parse(Files.readString(Paths.get("src/test/resources/mt/message2.txt")));
+
+ Object result = template.requestBody("direct:marshal", message);
+ assertNotNull(result);
+ assertInstanceOf(InputStream.class, result);
+ MT103 actual = MT103.parse((InputStream) result);
+ assertEquals(message.message(), actual.message());
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Test
+ void testMarshalJson() throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:marshalJson");
+ mockEndpoint.expectedMessageCount(1);
+
+ MT103 message = MT103.parse(Files.readString(Paths.get("src/test/resources/mt/message2.txt")));
+
+ Object result = template.requestBody("direct:marshalJson", message);
+ assertNotNull(result);
+ assertInstanceOf(InputStream.class, result);
+
+ ObjectMapper mapper = new ObjectMapper();
+ assertEquals(mapper.readTree(Files.readString(Paths.get("src/test/resources/mt/message2.json"))),
+ mapper.readTree((InputStream) result));
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Override
+ protected AbstractApplicationContext createApplicationContext() {
+ return new ClassPathXmlApplicationContext("routes/SpringSwiftMtDataFormatTest.xml");
+ }
+}
diff --git a/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mx/SwiftMtDataFormatTest.java b/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mx/SwiftMtDataFormatTest.java
new file mode 100644
index 00000000000..dac8743437f
--- /dev/null
+++ b/components/camel-swift/src/test/java/org/apache/camel/dataformat/swift/mx/SwiftMtDataFormatTest.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.swift.mx;
+
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.prowidesoftware.swift.model.mt.mt1xx.MT103;
+import com.prowidesoftware.swift.model.mt.mt5xx.MT515;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.model.dataformat.SwiftMtDataFormat;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * The unit test for {@link org.apache.camel.dataformat.swift.mt.SwiftMtDataFormat} testing the Java DSL.
+ */
+class SwiftMtDataFormatTest extends CamelTestSupport {
+
+ @ParameterizedTest
+ @ValueSource(strings = { "", "dsl" })
+ void testUnmarshal(String mode) throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint(String.format("mock:unmarshal%s", mode));
+ mockEndpoint.expectedMessageCount(1);
+
+ Object result
+ = template.requestBody(String.format("direct:unmarshal%s", mode),
+ Files.readAllBytes(Paths.get("src/test/resources/mt/message1.txt")));
+ assertNotNull(result);
+ assertInstanceOf(MT515.class, result);
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = { "", "dsl" })
+ void testMarshal(String mode) throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint(String.format("mock:marshal%s", mode));
+ mockEndpoint.expectedMessageCount(1);
+
+ MT103 message = MT103.parse(Files.readString(Paths.get("src/test/resources/mt/message2.txt")));
+
+ Object result
+ = template.requestBody(String.format("direct:marshal%s", mode), message);
+ assertNotNull(result);
+ assertInstanceOf(InputStream.class, result);
+ MT103 actual = MT103.parse((InputStream) result);
+ assertEquals(message.message(), actual.message());
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = { "", "dsl" })
+ void testMarshalJson(String mode) throws Exception {
+ MockEndpoint mockEndpoint = getMockEndpoint(String.format("mock:marshalJson%s", mode));
+ mockEndpoint.expectedMessageCount(1);
+
+ MT103 message = MT103.parse(Files.readString(Paths.get("src/test/resources/mt/message2.txt")));
+
+ Object result
+ = template.requestBody(String.format("direct:marshalJson%s", mode), message);
+ assertNotNull(result);
+ assertInstanceOf(InputStream.class, result);
+
+ ObjectMapper mapper = new ObjectMapper();
+ assertEquals(mapper.readTree(Files.readString(Paths.get("src/test/resources/mt/message2.json"))),
+ mapper.readTree((InputStream) result));
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:unmarshal").unmarshal(new SwiftMtDataFormat()).to("mock:unmarshal");
+ from("direct:unmarshaldsl").unmarshal().swiftMt().to("mock:unmarshaldsl");
+ from("direct:marshal").marshal(new SwiftMtDataFormat()).to("mock:marshal");
+ from("direct:marshaldsl").marshal().swiftMt().to("mock:marshaldsl");
+ from("direct:marshalJson").marshal(new SwiftMtDataFormat("true")).to("mock:marshalJson");
+ from("direct:marshalJsondsl").marshal().swiftMt(true).to("mock:marshalJsondsl");
+ }
+ };
+ }
+}
diff --git a/components/camel-swift/src/test/resources/log4j2.properties b/components/camel-swift/src/test/resources/log4j2.properties
new file mode 100644
index 00000000000..452a0d1dbee
--- /dev/null
+++ b/components/camel-swift/src/test/resources/log4j2.properties
@@ -0,0 +1,28 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+appender.console.type = Console
+appender.console.name = console
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d %-5p %c{1} - %m %n
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = target/camel-swift-test.log
+appender.file.layout.type = PatternLayout
+appender.file.layout.pattern = %d %-5p %c{1} - %m %n
+rootLogger.level = info
+rootLogger.appenderRef.file.ref = file
diff --git a/components/camel-swift/src/test/resources/mt/message1.txt b/components/camel-swift/src/test/resources/mt/message1.txt
new file mode 100644
index 00000000000..a474f5c31b6
--- /dev/null
+++ b/components/camel-swift/src/test/resources/mt/message1.txt
@@ -0,0 +1,55 @@
+{1:F01AAAAIT2TAXXX8236800622}{2:O5151648131111BBBBLULLCFND22278474801311111648N}{4:
+:16R:GENL
+:20C::SEME//FRTJ123456789
+:23G:NEWM
+:22F::TRTR//TRAD
+:16R:LINK
+:13A::LINK//514
+:20C::RELA//0405D012AA
+:16S:LINK
+:16S:GENL
+:16R:CONFDET
+:98A::TRAD//20210112
+:98A::SETT//20210117
+:90A::DEAL//PRCT/101,001283
+:22F::PRIC//AVER
+:22H::PAYM//APMT
+:22H::BUSE//BUYI
+:16R:CONFPRTY
+:95P::INVE//FUNANIC1
+:16S:CONFPRTY
+:16R:CONFPRTY
+:95P::BUYR//MGTCDE55
+:16S:CONFPRTY
+:16R:CONFPRTY
+:95P::SELL//CFPIDEFF
+:16S:CONFPRTY
+:36B::CONF//FAMT/4000000,
+:35B:ISIN GB0123412345
+:16S:CONFDET
+:16R:SETDET
+:22F::SETR//TRAD
+:16R:SETPRTY
+:95R::DEAG/CRST/111
+:16S:SETPRTY
+:16R:SETPRTY
+:95P::SELL//CFPIDEFF
+:97A::SAFE//1234567
+:16S:SETPRTY
+:16R:SETPRTY
+:95P::PSET//CRSTGB22
+:16S:SETPRTY
+:16R:AMT
+:19A::DEAL//GBP4040051,32
+:16S:AMT
+:16R:AMT
+:19A::ACRU//GBP7000,
+:16S:AMT
+:16R:AMT
+:19A::EXEC//GBP100,
+:16S:AMT
+:16R:AMT
+:19A::SETT//GBP4047151,32
+:16S:AMT
+:16S:SETDET
+-}
diff --git a/components/camel-swift/src/test/resources/mt/message2.json b/components/camel-swift/src/test/resources/mt/message2.json
new file mode 100644
index 00000000000..f89ae62860f
--- /dev/null
+++ b/components/camel-swift/src/test/resources/mt/message2.json
@@ -0,0 +1,118 @@
+{
+ "type": "MT",
+ "basicHeaderBlock": {
+ "applicationId": "F",
+ "serviceId": "01",
+ "logicalTerminal": "BICFOOYYAXXX",
+ "sessionNumber": "8683",
+ "sequenceNumber": "497519"
+ },
+ "applicationHeaderBlock": {
+ "senderInputTime": "1535",
+ "MIRDate": "051028",
+ "MIRLogicalTerminal": "ESPBESMMAXXX",
+ "MIRSessionNumber": "5423",
+ "MIRSequenceNumber": "752247",
+ "receiverOutputDate": "051028",
+ "receiverOutputTime": "1535",
+ "messagePriority": "N",
+ "messageType": "103",
+ "blockType": "O",
+ "direction": "O"
+ },
+ "userHeaderBlock": {
+ "fields": [
+ {
+ "name": "113",
+ "bankingPriority": "ROMF"
+ },
+ {
+ "name": "108",
+ "mUR": "0510280182794665"
+ },
+ {
+ "name": "119",
+ "validationFlag": "STP"
+ }
+ ]
+ },
+ "textBlock": {
+ "fields": [
+ {
+ "name": "20",
+ "reference": "0061350113089908"
+ },
+ {
+ "name": "13C",
+ "code": "RNCTIME",
+ "timeIndication": "1534",
+ "sign": "+",
+ "timeOffset": "0000"
+ },
+ {
+ "name": "23B",
+ "type": "CRED"
+ },
+ {
+ "name": "23E",
+ "instructionCode": "SDVA"
+ },
+ {
+ "name": "32A",
+ "date": "061028",
+ "currency": "EUR",
+ "amount": "100000,"
+ },
+ {
+ "name": "33B",
+ "currency": "EUR",
+ "amount": "100000,"
+ },
+ {
+ "name": "50K",
+ "account": "12345678",
+ "nameAndAddress": "AGENTES DE BOLSA FOO AGENCIA",
+ "nameAndAddress2": "AV XXXXX 123 BIS 9 PL",
+ "nameAndAddress3": "12345 BARCELONA"
+ },
+ {
+ "name": "52A",
+ "account": "2337",
+ "identifierCode": "FOOAESMMXXX"
+ },
+ {
+ "name": "53A",
+ "identifierCode": "FOOAESMMXXX"
+ },
+ {
+ "name": "57A",
+ "identifierCode": "BICFOOYYXXX"
+ },
+ {
+ "name": "59",
+ "account": "ES0123456789012345671234",
+ "nameAndAddress": "FOO AGENTES DE BOLSA ASOC"
+ },
+ {
+ "name": "71A",
+ "code": "OUR"
+ },
+ {
+ "name": "72",
+ "narrative": "/BNF/TRANSF. BCO. FOO"
+ }
+ ]
+ },
+ "trailerBlock": {
+ "fields": [
+ {
+ "name": "MAC",
+ "value": "88B4F929"
+ },
+ {
+ "name": "CHK",
+ "value": "22EF370A4073"
+ }
+ ]
+ }
+}
diff --git a/components/camel-swift/src/test/resources/mt/message2.txt b/components/camel-swift/src/test/resources/mt/message2.txt
new file mode 100644
index 00000000000..df5efc8303d
--- /dev/null
+++ b/components/camel-swift/src/test/resources/mt/message2.txt
@@ -0,0 +1,20 @@
+{1:F01BICFOOYYAXXX8683497519}{2:O1031535051028ESPBESMMAXXX54237522470510281535N}{3:{113:ROMF}{108:0510280182794665}{119:STP}}{4:
+:20:0061350113089908
+:13C:/RNCTIME/1534+0000
+:23B:CRED
+:23E:SDVA
+:32A:061028EUR100000,
+:33B:EUR100000,
+:50K:/12345678
+AGENTES DE BOLSA FOO AGENCIA
+AV XXXXX 123 BIS 9 PL
+12345 BARCELONA
+:52A:/2337
+FOOAESMMXXX
+:53A:FOOAESMMXXX
+:57A:BICFOOYYXXX
+:59:/ES0123456789012345671234
+FOO AGENTES DE BOLSA ASOC
+:71A:OUR
+:72:/BNF/TRANSF. BCO. FOO
+-}{5:{MAC:88B4F929}{CHK:22EF370A4073}}
diff --git a/components/camel-swift/src/test/resources/mx/message1.xml b/components/camel-swift/src/test/resources/mx/message1.xml
new file mode 100644
index 00000000000..919760d442e
--- /dev/null
+++ b/components/camel-swift/src/test/resources/mx/message1.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<Doc:Document xmlns:Doc="urn:swift:xsd:camt.048.001.03" xmlns:xsi="httDoc://www.w3.org/2001/XMLSchema-instance">
+ <Doc:ModfyRsvatn>
+ <Doc:MsgHdr>
+ <Doc:MsgId>001</Doc:MsgId>
+ </Doc:MsgHdr>
+ <Doc:RsvatnId>
+ <Doc:Cur>
+ <Doc:Tp>
+ <Doc:Cd>CARE</Doc:Cd>
+ </Doc:Tp>
+ </Doc:Cur>
+ </Doc:RsvatnId>
+ <Doc:NewRsvatnValSet>
+ <Doc:Amt>
+ <Doc:AmtWthtCcy>1234.0</Doc:AmtWthtCcy>
+ </Doc:Amt>
+ </Doc:NewRsvatnValSet>
+ </Doc:ModfyRsvatn>
+</Doc:Document>
diff --git a/components/camel-swift/src/test/resources/mx/message2.json b/components/camel-swift/src/test/resources/mx/message2.json
new file mode 100644
index 00000000000..7daaa4b792d
--- /dev/null
+++ b/components/camel-swift/src/test/resources/mx/message2.json
@@ -0,0 +1,169 @@
+{
+ "fiToFICstmrCdtTrf": {
+ "grpHdr": {
+ "msgId": "823823423",
+ "creDtTm": {
+ "year": 2019,
+ "month": 10,
+ "day": 19,
+ "timezone": -2147483648,
+ "hour": 21,
+ "minute": 0,
+ "second": 45
+ },
+ "btchBookg": false,
+ "nbOfTxs": "1",
+ "ctrlSum": 10000,
+ "ttlIntrBkSttlmAmt": {
+ "value": 10000,
+ "ccy": "USD"
+ },
+ "intrBkSttlmDt": {
+ "year": 2019,
+ "month": 10,
+ "day": 28,
+ "timezone": -2147483648,
+ "hour": -2147483648,
+ "minute": -2147483648,
+ "second": -2147483648
+ },
+ "sttlmInf": {
+ "sttlmMtd": "INDA"
+ },
+ "instgAgt": {
+ "finInstnId": {
+ "bicfi": "CITTGB2LPBG",
+ "nm": "Lionel Messi",
+ "othr": {
+ "id": "2342342342",
+ "issr": "FOOISSUER"
+ }
+ }
+ },
+ "instdAgt": {
+ "finInstnId": {
+ "bicfi": "ICBCUS4CXXX",
+ "nm": "Manu Ginobili",
+ "pstlAdr": {
+ "adrTp": "PBOX",
+ "dept": "1",
+ "subDept": "DFGH",
+ "strtNm": "My Street",
+ "bldgNb": "1122",
+ "pstCd": "10002",
+ "twnNm": "Los Angeles",
+ "ctrySubDvsn": "ABCD"
+ }
+ }
+ }
+ },
+ "cdtTrfTxInf": [
+ {
+ "pmtId": {
+ "instrId": "2233445566",
+ "endToEndId": "987654321987654321",
+ "txId": "123456789",
+ "clrSysRef": "SDSDS333"
+ },
+ "intrBkSttlmAmt": {
+ "value": 5000,
+ "ccy": "USD"
+ },
+ "intrBkSttlmDt": {
+ "year": 2019,
+ "month": 7,
+ "day": 31,
+ "timezone": -2147483648,
+ "hour": -2147483648,
+ "minute": -2147483648,
+ "second": -2147483648
+ },
+ "sttlmPrty": "URGT",
+ "accptncDtTm": {
+ "year": 2019,
+ "month": 4,
+ "day": 28,
+ "timezone": -2147483648,
+ "hour": 20,
+ "minute": 54,
+ "second": 39
+ },
+ "poolgAdjstmntDt": {
+ "year": 2019,
+ "month": 4,
+ "day": 29,
+ "timezone": -2147483648,
+ "hour": -2147483648,
+ "minute": -2147483648,
+ "second": -2147483648
+ },
+ "instdAmt": {
+ "value": 5000,
+ "ccy": "USD"
+ },
+ "chrgBr": "SHAR",
+ "dbtr": {
+ "nm": "Jhon Doe",
+ "pstlAdr": {
+ "adrTp": "HOME",
+ "dept": "ABCD",
+ "subDept": "1",
+ "strtNm": "Foo Street",
+ "bldgNb": "1",
+ "pstCd": "1234",
+ "twnNm": "Buenos Aires",
+ "ctrySubDvsn": "CABA",
+ "ctry": "AR"
+ },
+ "ctryOfRes": "AR"
+ },
+ "dbtrAgt": {
+ "finInstnId": {
+ "bicfi": "ITUSUSP1XXX",
+ "nm": "Foo Corp"
+ }
+ },
+ "cdtrAgt": {
+ "finInstnId": {
+ "bicfi": "USTBUS31XXX"
+ }
+ },
+ "cdtr": {
+ "nm": "Mike Smith"
+ }
+ }
+ ]
+ },
+ "appHdr": {
+ "fr": {
+ "fiId": {
+ "finInstnId": {
+ "bicfi": "ABCDUS33XXX"
+ }
+ }
+ },
+ "to": {
+ "fiId": {
+ "finInstnId": {
+ "bicfi": "EFGHUS33XXX"
+ }
+ }
+ },
+ "bizMsgIdr": "12312312312",
+ "msgDefIdr": "pacs.008.001.07",
+ "creDt": {
+ "year": 2019,
+ "month": 10,
+ "day": 19,
+ "timezone": 0,
+ "hour": 20,
+ "minute": 53,
+ "second": 13
+ },
+ "pssblDplct": false,
+ "namespace": "urn:iso:std:iso:20022:tech:xsd:head.001.001.01"
+ },
+ "type": "MX",
+ "@xmlns": "urn:iso:std:iso:20022:tech:xsd:pacs.008.001.07",
+ "identifier": "pacs.008.001.07"
+}
diff --git a/components/camel-swift/src/test/resources/mx/message2.xml b/components/camel-swift/src/test/resources/mx/message2.xml
new file mode 100644
index 00000000000..9989c5209c3
--- /dev/null
+++ b/components/camel-swift/src/test/resources/mx/message2.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<message>
+ <AppHdr xmlns='urn:iso:std:iso:20022:tech:xsd:head.001.001.01'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <Fr>
+ <FIId>
+ <FinInstnId>
+ <BICFI>ABCDUS33XXX</BICFI>
+ </FinInstnId>
+ </FIId>
+ </Fr>
+ <To>
+ <FIId>
+ <FinInstnId>
+ <BICFI>EFGHUS33XXX</BICFI>
+ </FinInstnId>
+ </FIId>
+ </To>
+ <BizMsgIdr>12312312312</BizMsgIdr>
+ <MsgDefIdr>pacs.008.001.07</MsgDefIdr>
+ <CreDt>2019-10-19T20:53:13Z</CreDt>
+ <PssblDplct>false</PssblDplct>
+ </AppHdr>
+ <Document xmlns='urn:iso:std:iso:20022:tech:xsd:pacs.008.001.07'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <FIToFICstmrCdtTrf>
+ <GrpHdr>
+ <MsgId>823823423</MsgId>
+ <CreDtTm>2019-10-19T21:00:45</CreDtTm>
+ <BtchBookg>false</BtchBookg>
+ <NbOfTxs>1</NbOfTxs>
+ <CtrlSum>10000</CtrlSum>
+ <TtlIntrBkSttlmAmt Ccy='USD'>10000</TtlIntrBkSttlmAmt>
+ <IntrBkSttlmDt>2019-10-28</IntrBkSttlmDt>
+ <SttlmInf>
+ <SttlmMtd>INDA</SttlmMtd>
+ </SttlmInf>
+ <InstgAgt>
+ <FinInstnId>
+ <BICFI>CITTGB2LPBG</BICFI>
+ <Nm>Lionel Messi</Nm>
+ <Othr>
+ <Id>2342342342</Id>
+ <Issr>FOOISSUER</Issr>
+ </Othr>
+ </FinInstnId>
+ </InstgAgt>
+ <InstdAgt>
+ <FinInstnId>
+ <BICFI>ICBCUS4CXXX</BICFI>
+ <Nm>Manu Ginobili</Nm>
+ <PstlAdr>
+ <AdrTp>PBOX</AdrTp>
+ <Dept>1</Dept>
+ <SubDept>DFGH</SubDept>
+ <StrtNm>My Street</StrtNm>
+ <BldgNb>1122</BldgNb>
+ <PstCd>10002</PstCd>
+ <TwnNm>Los Angeles</TwnNm>
+ <CtrySubDvsn>ABCD</CtrySubDvsn>
+ </PstlAdr>
+ </FinInstnId>
+ </InstdAgt>
+ </GrpHdr>
+ <CdtTrfTxInf>
+ <PmtId>
+ <InstrId>2233445566</InstrId>
+ <EndToEndId>987654321987654321</EndToEndId>
+ <TxId>123456789</TxId>
+ <ClrSysRef>SDSDS333</ClrSysRef>
+ </PmtId>
+ <IntrBkSttlmAmt Ccy='USD'>5000</IntrBkSttlmAmt>
+ <IntrBkSttlmDt>2019-07-31</IntrBkSttlmDt>
+ <SttlmPrty>URGT</SttlmPrty>
+ <AccptncDtTm>2019-04-28T20:54:39</AccptncDtTm>
+ <PoolgAdjstmntDt>2019-04-29</PoolgAdjstmntDt>
+ <InstdAmt Ccy='USD'>5000</InstdAmt>
+ <ChrgBr>SHAR</ChrgBr>
+ <Dbtr>
+ <Nm>Jhon Doe</Nm>
+ <PstlAdr>
+ <AdrTp>HOME</AdrTp>
+ <Dept>ABCD</Dept>
+ <SubDept>1</SubDept>
+ <StrtNm>Foo Street</StrtNm>
+ <BldgNb>1</BldgNb>
+ <PstCd>1234</PstCd>
+ <TwnNm>Buenos Aires</TwnNm>
+ <CtrySubDvsn>CABA</CtrySubDvsn>
+ <Ctry>AR</Ctry>
+ </PstlAdr>
+ <CtryOfRes>AR</CtryOfRes>
+ </Dbtr>
+ <DbtrAgt>
+ <FinInstnId>
+ <BICFI>ITUSUSP1XXX</BICFI>
+ <Nm>Foo Corp</Nm>
+ </FinInstnId>
+ </DbtrAgt>
+ <CdtrAgt>
+ <FinInstnId>
+ <BICFI>USTBUS31XXX</BICFI>
+ </FinInstnId>
+ </CdtrAgt>
+ <Cdtr>
+ <Nm>Mike Smith</Nm>
+ </Cdtr>
+ </CdtTrfTxInf>
+ </FIToFICstmrCdtTrf>
+ </Document>
+</message>
diff --git a/components/camel-swift/src/test/resources/mx/message3.xml b/components/camel-swift/src/test/resources/mx/message3.xml
new file mode 100644
index 00000000000..d03d476645a
--- /dev/null
+++ b/components/camel-swift/src/test/resources/mx/message3.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<Doc:Document xmlns:Doc="urn:swift:xsd:xsys.011.001.02" xmlns:Sw="urn:swift:snl:ns.Sw"
+ xmlns:SwInt="urn:swift:snl:ns.SwInt" xmlns:SwGbl="urn:swift:snl:ns.SwGbl">
+ <Doc:xsys.011.001.02>
+ <Doc:DlvryNtfctn>
+ <Sw:SnFRef>swf00000-2020-07-28T15:11:11.123456Z</Sw:SnFRef>
+ <Sw:SnFRefType>InterAct</Sw:SnFRefType>
+ <Sw:AcceptStatus>Accepted</Sw:AcceptStatus>
+ <Sw:DeliveryTime>2020-07-28T15:11:08Z</Sw:DeliveryTime>
+ <Sw:AckSwiftTime>2020-07-28T15:11:08Z</Sw:AckSwiftTime>
+ <Sw:FileRequestHeader>
+ <SwInt:Requestor>cn=gtxdev,o=rtbsgb2l,o=swift</SwInt:Requestor>
+ <SwInt:Responder>cn=gtxdev,o=rtbsgb2l,o=swift</SwInt:Responder>
+ <SwInt:Service>swift.finplus!pc</SwInt:Service>
+ <SwInt:RequestType>seev.047.001.01</SwInt:RequestType>
+ <SwInt:Priority>Normal</SwInt:Priority>
+ <SwInt:RequestRef>FOO123456</SwInt:RequestRef>
+ </Sw:FileRequestHeader>
+ <Doc:Xtnsn>
+ <Doc:PlcAndNm>PlaceAndName</Doc:PlcAndNm>
+ <Doc:XtnsnEnvlp>XtnsnEnvlp</Doc:XtnsnEnvlp>
+ </Doc:Xtnsn>
+ </Doc:DlvryNtfctn>
+ </Doc:xsys.011.001.02>
+</Doc:Document>
\ No newline at end of file
diff --git a/components/camel-swift/src/test/resources/routes/SpringSwiftMtDataFormatTest.xml b/components/camel-swift/src/test/resources/routes/SpringSwiftMtDataFormatTest.xml
new file mode 100644
index 00000000000..def669206fd
--- /dev/null
+++ b/components/camel-swift/src/test/resources/routes/SpringSwiftMtDataFormatTest.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+ <!-- START SNIPPET: e1 -->
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="direct:unmarshal"/>
+ <unmarshal>
+ <swiftMt />
+ </unmarshal>
+ <to uri="mock:unmarshal"/>
+ </route>
+ <route>
+ <from uri="direct:marshal"/>
+ <marshal>
+ <swiftMt />
+ </marshal>
+ <to uri="mock:marshal"/>
+ </route>
+ <route>
+ <from uri="direct:marshalJson"/>
+ <marshal>
+ <swiftMt writeInJson="true"/>
+ </marshal>
+ <to uri="mock:marshalJson"/>
+ </route>
+ </camelContext>
+ <!-- END SNIPPET: e1 -->
+
+</beans>
diff --git a/components/camel-swift/src/test/resources/routes/SpringSwiftMxDataFormatTest.xml b/components/camel-swift/src/test/resources/routes/SpringSwiftMxDataFormatTest.xml
new file mode 100644
index 00000000000..76f1bfd87f6
--- /dev/null
+++ b/components/camel-swift/src/test/resources/routes/SpringSwiftMxDataFormatTest.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+ <bean id="readConfig" class="org.apache.camel.dataformat.swift.mx.ReadConfiguration">
+ </bean>
+
+ <bean id="writeConfig" class="org.apache.camel.dataformat.swift.mx.WriteConfiguration">
+ <property name="includeXMLDeclaration" value="false"/>
+ </bean>
+
+ <!-- START SNIPPET: e1 -->
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="direct:unmarshal"/>
+ <unmarshal>
+ <swiftMx />
+ </unmarshal>
+ <to uri="mock:unmarshal"/>
+ </route>
+ <route>
+ <from uri="direct:unmarshalFull"/>
+ <unmarshal>
+ <swiftMx writeInJson="false" readMessageId="urn:swift:xsd:xsys.011.001.02" readConfigRef="readConfig" />
+ </unmarshal>
+ <to uri="mock:unmarshalFull"/>
+ </route>
+ <route>
+ <from uri="direct:marshal"/>
+ <marshal>
+ <swiftMx />
+ </marshal>
+ <to uri="mock:marshal"/>
+ </route>
+ <route>
+ <from uri="direct:marshalFull"/>
+ <marshal>
+ <swiftMx writeConfigRef="writeConfig"/>
+ </marshal>
+ <to uri="mock:marshalFull"/>
+ </route>
+ <route>
+ <from uri="direct:marshalJson"/>
+ <marshal>
+ <swiftMx writeInJson="true"/>
+ </marshal>
+ <to uri="mock:marshalJson"/>
+ </route>
+ </camelContext>
+ <!-- END SNIPPET: e1 -->
+
+</beans>
diff --git a/components/pom.xml b/components/pom.xml
index 36f073209ff..a51d8904b9a 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -306,6 +306,7 @@
<module>camel-stringtemplate</module>
<module>camel-stitch</module>
<module>camel-swagger-java</module>
+ <module>camel-swift</module>
<module>camel-openapi-java</module>
<module>camel-syslog</module>
<module>camel-tarfile</module>
diff --git a/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties b/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties
index e354bc78a1d..51705e5367c 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties
+++ b/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties
@@ -180,6 +180,8 @@ step
sticky
stop
stream-config
+swiftMt
+swiftMx
syslog
tarFile
templateBean
diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/dataFormats.json b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/dataFormats.json
index 49515239ef2..f3512e463ec 100644
--- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/dataFormats.json
+++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/dataFormats.json
@@ -12,6 +12,6 @@
"output": false
},
"properties": {
- "dataFormats": { "kind": "element", "displayName": "Data Formats", "required": true, "type": "array", "javaType": "java.util.List<org.apache.camel.model.DataFormatDefinition>", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "syslog", "tarFile", "thrift", "tidyM [...]
+ "dataFormats": { "kind": "element", "displayName": "Data Formats", "required": true, "type": "array", "javaType": "java.util.List<org.apache.camel.model.DataFormatDefinition>", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarF [...]
}
}
diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index
index e63b82393ff..91eb2aedfbe 100644
--- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index
+++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/jaxb.index
@@ -32,6 +32,8 @@ ProtobufDataFormat
ProtobufLibrary
RssDataFormat
SoapDataFormat
+SwiftMtDataFormat
+SwiftMxDataFormat
SyslogDataFormat
TarFileDataFormat
ThriftDataFormat
diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/swiftMt.json b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/swiftMt.json
new file mode 100644
index 00000000000..0a6697f0504
--- /dev/null
+++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/swiftMt.json
@@ -0,0 +1,19 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "swiftMt",
+ "title": "SWIFT MT",
+ "description": "Encode and decode SWIFT MT messages.",
+ "deprecated": false,
+ "firstVersion": "3.20.0",
+ "label": "dataformat,transformation,swift,mt",
+ "javaType": "org.apache.camel.model.dataformat.SwiftMtDataFormat",
+ "abstract": false,
+ "input": false,
+ "output": false
+ },
+ "properties": {
+ "writeInJson": { "kind": "attribute", "displayName": "Write In Json", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." },
+ "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }
+ }
+}
diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/swiftMx.json b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/swiftMx.json
new file mode 100644
index 00000000000..8643814e47d
--- /dev/null
+++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/dataformat/swiftMx.json
@@ -0,0 +1,22 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "swiftMx",
+ "title": "SWIFT MX",
+ "description": "Encode and decode SWIFT MX messages.",
+ "deprecated": false,
+ "firstVersion": "3.20.0",
+ "label": "dataformat,transformation,swift,mx",
+ "javaType": "org.apache.camel.model.dataformat.SwiftMxDataFormat",
+ "abstract": false,
+ "input": false,
+ "output": false
+ },
+ "properties": {
+ "writeConfigRef": { "kind": "attribute", "displayName": "Write Config Ref", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when marshalling a message to lookup from the registry." },
+ "writeInJson": { "kind": "attribute", "displayName": "Write In Json", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "The flag indicating that messages must be marshalled in a JSON format." },
+ "readMessageId": { "kind": "attribute", "displayName": "Read Message Id", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used." },
+ "readConfigRef": { "kind": "attribute", "displayName": "Read Config Ref", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry." },
+ "id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }
+ }
+}
diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/marshal.json b/core/camel-core-model/src/generated/resources/org/apache/camel/model/marshal.json
index 1a33084eccb..c290002203d 100644
--- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/marshal.json
+++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/marshal.json
@@ -12,7 +12,7 @@
"output": false
},
"properties": {
- "dataFormatType": { "kind": "element", "displayName": "Data Format Type", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "syslog", "tarFile", "thrift", "tidyMarkup", [...]
+ "dataFormatType": { "kind": "element", "displayName": "Data Format Type", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "t [...]
"disabled": { "kind": "attribute", "displayName": "Disabled", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of this node" },
"description": { "kind": "element", "displayName": "Description", "required": false, "type": "object", "javaType": "org.apache.camel.model.DescriptionDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the description of this node" }
diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/unmarshal.json b/core/camel-core-model/src/generated/resources/org/apache/camel/model/unmarshal.json
index 84ae283857f..45dccff325a 100644
--- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/unmarshal.json
+++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/unmarshal.json
@@ -12,7 +12,7 @@
"output": false
},
"properties": {
- "dataFormatType": { "kind": "element", "displayName": "Data Format Type", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "syslog", "tarFile", "thrift", "tidyMarkup", [...]
+ "dataFormatType": { "kind": "element", "displayName": "Data Format Type", "required": true, "type": "object", "javaType": "org.apache.camel.model.DataFormatDefinition", "oneOf": [ "any23", "asn1", "avro", "barcode", "base64", "bindy", "cbor", "crypto", "csv", "custom", "fhirJson", "fhirXml", "flatpack", "grok", "gzipDeflater", "hl7", "ical", "jacksonXml", "jaxb", "json", "jsonApi", "lzf", "mimeMultipart", "pgp", "protobuf", "rss", "soap", "swiftMt", "swiftMx", "syslog", "tarFile", "t [...]
"allowNullBody": { "kind": "attribute", "displayName": "Allow Null Body", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Indicates whether null is allowed as value of a body to unmarshall." },
"disabled": { "kind": "attribute", "displayName": "Disabled", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"id": { "kind": "attribute", "displayName": "Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the id of this node" },
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatClause.java b/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatClause.java
index 9cf65ec8bbb..0bd13efb271 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatClause.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/builder/DataFormatClause.java
@@ -54,6 +54,8 @@ import org.apache.camel.model.dataformat.ProtobufDataFormat;
import org.apache.camel.model.dataformat.ProtobufLibrary;
import org.apache.camel.model.dataformat.RssDataFormat;
import org.apache.camel.model.dataformat.SoapDataFormat;
+import org.apache.camel.model.dataformat.SwiftMtDataFormat;
+import org.apache.camel.model.dataformat.SwiftMxDataFormat;
import org.apache.camel.model.dataformat.SyslogDataFormat;
import org.apache.camel.model.dataformat.TarFileDataFormat;
import org.apache.camel.model.dataformat.ThriftDataFormat;
@@ -817,6 +819,62 @@ public class DataFormatClause<T extends ProcessorDefinition<?>> {
return dataFormat(soap);
}
+ /**
+ * Uses the SWIFT MX data format
+ */
+ public T swiftMx() {
+ return dataFormat(new SwiftMxDataFormat());
+ }
+
+ /**
+ * Uses the SWIFT MX data format.
+ */
+ public T swiftMx(boolean writeInJson) {
+ return dataFormat(new SwiftMxDataFormat(writeInJson));
+ }
+
+ /**
+ * Uses the SWIFT MX data format.
+ */
+ public T swiftMx(boolean writeInJson, String readMessageId, Object readConfig) {
+ return dataFormat(new SwiftMxDataFormat(writeInJson, readMessageId, readConfig));
+ }
+
+ /**
+ * Uses the SWIFT MX data format.
+ */
+ public T swiftMx(boolean writeInJson, String readMessageId, String readConfigRef) {
+ return dataFormat(new SwiftMxDataFormat(writeInJson, readMessageId, readConfigRef));
+ }
+
+ /**
+ * Uses the SWIFT MX data format.
+ */
+ public T swiftMx(Object writeConfig, String readMessageId, Object readConfig) {
+ return dataFormat(new SwiftMxDataFormat(writeConfig, readMessageId, readConfig));
+ }
+
+ /**
+ * Uses the SWIFT MX data format.
+ */
+ public T swiftMx(String writeConfigRef, String readMessageId, String readConfigRef) {
+ return dataFormat(new SwiftMxDataFormat(writeConfigRef, readMessageId, readConfigRef));
+ }
+
+ /**
+ * Uses the SWIFT MT data format
+ */
+ public T swiftMt() {
+ return dataFormat(new SwiftMtDataFormat());
+ }
+
+ /**
+ * Uses the SWIFT MT data format.
+ */
+ public T swiftMt(boolean writeInJson) {
+ return dataFormat(new SwiftMtDataFormat(Boolean.toString(writeInJson)));
+ }
+
/**
* Uses the Syslog data format
*/
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/MarshalDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/MarshalDefinition.java
index fdc94bf0a20..335bb503d68 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/MarshalDefinition.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/MarshalDefinition.java
@@ -49,6 +49,8 @@ import org.apache.camel.model.dataformat.PGPDataFormat;
import org.apache.camel.model.dataformat.ProtobufDataFormat;
import org.apache.camel.model.dataformat.RssDataFormat;
import org.apache.camel.model.dataformat.SoapDataFormat;
+import org.apache.camel.model.dataformat.SwiftMtDataFormat;
+import org.apache.camel.model.dataformat.SwiftMxDataFormat;
import org.apache.camel.model.dataformat.SyslogDataFormat;
import org.apache.camel.model.dataformat.TarFileDataFormat;
import org.apache.camel.model.dataformat.ThriftDataFormat;
@@ -98,6 +100,8 @@ public class MarshalDefinition extends NoOutputDefinition<MarshalDefinition> imp
@XmlElement(name = "protobuf", type = ProtobufDataFormat.class),
@XmlElement(name = "rss", type = RssDataFormat.class),
@XmlElement(name = "soap", type = SoapDataFormat.class),
+ @XmlElement(name = "swiftMt", type = SwiftMtDataFormat.class),
+ @XmlElement(name = "swiftMx", type = SwiftMxDataFormat.class),
@XmlElement(name = "syslog", type = SyslogDataFormat.class),
@XmlElement(name = "tarFile", type = TarFileDataFormat.class),
@XmlElement(name = "thrift", type = ThriftDataFormat.class),
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/UnmarshalDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/UnmarshalDefinition.java
index d5980c0a0a5..ede01457088 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/UnmarshalDefinition.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/UnmarshalDefinition.java
@@ -50,6 +50,8 @@ import org.apache.camel.model.dataformat.PGPDataFormat;
import org.apache.camel.model.dataformat.ProtobufDataFormat;
import org.apache.camel.model.dataformat.RssDataFormat;
import org.apache.camel.model.dataformat.SoapDataFormat;
+import org.apache.camel.model.dataformat.SwiftMtDataFormat;
+import org.apache.camel.model.dataformat.SwiftMxDataFormat;
import org.apache.camel.model.dataformat.SyslogDataFormat;
import org.apache.camel.model.dataformat.TarFileDataFormat;
import org.apache.camel.model.dataformat.ThriftDataFormat;
@@ -99,6 +101,8 @@ public class UnmarshalDefinition extends NoOutputDefinition<UnmarshalDefinition>
@XmlElement(name = "protobuf", type = ProtobufDataFormat.class),
@XmlElement(name = "rss", type = RssDataFormat.class),
@XmlElement(name = "soap", type = SoapDataFormat.class),
+ @XmlElement(name = "swiftMt", type = SwiftMtDataFormat.class),
+ @XmlElement(name = "swiftMx", type = SwiftMxDataFormat.class),
@XmlElement(name = "syslog", type = SyslogDataFormat.class),
@XmlElement(name = "tarFile", type = TarFileDataFormat.class),
@XmlElement(name = "thrift", type = ThriftDataFormat.class),
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/DataFormatsDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/DataFormatsDefinition.java
index ac7decdde65..ee452639994 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/DataFormatsDefinition.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/DataFormatsDefinition.java
@@ -65,6 +65,8 @@ public class DataFormatsDefinition {
@XmlElement(name = "protobuf", type = ProtobufDataFormat.class),
@XmlElement(name = "rss", type = RssDataFormat.class),
@XmlElement(name = "soap", type = SoapDataFormat.class),
+ @XmlElement(name = "swiftMt", type = SwiftMtDataFormat.class),
+ @XmlElement(name = "swiftMx", type = SwiftMxDataFormat.class),
@XmlElement(name = "syslog", type = SyslogDataFormat.class),
@XmlElement(name = "tarFile", type = TarFileDataFormat.class),
@XmlElement(name = "thrift", type = ThriftDataFormat.class),
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMtDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMtDataFormat.java
new file mode 100644
index 00000000000..60f2342bc08
--- /dev/null
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMtDataFormat.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.model.dataformat;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.camel.model.DataFormatDefinition;
+import org.apache.camel.spi.Metadata;
+
+/**
+ * Encode and decode SWIFT MT messages.
+ */
+@Metadata(firstVersion = "3.20.0", label = "dataformat,transformation,swift,mt", title = "SWIFT MT")
+@XmlRootElement(name = "swiftMt")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class SwiftMtDataFormat extends DataFormatDefinition {
+
+ @XmlAttribute
+ @Metadata(label = "advanced", javaType = "java.lang.Boolean")
+ private String writeInJson;
+
+ public SwiftMtDataFormat() {
+ super("swiftMt");
+ }
+
+ public SwiftMtDataFormat(String writeInJson) {
+ this();
+ this.writeInJson = writeInJson;
+ }
+
+ public String getWriteInJson() {
+ return writeInJson;
+ }
+
+ /**
+ * The flag indicating that messages must be marshalled in a JSON format.
+ *
+ * @param writeInJson {@code true} if messages must be marshalled in a JSON format, {@code false} otherwise.
+ */
+ public void setWriteInJson(String writeInJson) {
+ this.writeInJson = writeInJson;
+ }
+
+}
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMxDataFormat.java b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMxDataFormat.java
new file mode 100644
index 00000000000..8b472a67584
--- /dev/null
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/SwiftMxDataFormat.java
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.model.dataformat;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.apache.camel.model.DataFormatDefinition;
+import org.apache.camel.spi.Metadata;
+
+/**
+ * Encode and decode SWIFT MX messages.
+ */
+@Metadata(firstVersion = "3.20.0", label = "dataformat,transformation,swift,mx", title = "SWIFT MX")
+@XmlRootElement(name = "swiftMx")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class SwiftMxDataFormat extends DataFormatDefinition {
+
+ @XmlAttribute
+ @Metadata(label = "advanced")
+ private String writeConfigRef;
+ @XmlTransient
+ private Object writeConfig;
+ @XmlAttribute
+ @Metadata(label = "advanced", javaType = "java.lang.Boolean")
+ private String writeInJson;
+ @XmlAttribute
+ @Metadata(label = "advanced")
+ private String readMessageId;
+ @XmlAttribute
+ @Metadata(label = "advanced")
+ private String readConfigRef;
+ @XmlTransient
+ private Object readConfig;
+
+ public SwiftMxDataFormat() {
+ super("swiftMx");
+ }
+
+ public SwiftMxDataFormat(boolean writeInJson) {
+ this();
+ this.writeInJson = Boolean.toString(writeInJson);
+ }
+
+ public SwiftMxDataFormat(boolean writeInJson, String readMessageId, Object readConfig) {
+ this(writeInJson);
+ this.readMessageId = readMessageId;
+ this.readConfig = readConfig;
+ }
+
+ public SwiftMxDataFormat(boolean writeInJson, String readMessageId, String readConfigRef) {
+ this(writeInJson);
+ this.readMessageId = readMessageId;
+ this.readConfigRef = readConfigRef;
+ }
+
+ public SwiftMxDataFormat(Object writeConfig, String readMessageId, Object readConfig) {
+ this();
+ this.writeConfig = writeConfig;
+ this.readMessageId = readMessageId;
+ this.readConfig = readConfig;
+ }
+
+ public SwiftMxDataFormat(String writeConfigRef, String readMessageId, String readConfigRef) {
+ this();
+ this.writeConfigRef = writeConfigRef;
+ this.readMessageId = readMessageId;
+ this.readConfigRef = readConfigRef;
+ }
+
+ public Object getWriteConfig() {
+ return writeConfig;
+ }
+
+ /**
+ * The specific configuration to use when marshalling a message.
+ */
+ public void setWriteConfig(Object writeConfig) {
+ this.writeConfig = writeConfig;
+ }
+
+ public String getWriteInJson() {
+ return writeInJson;
+ }
+
+ /**
+ * The flag indicating that messages must be marshalled in a JSON format.
+ *
+ * @param writeInJson {@code true} if messages must be marshalled in a JSON format, {@code false} otherwise.
+ */
+ public void setWriteInJson(String writeInJson) {
+ this.writeInJson = writeInJson;
+ }
+
+ public String getReadMessageId() {
+ return readMessageId;
+ }
+
+ /**
+ * The type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically
+ * detected from the namespace used.
+ */
+ public void setReadMessageId(String readMessageId) {
+ this.readMessageId = readMessageId;
+ }
+
+ public Object getReadConfig() {
+ return readConfig;
+ }
+
+ /**
+ * The specific configuration to use when unmarshalling an input stream.
+ */
+ public void setReadConfig(Object readConfig) {
+ this.readConfig = readConfig;
+ }
+
+ public String getWriteConfigRef() {
+ return writeConfigRef;
+ }
+
+ /**
+ * Refers to a specific configuration to use when marshalling a message to lookup from the registry.
+ */
+ public void setWriteConfigRef(String writeConfigRef) {
+ this.writeConfigRef = writeConfigRef;
+ }
+
+ public String getReadConfigRef() {
+ return readConfigRef;
+ }
+
+ /**
+ * Refers to a specific configuration to use when unmarshalling an input stream to lookup from the registry.
+ */
+ public void setReadConfigRef(String readConfigRef) {
+ this.readConfigRef = readConfigRef;
+ }
+}
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java
index f646da44cd9..6758272da73 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java
@@ -50,6 +50,8 @@ import org.apache.camel.model.dataformat.PGPDataFormat;
import org.apache.camel.model.dataformat.ProtobufDataFormat;
import org.apache.camel.model.dataformat.RssDataFormat;
import org.apache.camel.model.dataformat.SoapDataFormat;
+import org.apache.camel.model.dataformat.SwiftMtDataFormat;
+import org.apache.camel.model.dataformat.SwiftMxDataFormat;
import org.apache.camel.model.dataformat.SyslogDataFormat;
import org.apache.camel.model.dataformat.TarFileDataFormat;
import org.apache.camel.model.dataformat.ThriftDataFormat;
@@ -101,6 +103,8 @@ public class DataFormatTransformerDefinition extends TransformerDefinition {
@XmlElement(name = "protobuf", type = ProtobufDataFormat.class),
@XmlElement(name = "rss", type = RssDataFormat.class),
@XmlElement(name = "soap", type = SoapDataFormat.class),
+ @XmlElement(name = "swiftMt", type = SwiftMtDataFormat.class),
+ @XmlElement(name = "swiftMx", type = SwiftMxDataFormat.class),
@XmlElement(name = "syslog", type = SyslogDataFormat.class),
@XmlElement(name = "tarFile", type = TarFileDataFormat.class),
@XmlElement(name = "thrift", type = ThriftDataFormat.class),
diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
index 42eda3b288f..58c46116cd4 100644
--- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
+++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
@@ -54,6 +54,8 @@ import org.apache.camel.model.dataformat.PGPDataFormat;
import org.apache.camel.model.dataformat.ProtobufDataFormat;
import org.apache.camel.model.dataformat.RssDataFormat;
import org.apache.camel.model.dataformat.SoapDataFormat;
+import org.apache.camel.model.dataformat.SwiftMtDataFormat;
+import org.apache.camel.model.dataformat.SwiftMxDataFormat;
import org.apache.camel.model.dataformat.SyslogDataFormat;
import org.apache.camel.model.dataformat.TarFileDataFormat;
import org.apache.camel.model.dataformat.ThriftDataFormat;
@@ -233,6 +235,10 @@ public abstract class DataFormatReifier<T extends DataFormatDefinition> extends
return new SoapDataFormatReifier(camelContext, definition);
} else if (definition instanceof SyslogDataFormat) {
return new SyslogDataFormatReifier(camelContext, definition);
+ } else if (definition instanceof SwiftMtDataFormat) {
+ return new SwiftMtDataFormatReifier(camelContext, definition);
+ } else if (definition instanceof SwiftMxDataFormat) {
+ return new SwiftMxDataFormatReifier(camelContext, definition);
} else if (definition instanceof TarFileDataFormat) {
return new TarFileDataFormatReifier(camelContext, definition);
} else if (definition instanceof ThriftDataFormat) {
diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SwiftMtDataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SwiftMtDataFormatReifier.java
new file mode 100644
index 00000000000..cbcd4487baf
--- /dev/null
+++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SwiftMtDataFormatReifier.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.reifier.dataformat;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.model.DataFormatDefinition;
+import org.apache.camel.model.dataformat.SwiftMtDataFormat;
+
+public class SwiftMtDataFormatReifier extends DataFormatReifier<SwiftMtDataFormat> {
+
+ public SwiftMtDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+ super(camelContext, (SwiftMtDataFormat) definition);
+ }
+
+ @Override
+ protected void prepareDataFormatConfig(Map<String, Object> properties) {
+ properties.put("writeInJson", definition.getWriteInJson());
+ }
+}
diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SwiftMxDataFormatReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SwiftMxDataFormatReifier.java
new file mode 100644
index 00000000000..901bda37571
--- /dev/null
+++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/SwiftMxDataFormatReifier.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.reifier.dataformat;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.model.DataFormatDefinition;
+import org.apache.camel.model.dataformat.SwiftMxDataFormat;
+
+public class SwiftMxDataFormatReifier extends DataFormatReifier<SwiftMxDataFormat> {
+
+ public SwiftMxDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+ super(camelContext, (SwiftMxDataFormat) definition);
+ }
+
+ @Override
+ protected void prepareDataFormatConfig(Map<String, Object> properties) {
+ properties.put("writeConfig", or(definition.getWriteConfig(), asRef(definition.getWriteConfigRef())));
+ properties.put("writeInJson", definition.getWriteInJson());
+ properties.put("readMessageId", definition.getReadMessageId());
+ properties.put("readConfig", or(definition.getReadConfig(), asRef(definition.getReadConfigRef())));
+ }
+}
diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties
index 251737ada16..36b9ab17fd1 100644
--- a/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties
+++ b/core/camel-main/src/generated/resources/org/apache/camel/main/dataformats.properties
@@ -33,6 +33,8 @@ protobufJackson
rss
snakeYaml
soap
+swiftMt
+swiftMx
syslog
tarFile
thrift
diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
index 30c3630d034..8c42d7c8d54 100644
--- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
+++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
@@ -2312,6 +2312,27 @@ public class ModelParser extends BaseParser {
return true;
}, noElementHandler(), noValueHandler());
}
+ protected SwiftMtDataFormat doParseSwiftMtDataFormat() throws IOException, XmlPullParserException {
+ return doParse(new SwiftMtDataFormat(), (def, key, val) -> {
+ if ("writeInJson".equals(key)) {
+ def.setWriteInJson(val);
+ return true;
+ }
+ return identifiedTypeAttributeHandler().accept(def, key, val);
+ }, noElementHandler(), noValueHandler());
+ }
+ protected SwiftMxDataFormat doParseSwiftMxDataFormat() throws IOException, XmlPullParserException {
+ return doParse(new SwiftMxDataFormat(), (def, key, val) -> {
+ switch (key) {
+ case "readConfigRef": def.setReadConfigRef(val); break;
+ case "readMessageId": def.setReadMessageId(val); break;
+ case "writeConfigRef": def.setWriteConfigRef(val); break;
+ case "writeInJson": def.setWriteInJson(val); break;
+ default: return identifiedTypeAttributeHandler().accept(def, key, val);
+ }
+ return true;
+ }, noElementHandler(), noValueHandler());
+ }
protected SyslogDataFormat doParseSyslogDataFormat() throws IOException, XmlPullParserException {
return doParse(new SyslogDataFormat(),
identifiedTypeAttributeHandler(), noElementHandler(), noValueHandler());
@@ -3381,6 +3402,8 @@ public class ModelParser extends BaseParser {
case "protobuf": return doParseProtobufDataFormat();
case "rss": return doParseRssDataFormat();
case "soap": return doParseSoapDataFormat();
+ case "swiftMt": return doParseSwiftMtDataFormat();
+ case "swiftMx": return doParseSwiftMxDataFormat();
case "syslog": return doParseSyslogDataFormat();
case "tarFile": return doParseTarFileDataFormat();
case "thrift": return doParseThriftDataFormat();
diff --git a/docs/components/modules/dataformats/examples/json/swiftMt.json b/docs/components/modules/dataformats/examples/json/swiftMt.json
new file mode 120000
index 00000000000..df7df418763
--- /dev/null
+++ b/docs/components/modules/dataformats/examples/json/swiftMt.json
@@ -0,0 +1 @@
+../../../../../../components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/mt/swiftMt.json
\ No newline at end of file
diff --git a/docs/components/modules/dataformats/examples/json/swiftMx.json b/docs/components/modules/dataformats/examples/json/swiftMx.json
new file mode 120000
index 00000000000..15aee664fa6
--- /dev/null
+++ b/docs/components/modules/dataformats/examples/json/swiftMx.json
@@ -0,0 +1 @@
+../../../../../../components/camel-swift/src/generated/resources/org/apache/camel/dataformat/swift/mx/swiftMx.json
\ No newline at end of file
diff --git a/docs/components/modules/dataformats/nav.adoc b/docs/components/modules/dataformats/nav.adoc
index c29d872a2b4..b965cf78aac 100644
--- a/docs/components/modules/dataformats/nav.adoc
+++ b/docs/components/modules/dataformats/nav.adoc
@@ -35,6 +35,8 @@
** xref:protobufJackson-dataformat.adoc[Protobuf Jackson]
** xref:rss-dataformat.adoc[RSS]
** xref:soap-dataformat.adoc[SOAP]
+** xref:swiftMt-dataformat.adoc[SWIFT MT]
+** xref:swiftMx-dataformat.adoc[SWIFT MX]
** xref:syslog-dataformat.adoc[Syslog]
** xref:tarFile-dataformat.adoc[Tar File]
** xref:thrift-dataformat.adoc[Thrift]
diff --git a/docs/components/modules/dataformats/pages/swiftMt-dataformat.adoc b/docs/components/modules/dataformats/pages/swiftMt-dataformat.adoc
new file mode 120000
index 00000000000..6f4183fdd30
--- /dev/null
+++ b/docs/components/modules/dataformats/pages/swiftMt-dataformat.adoc
@@ -0,0 +1 @@
+../../../../../components/camel-swift/src/main/docs/swiftMt-dataformat.adoc
\ No newline at end of file
diff --git a/docs/components/modules/dataformats/pages/swiftMx-dataformat.adoc b/docs/components/modules/dataformats/pages/swiftMx-dataformat.adoc
new file mode 120000
index 00000000000..5e1b760ad83
--- /dev/null
+++ b/docs/components/modules/dataformats/pages/swiftMx-dataformat.adoc
@@ -0,0 +1 @@
+../../../../../components/camel-swift/src/main/docs/swiftMx-dataformat.adoc
\ No newline at end of file
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
index 5ebe38e8012..cd155034841 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
@@ -149,6 +149,8 @@ import org.apache.camel.model.dataformat.PGPDataFormat;
import org.apache.camel.model.dataformat.ProtobufDataFormat;
import org.apache.camel.model.dataformat.RssDataFormat;
import org.apache.camel.model.dataformat.SoapDataFormat;
+import org.apache.camel.model.dataformat.SwiftMtDataFormat;
+import org.apache.camel.model.dataformat.SwiftMxDataFormat;
import org.apache.camel.model.dataformat.SyslogDataFormat;
import org.apache.camel.model.dataformat.TarFileDataFormat;
import org.apache.camel.model.dataformat.ThriftDataFormat;
@@ -2955,6 +2957,8 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
@YamlProperty(name = "rss", type = "object:org.apache.camel.model.dataformat.RssDataFormat"),
@YamlProperty(name = "scheme", type = "string"),
@YamlProperty(name = "soap", type = "object:org.apache.camel.model.dataformat.SoapDataFormat"),
+ @YamlProperty(name = "swift-mt", type = "object:org.apache.camel.model.dataformat.SwiftMtDataFormat"),
+ @YamlProperty(name = "swift-mx", type = "object:org.apache.camel.model.dataformat.SwiftMxDataFormat"),
@YamlProperty(name = "syslog", type = "object:org.apache.camel.model.dataformat.SyslogDataFormat"),
@YamlProperty(name = "tar-file", type = "object:org.apache.camel.model.dataformat.TarFileDataFormat"),
@YamlProperty(name = "thrift", type = "object:org.apache.camel.model.dataformat.ThriftDataFormat"),
@@ -3119,6 +3123,16 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
target.setDataFormatType(val);
break;
}
+ case "swift-mt": {
+ org.apache.camel.model.dataformat.SwiftMtDataFormat val = asType(node, org.apache.camel.model.dataformat.SwiftMtDataFormat.class);
+ target.setDataFormatType(val);
+ break;
+ }
+ case "swift-mx": {
+ org.apache.camel.model.dataformat.SwiftMxDataFormat val = asType(node, org.apache.camel.model.dataformat.SwiftMxDataFormat.class);
+ target.setDataFormatType(val);
+ break;
+ }
case "syslog": {
org.apache.camel.model.dataformat.SyslogDataFormat val = asType(node, org.apache.camel.model.dataformat.SyslogDataFormat.class);
target.setDataFormatType(val);
@@ -3242,6 +3256,8 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
@YamlProperty(name = "protobuf", type = "object:org.apache.camel.model.dataformat.ProtobufDataFormat"),
@YamlProperty(name = "rss", type = "object:org.apache.camel.model.dataformat.RssDataFormat"),
@YamlProperty(name = "soap", type = "object:org.apache.camel.model.dataformat.SoapDataFormat"),
+ @YamlProperty(name = "swift-mt", type = "object:org.apache.camel.model.dataformat.SwiftMtDataFormat"),
+ @YamlProperty(name = "swift-mx", type = "object:org.apache.camel.model.dataformat.SwiftMxDataFormat"),
@YamlProperty(name = "syslog", type = "object:org.apache.camel.model.dataformat.SyslogDataFormat"),
@YamlProperty(name = "tar-file", type = "object:org.apache.camel.model.dataformat.TarFileDataFormat"),
@YamlProperty(name = "thrift", type = "object:org.apache.camel.model.dataformat.ThriftDataFormat"),
@@ -3535,6 +3551,26 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
target.setDataFormats(existing);
break;
}
+ case "swift-mt": {
+ org.apache.camel.model.dataformat.SwiftMtDataFormat val = asType(node, org.apache.camel.model.dataformat.SwiftMtDataFormat.class);
+ java.util.List<org.apache.camel.model.DataFormatDefinition> existing = target.getDataFormats();
+ if (existing == null) {
+ existing = new java.util.ArrayList<>();
+ }
+ existing.add(val);
+ target.setDataFormats(existing);
+ break;
+ }
+ case "swift-mx": {
+ org.apache.camel.model.dataformat.SwiftMxDataFormat val = asType(node, org.apache.camel.model.dataformat.SwiftMxDataFormat.class);
+ java.util.List<org.apache.camel.model.DataFormatDefinition> existing = target.getDataFormats();
+ if (existing == null) {
+ existing = new java.util.ArrayList<>();
+ }
+ existing.add(val);
+ target.setDataFormats(existing);
+ break;
+ }
case "syslog": {
org.apache.camel.model.dataformat.SyslogDataFormat val = asType(node, org.apache.camel.model.dataformat.SyslogDataFormat.class);
java.util.List<org.apache.camel.model.DataFormatDefinition> existing = target.getDataFormats();
@@ -8246,6 +8282,8 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
@YamlProperty(name = "protobuf", type = "object:org.apache.camel.model.dataformat.ProtobufDataFormat"),
@YamlProperty(name = "rss", type = "object:org.apache.camel.model.dataformat.RssDataFormat"),
@YamlProperty(name = "soap", type = "object:org.apache.camel.model.dataformat.SoapDataFormat"),
+ @YamlProperty(name = "swift-mt", type = "object:org.apache.camel.model.dataformat.SwiftMtDataFormat"),
+ @YamlProperty(name = "swift-mx", type = "object:org.apache.camel.model.dataformat.SwiftMxDataFormat"),
@YamlProperty(name = "syslog", type = "object:org.apache.camel.model.dataformat.SyslogDataFormat"),
@YamlProperty(name = "tar-file", type = "object:org.apache.camel.model.dataformat.TarFileDataFormat"),
@YamlProperty(name = "thrift", type = "object:org.apache.camel.model.dataformat.ThriftDataFormat"),
@@ -8409,6 +8447,16 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
target.setDataFormatType(val);
break;
}
+ case "swift-mt": {
+ org.apache.camel.model.dataformat.SwiftMtDataFormat val = asType(node, org.apache.camel.model.dataformat.SwiftMtDataFormat.class);
+ target.setDataFormatType(val);
+ break;
+ }
+ case "swift-mx": {
+ org.apache.camel.model.dataformat.SwiftMxDataFormat val = asType(node, org.apache.camel.model.dataformat.SwiftMxDataFormat.class);
+ target.setDataFormatType(val);
+ break;
+ }
case "syslog": {
org.apache.camel.model.dataformat.SyslogDataFormat val = asType(node, org.apache.camel.model.dataformat.SyslogDataFormat.class);
target.setDataFormatType(val);
@@ -15479,6 +15527,118 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
}
}
+ @YamlType(
+ nodes = {
+ "swift-mt",
+ "swiftMt"
+ },
+ inline = true,
+ types = org.apache.camel.model.dataformat.SwiftMtDataFormat.class,
+ order = org.apache.camel.dsl.yaml.common.YamlDeserializerResolver.ORDER_LOWEST - 1,
+ properties = {
+ @YamlProperty(name = "id", type = "string"),
+ @YamlProperty(name = "write-in-json", type = "boolean")
+ }
+ )
+ public static class SwiftMtDataFormatDeserializer extends YamlDeserializerBase<SwiftMtDataFormat> {
+ public SwiftMtDataFormatDeserializer() {
+ super(SwiftMtDataFormat.class);
+ }
+
+ @Override
+ protected SwiftMtDataFormat newInstance() {
+ return new SwiftMtDataFormat();
+ }
+
+ @Override
+ protected SwiftMtDataFormat newInstance(String value) {
+ return new SwiftMtDataFormat(value);
+ }
+
+ @Override
+ protected boolean setProperty(SwiftMtDataFormat target, String propertyKey,
+ String propertyName, Node node) {
+ switch(propertyKey) {
+ case "id": {
+ String val = asText(node);
+ target.setId(val);
+ break;
+ }
+ case "write-in-json": {
+ String val = asText(node);
+ target.setWriteInJson(val);
+ break;
+ }
+ default: {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+
+ @YamlType(
+ nodes = {
+ "swift-mx",
+ "swiftMx"
+ },
+ types = org.apache.camel.model.dataformat.SwiftMxDataFormat.class,
+ order = org.apache.camel.dsl.yaml.common.YamlDeserializerResolver.ORDER_LOWEST - 1,
+ properties = {
+ @YamlProperty(name = "id", type = "string"),
+ @YamlProperty(name = "read-config-ref", type = "string"),
+ @YamlProperty(name = "read-message-id", type = "string"),
+ @YamlProperty(name = "write-config-ref", type = "string"),
+ @YamlProperty(name = "write-in-json", type = "boolean")
+ }
+ )
+ public static class SwiftMxDataFormatDeserializer extends YamlDeserializerBase<SwiftMxDataFormat> {
+ public SwiftMxDataFormatDeserializer() {
+ super(SwiftMxDataFormat.class);
+ }
+
+ @Override
+ protected SwiftMxDataFormat newInstance() {
+ return new SwiftMxDataFormat();
+ }
+
+ @Override
+ protected boolean setProperty(SwiftMxDataFormat target, String propertyKey,
+ String propertyName, Node node) {
+ switch(propertyKey) {
+ case "id": {
+ String val = asText(node);
+ target.setId(val);
+ break;
+ }
+ case "read-config-ref": {
+ String val = asText(node);
+ target.setReadConfigRef(val);
+ break;
+ }
+ case "read-message-id": {
+ String val = asText(node);
+ target.setReadMessageId(val);
+ break;
+ }
+ case "write-config-ref": {
+ String val = asText(node);
+ target.setWriteConfigRef(val);
+ break;
+ }
+ case "write-in-json": {
+ String val = asText(node);
+ target.setWriteInJson(val);
+ break;
+ }
+ default: {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+
@YamlType(
nodes = "syslog",
types = org.apache.camel.model.dataformat.SyslogDataFormat.class,
@@ -17211,6 +17371,8 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
@YamlProperty(name = "protobuf", type = "object:org.apache.camel.model.dataformat.ProtobufDataFormat"),
@YamlProperty(name = "rss", type = "object:org.apache.camel.model.dataformat.RssDataFormat"),
@YamlProperty(name = "soap", type = "object:org.apache.camel.model.dataformat.SoapDataFormat"),
+ @YamlProperty(name = "swift-mt", type = "object:org.apache.camel.model.dataformat.SwiftMtDataFormat"),
+ @YamlProperty(name = "swift-mx", type = "object:org.apache.camel.model.dataformat.SwiftMxDataFormat"),
@YamlProperty(name = "syslog", type = "object:org.apache.camel.model.dataformat.SyslogDataFormat"),
@YamlProperty(name = "tar-file", type = "object:org.apache.camel.model.dataformat.TarFileDataFormat"),
@YamlProperty(name = "thrift", type = "object:org.apache.camel.model.dataformat.ThriftDataFormat"),
@@ -17379,6 +17541,16 @@ public final class ModelDeserializers extends YamlDeserializerSupport {
target.setDataFormatType(val);
break;
}
+ case "swift-mt": {
+ org.apache.camel.model.dataformat.SwiftMtDataFormat val = asType(node, org.apache.camel.model.dataformat.SwiftMtDataFormat.class);
+ target.setDataFormatType(val);
+ break;
+ }
+ case "swift-mx": {
+ org.apache.camel.model.dataformat.SwiftMxDataFormat val = asType(node, org.apache.camel.model.dataformat.SwiftMxDataFormat.class);
+ target.setDataFormatType(val);
+ break;
+ }
case "syslog": {
org.apache.camel.model.dataformat.SyslogDataFormat val = asType(node, org.apache.camel.model.dataformat.SyslogDataFormat.class);
target.setDataFormatType(val);
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java
index a996e550384..06b55cac63a 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java
@@ -457,6 +457,12 @@ public final class ModelDeserializersResolver implements YamlDeserializerResolve
case "org.apache.camel.model.StopDefinition": return new ModelDeserializers.StopDefinitionDeserializer();
case "stream-config": return new ModelDeserializers.StreamResequencerConfigDeserializer();
case "org.apache.camel.model.config.StreamResequencerConfig": return new ModelDeserializers.StreamResequencerConfigDeserializer();
+ case "swift-mt": return new ModelDeserializers.SwiftMtDataFormatDeserializer();
+ case "swiftMt": return new ModelDeserializers.SwiftMtDataFormatDeserializer();
+ case "org.apache.camel.model.dataformat.SwiftMtDataFormat": return new ModelDeserializers.SwiftMtDataFormatDeserializer();
+ case "swift-mx": return new ModelDeserializers.SwiftMxDataFormatDeserializer();
+ case "swiftMx": return new ModelDeserializers.SwiftMxDataFormatDeserializer();
+ case "org.apache.camel.model.dataformat.SwiftMxDataFormat": return new ModelDeserializers.SwiftMxDataFormatDeserializer();
case "syslog": return new ModelDeserializers.SyslogDataFormatDeserializer();
case "org.apache.camel.model.dataformat.SyslogDataFormat": return new ModelDeserializers.SyslogDataFormatDeserializer();
case "tar-file": return new ModelDeserializers.TarFileDataFormatDeserializer();
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camel-yaml-dsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camel-yaml-dsl.json
index a91af3ef824..36aefdb47a9 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camel-yaml-dsl.json
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camel-yaml-dsl.json
@@ -1546,6 +1546,12 @@
"soap" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SoapDataFormat"
},
+ "swift-mt" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "swift-mx" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
"syslog" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SyslogDataFormat"
},
@@ -3518,6 +3524,12 @@
"soap" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SoapDataFormat"
},
+ "swift-mt" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "swift-mx" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
"syslog" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SyslogDataFormat"
},
@@ -4807,6 +4819,12 @@
"soap" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SoapDataFormat"
},
+ "swift-mt" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "swift-mx" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
"syslog" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SyslogDataFormat"
},
@@ -5455,6 +5473,41 @@
} ],
"required" : [ "context-path" ]
},
+ "org.apache.camel.model.dataformat.SwiftMtDataFormat" : {
+ "oneOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "write-in-json" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.dataformat.SwiftMxDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "read-config-ref" : {
+ "type" : "string"
+ },
+ "read-message-id" : {
+ "type" : "string"
+ },
+ "write-config-ref" : {
+ "type" : "string"
+ },
+ "write-in-json" : {
+ "type" : "boolean"
+ }
+ }
+ },
"org.apache.camel.model.dataformat.SyslogDataFormat" : {
"type" : "object",
"properties" : {
@@ -7901,6 +7954,12 @@
"soap" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SoapDataFormat"
},
+ "swift-mt" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "swift-mx" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
"syslog" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SyslogDataFormat"
},
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
index 012dd696d24..7fbdd3f82bb 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
@@ -1450,6 +1450,12 @@
"soap" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SoapDataFormat"
},
+ "swiftMt" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "swiftMx" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
"syslog" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SyslogDataFormat"
},
@@ -3422,6 +3428,12 @@
"soap" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SoapDataFormat"
},
+ "swiftMt" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "swiftMx" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
"syslog" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SyslogDataFormat"
},
@@ -4711,6 +4723,12 @@
"soap" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SoapDataFormat"
},
+ "swiftMt" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "swiftMx" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
"syslog" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SyslogDataFormat"
},
@@ -5359,6 +5377,41 @@
} ],
"required" : [ "contextPath" ]
},
+ "org.apache.camel.model.dataformat.SwiftMtDataFormat" : {
+ "oneOf" : [ {
+ "type" : "string"
+ }, {
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "writeInJson" : {
+ "type" : "boolean"
+ }
+ }
+ } ]
+ },
+ "org.apache.camel.model.dataformat.SwiftMxDataFormat" : {
+ "type" : "object",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "readConfigRef" : {
+ "type" : "string"
+ },
+ "readMessageId" : {
+ "type" : "string"
+ },
+ "writeConfigRef" : {
+ "type" : "string"
+ },
+ "writeInJson" : {
+ "type" : "boolean"
+ }
+ }
+ },
"org.apache.camel.model.dataformat.SyslogDataFormat" : {
"type" : "object",
"properties" : {
@@ -7802,6 +7855,12 @@
"soap" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SoapDataFormat"
},
+ "swiftMt" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMtDataFormat"
+ },
+ "swiftMx" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SwiftMxDataFormat"
+ },
"syslog" : {
"$ref" : "#/items/definitions/org.apache.camel.model.dataformat.SyslogDataFormat"
},
diff --git a/parent/pom.xml b/parent/pom.xml
index 5135dabf87f..7a3e4029e23 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -443,6 +443,7 @@
<protobuf-maven-plugin-version>0.6.1</protobuf-maven-plugin-version>
<protonpack-version>1.8</protonpack-version>
<protostream-version>4.5.0.Final</protostream-version>
+ <prowide-version>SRU2022-9.3.2</prowide-version>
<pubnub-version>4.25.0</pubnub-version>
<pulsar-version>2.10.1</pulsar-version>
<qpid-broker-version>8.0.6</qpid-broker-version>
@@ -2543,6 +2544,11 @@
<artifactId>camel-swagger-java</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-swift</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-syslog</artifactId>