dscope-camel-iso20022 is an Apache Camel component for marshaling and unmarshaling ISO20022 MX messages (for example pain.001.001.03) using Prowide ISO20022 models.
- Unmarshal ISO20022 payloads from:
- XML (
type=xml, default) - JSON (
type=json) - DOM Element (
type=dom)
- XML (
- Marshal ISO20022 payloads to:
- XML (
type=xml, default) - JSON (
type=json) - DOM Element (
type=dom)
- XML (
- Supports both wrapped (
AbstractMX) and unwrapped document payload processing.
<dependency>
<groupId>io.dscope</groupId>
<artifactId>dscope-camel-iso20022</artifactId>
<version>1.0.0</version>
</dependency>Maven Central:
https://search.maven.org/artifact/io.dscope/dscope-camel-iso20022/1.0.0/jar
- Java 21+
- Maven 3.9+
- Apache Camel 4.15.0 (component is built and tested with this version)
iso20022:marshal?... # marshal route endpoint
iso20022:unmarshal?... # unmarshal route endpoint
type(xml|json|dom, default:xml)- Payload format to read/write.
messageType(example:pain.001.001.03)- Required for marshaling when body is not already
AbstractMX.
- Required for marshaling when body is not already
documentType(example:cstmrCdtTrfInitn)- Field name of the ISO20022 document in the MX wrapper.
- If omitted, component tries to infer from JAXB
@XmlType(propOrder=...).
wrapped(true|false, default:false, unmarshal only)- If
true, returns the fullAbstractMXobject. - If
false, returns only the document payload object.
- If
You can pass metadata through Camel headers:
messageTypedocumentTypeappHeader(optionalAppHdrwhen marshaling)
These map to constants in code:
ISO20022Producer.MESSAGE_TYPE_HEADERISO20022Producer.DOCUMENT_TYPE_HEADERISO20022Producer.APP_HEADER
- Input body:
AbstractMXOR- document object +
messageType(and usuallydocumentType)
- Output body:
- XML
String(type=xml) - JSON
String(type=json) org.w3c.dom.Element(type=dom)
- XML
- Input body:
- XML
String(type=xml) - JSON
String(type=json) org.w3c.dom.Element(type=dom)
- XML
- Output body:
- document object (
wrapped=false) AbstractMX(wrapped=true)
- document object (
from("direct:marshalJson")
.to("iso20022:marshal?messageType=pain.001.001.03&documentType=cstmrCdtTrfInitn&type=json");
from("direct:unmarshalXml")
.to("iso20022:unmarshal")
.to("log:unmarshalled");
from("direct:unmarshalWrapped")
.to("iso20022:unmarshal?wrapped=true")
.to("log:mx");- route:
id: pain001-unmarshal-route
from:
uri: file:data/input
parameters:
noop: true
steps:
- to:
uri: iso20022:unmarshal
- to:
uri: iso20022:marshal
parameters:
messageType: pain.001.001.03
documentType: cstmrCdtTrfInitn
type: json
- to:
uri: file:data/output
parameters:
fileName: "${header.CamelFileName}.json"A standalone sample (similar structure to the RosettaNet sample) is available at:
/Users/roman/Projects/eclipse-workspace/dscope-camel-iso20022/samples/yaml-pain001-sample
Run it:
cd samples/yaml-pain001-sample
mvn clean package
mvn exec:javaOutput files are created in:
samples/yaml-pain001-sample/data/output
mvn clean verifyInstall locally:
mvn clean installThis project follows the same central-release profile convention used by the RosettaNet component.
mvn -Pcentral-release clean deployExpected Maven server credentials/config:
ossrh(for distribution management)central(for central publishing plugin)- GPG configured for artifact signing
Component metadata is in:
src/iso20022.json
For Apache Karavan VS Code extension, register iso20022 in the extension component lists and merge metadata from src/iso20022.json.
- The component supports both
jakarta.xml.bindandjavax.xml.bindXmlTypeannotation lookup for document field inference. - For predictable marshaling from plain document objects, provide both
messageTypeanddocumentTypeexplicitly.