This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-jbang-examples.git
The following commit(s) were added to refs/heads/main by this push:
new a81f6c3 connect-service/ibm-mq-payments - payment orders over IBM MQ,
checked against an XML schema, with errors and backout queues (#155)
a81f6c3 is described below
commit a81f6c39e408745399b3dda4278a91c161bd913b
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Nov 30 07:13:18 2026 +0100
connect-service/ibm-mq-payments - payment orders over IBM MQ, checked
against an XML schema, with errors and backout queues (#155)
Closes #154
Claude-Session: https://claude.ai/code/session_016Y4dDi5iQNgtHrDdz2NpwF
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
.gitignore | 2 +
README.md | 1 +
camel-jbang-example-catalog.json | 60 +++++++++++
connect-service/README.md | 1 +
connect-service/ibm-mq-payments/README.md | 119 +++++++++++++++++++++
.../ibm-mq-payments/application.properties | 40 +++++++
connect-service/ibm-mq-payments/erp.camel.yaml | 19 ++++
.../ibm-mq-payments/ibm-mq-payments.camel.yaml | 91 ++++++++++++++++
connect-service/ibm-mq-payments/metadata.json | 46 ++++++++
connect-service/ibm-mq-payments/payment-order.xsd | 70 ++++++++++++
.../ibm-mq-payments/payments/payment-001.xml | 11 ++
.../ibm-mq-payments/payments/payment-002.xml | 9 ++
.../ibm-mq-payments/payments/payment-003.xml | 9 ++
.../ibm-mq-payments/payments/payment-004.xml | 9 ++
.../test/ibm-mq-payments.citrus.it.yaml | 56 ++++++++++
15 files changed, 543 insertions(+)
diff --git a/.gitignore b/.gitignore
index c3bcbcf..5a0bbf2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,5 @@ output/
audit/
# written by the batch-file example at runtime
rejects/
+# written by the IBM MQ client in the ibm-mq-payments example at runtime
+mqjms.log.*
diff --git a/README.md b/README.md
index 0b2dcfe..266977b 100644
--- a/README.md
+++ b/README.md
@@ -116,6 +116,7 @@ SQL, JMS, MQTT, Kafka and FTP against a service the Camel
CLI starts for you wit
| [FTP courier](connect-service/ftp/) | Each order on the shipments queue of
an Artemis broker becomes a file on the courier's FTP server, both started with
camel infra; the log shows each shipment uploaded and camel infra get ftp shows
where the files landed. | `camel infra run artemis ftp` |
| [Camel 1.0 tribute](connect-service/camel-1-tribute/) | The very first Camel
example of 2007, JMS to file: a timer sends ten messages to a queue on an
Artemis broker started with camel infra, and the consumer writes each message
to a file in outbox; the log shows both sides. | `camel infra run artemis` |
| [IoT telemetry](connect-service/iot-telemetry/) | Three simulated cold-room
sensors publish a reading every second to a Mosquitto broker started with camel
infra; the shop subscribes with a wildcard topic and logs an average per room
every ten seconds with an aggregator, at most one alert per room per window
with a throttle per room, and a warning when a sensor goes silent with an
aggregator completion timeout. | `camel infra run mosquitto` |
+| [IBM MQ payments](connect-service/ibm-mq-payments/) | A simulated ERP puts
four payment orders (XML in the shape of ISO 20022 pain.001) on an IBM MQ queue
of a queue manager started with camel infra; each order is validated against
its XML schema, an invalid one is put on an errors queue with the schema error,
one that fails three times is moved to a backout queue by a dead letter channel
without blocking the next, and a valid one is split into its credit transfers.
| `camel infra run [...]
### [Contracts and security](contracts/)
diff --git a/camel-jbang-example-catalog.json b/camel-jbang-example-catalog.json
index c31f5db..96f8ca1 100644
--- a/camel-jbang-example-catalog.json
+++ b/camel-jbang-example-catalog.json
@@ -457,6 +457,66 @@
],
"order": 6
},
+ {
+ "name": "connect-service/ibm-mq-payments",
+ "title": "IBM MQ payments",
+ "description": "A simulated ERP puts four payment orders (XML in the
shape of ISO 20022 pain.001) on an IBM MQ queue of a queue manager started with
camel infra; each order is validated against its XML schema, an invalid one is
put on an errors queue with the schema error, one that fails three times is
moved to a backout queue by a dead letter channel without blocking the next,
and a valid one is split into its credit transfers.",
+ "level": "connect-service",
+ "teaches": {
+ "components": [
+ "jms",
+ "validator",
+ "file",
+ "log"
+ ],
+ "eips": [
+ "deadLetterChannel",
+ "doTry",
+ "filter",
+ "split",
+ "stop",
+ "throwException",
+ "setVariable",
+ "setHeader",
+ "convertBodyTo"
+ ],
+ "languages": [
+ "simple",
+ "xpath"
+ ]
+ },
+ "tags": [
+ "shop",
+ "ibm-mq",
+ "jms",
+ "xml",
+ "xsd",
+ "iso-20022",
+ "payments",
+ "backout",
+ "messaging"
+ ],
+ "bundled": false,
+ "requiresDocker": true,
+ "hasCitrusTests": true,
+ "files": [
+ "README.md",
+ "application.properties",
+ "erp.camel.yaml",
+ "ibm-mq-payments.camel.yaml",
+ "mqjms.log.0",
+ "payment-order.xsd",
+ "payments/payment-001.xml",
+ "payments/payment-002.xml",
+ "payments/payment-003.xml",
+ "payments/payment-004.xml"
+ ],
+ "infraServices": [
+ "ibmmq"
+ ],
+ "ciSkip": true,
+ "order": 9
+ },
{
"name": "connect-service/iot-telemetry",
"title": "IoT telemetry",
diff --git a/connect-service/README.md b/connect-service/README.md
index 2775a81..b81d8f7 100644
--- a/connect-service/README.md
+++ b/connect-service/README.md
@@ -13,6 +13,7 @@ SQL, JMS, MQTT, Kafka and FTP against a service the Camel CLI
starts for you wit
| [FTP courier](ftp/) | Each order on the shipments queue of an Artemis broker
becomes a file on the courier's FTP server, both started with camel infra; the
log shows each shipment uploaded and camel infra get ftp shows where the files
landed. | `camel infra run artemis ftp` |
| [Camel 1.0 tribute](camel-1-tribute/) | The very first Camel example of
2007, JMS to file: a timer sends ten messages to a queue on an Artemis broker
started with camel infra, and the consumer writes each message to a file in
outbox; the log shows both sides. | `camel infra run artemis` |
| [IoT telemetry](iot-telemetry/) | Three simulated cold-room sensors publish
a reading every second to a Mosquitto broker started with camel infra; the shop
subscribes with a wildcard topic and logs an average per room every ten seconds
with an aggregator, at most one alert per room per window with a throttle per
room, and a warning when a sensor goes silent with an aggregator completion
timeout. | `camel infra run mosquitto` |
+| [IBM MQ payments](ibm-mq-payments/) | A simulated ERP puts four payment
orders (XML in the shape of ISO 20022 pain.001) on an IBM MQ queue of a queue
manager started with camel infra; each order is validated against its XML
schema, an invalid one is put on an errors queue with the schema error, one
that fails three times is moved to a backout queue by a dead letter channel
without blocking the next, and a valid one is split into its credit transfers.
| `camel infra run ibmmq` |
Start with [SQL database](sql/); the examples read best in the order above,
each one building on what the one before it set up.
diff --git a/connect-service/ibm-mq-payments/README.md
b/connect-service/ibm-mq-payments/README.md
new file mode 100644
index 0000000..c7278b7
--- /dev/null
+++ b/connect-service/ibm-mq-payments/README.md
@@ -0,0 +1,119 @@
+# IBM MQ payments
+
+The shop pays its suppliers with payment orders in XML, which arrive on an IBM
MQ queue. Each order is checked against
+its XML schema and sent to the bank one transfer at a time. An invalid order
and one that keeps failing are parked on
+other queues for a person, so they never block the queue.
+
+## What you will see
+
+```text
+INFO ... erp.camel.yaml:18 : ERP: payment-001.xml put on DEV.QUEUE.1
+INFO ... ibm-mq-payments.camel.yaml:25 : Payment PMT-001 received
+INFO ... ibm-mq-payments.camel.yaml:60 : Payment PMT-001: 500.00 EUR to Mug
Makers
+INFO ... ibm-mq-payments.camel.yaml:60 : Payment PMT-001: 450.00 EUR to Shirt
Supply
+INFO ... ibm-mq-payments.camel.yaml:60 : Payment PMT-001: 300.00 EUR to Cap
Company
+INFO ... ibm-mq-payments.camel.yaml:74 : Payment PMT-001: 3 transfer(s) sent
to the bank, control sum 1250.00
+...
+INFO ... ibm-mq-payments.camel.yaml:25 : Payment PMT-002 received
+INFO ... ibm-mq-payments.camel.yaml:83 : DEV.QUEUE.2: an invalid payment
order, cvc-datatype-valid.1.2.1: '99,50' is not a valid value for 'decimal'.
+INFO ... ibm-mq-payments.camel.yaml:43 : Payment PMT-002 is invalid, put on
DEV.QUEUE.2
+...
+INFO ... ibm-mq-payments.camel.yaml:25 : Payment PMT-003 received
+WARN ... DeadLetterChannel : Failed delivery for (MessageId: ...) at
payments[throwException1] ibm-mq-payments.camel.yaml:52. On delivery attempt: 0
caught: java.lang.IllegalStateException: the bank takes transfers in EUR only
+WARN ... DeadLetterChannel : Failed delivery for (MessageId: ...) ... On
delivery attempt: 1 caught: ...
+WARN ... DeadLetterChannel : Failed delivery for (MessageId: ...) ... On
delivery attempt: 2 caught: ...
+INFO ... ibm-mq-payments.camel.yaml:90 : DEV.QUEUE.3: payment PMT-003 failed
three times and needs a person
+...
+INFO ... ibm-mq-payments.camel.yaml:25 : Payment PMT-004 received
+INFO ... ibm-mq-payments.camel.yaml:60 : Payment PMT-004: 120.00 EUR to Cap
Company
+INFO ... ibm-mq-payments.camel.yaml:74 : Payment PMT-004: 1 transfer(s) sent
to the bank, control sum 120.00
+```
+
+## Install Camel CLI
+
+Install [JBang](https://www.jbang.dev/download/) and the Camel CLI as
described in the
+[root README](../../README.md#install-the-camel-cli); `camel --version`
confirms the install.
+
+## Run it
+
+Start an IBM MQ queue manager (the IBM MQ developer image, queue manager QM1
on port 1414), in a terminal of its own:
+
+```shell
+camel infra run ibmmq
+```
+
+IBM ships this image for x86-64 only. On a Mac with Apple silicon, Docker runs
it with Rosetta emulation, which
+must be turned on in Docker Desktop; it is slower to start, but works.
+
+Then run the example:
+
+```shell
+camel run *
+```
+
+This runs the payment routes and a simulated ERP in one app. Stop the example
with `ctrl` + `c`, and the queue manager
+with `camel infra stop ibmmq`.
+
+## How it works
+
+- `payments/` holds four payment orders. `payment-order.xsd` is a small XML
schema with the shape of ISO 20022
+ pain.001 (customer credit transfer initiation): a group header with the
message id, the number of transactions and
+ their control sum, and the credit transfers. PMT-002 writes its amount with
a decimal comma, and PMT-003 pays in
+ Swedish kronor.
+- `erp.camel.yaml` plays the shop's ERP system: it puts each order on the
payments queue, one a second.
+- The developer image has three queues the app user may use: `DEV.QUEUE.1` for
the payments, `DEV.QUEUE.2` for
+ invalid orders, and `DEV.QUEUE.3` as the backout queue (`payments.queue`,
`errors.queue`, `backout.queue`).
+- `application.properties` declares the IBM MQ connection factory as a bean
(`camel.beans.mqConnectionFactory`), so
+ the payment routes and the ERP can also run as two apps. The `jms` component
uses it, with the app user and
+ password. `camel.jbang.dependencies` adds the IBM MQ client.
+- The `payments` route reads the message id with XPath, then checks the order
with the `validator` component. A
+ `SchemaValidationException` is caught: the order goes to the errors queue
with the first schema error in the header
+ `PaymentError`, and `stop` ends the route.
+- The bank takes transfers in euro only, so the route fails for another
currency. The route's `deadLetterChannel`
+ tries a failing order three times, then moves the original message to the
backout queue, and the next order is
+ processed: one bad order never blocks the queue.
+- A `split` with XPath sends each credit transfer on, and the route logs the
number of transfers and the control sum.
+- The `errors` and `backout` routes read the two parking queues and log what a
person would look at.
+
+## Build it step by step
+
+Ask your assistant, or type it yourself, one step at a time, and run after
each:
+
+1. An ERP route that puts the files in `payments/` on the IBM MQ queue
`DEV.QUEUE.1`, and a route that reads the queue
+ and logs the message id of each payment order.
+2. Validate each order against `payment-order.xsd`. Put an invalid order on
`DEV.QUEUE.2`, with the validation error
+ in a header, and log it.
+3. A payment in another currency than EUR fails. After three tries, move it to
the backout queue `DEV.QUEUE.3`, so it
+ does not block the queue, and log what arrives there.
+4. Split each payment into its credit transfers, log each one, and log
+ "Payment PMT-001: 3 transfer(s) sent to the bank, control sum 1250.00".
+
+## Try changing
+
+- Set `maximumRedeliveries` to 0: PMT-003 goes to the backout queue after one
try.
+- Remove `useOriginalMessage: true`: the backout queue then gets the message
as it was when it failed, not as it
+ arrived. Here it is the same, but after a transformation it would not be.
+- Fix the amount of PMT-002 to `99.50`: the order is valid, and its transfer
is sent.
+
+## Integration testing
+
+The example comes with a test in the [Citrus](https://citrusframework.org/)
YAML DSL,
+`test/ibm-mq-payments.citrus.it.yaml`, which the Camel CLI runs:
+
+```shell
+camel test run test/ibm-mq-payments.citrus.it.yaml
+```
+
+The test starts the queue manager itself, runs the payment routes and the ERP
as two integrations, and verifies the
+sent payments, the invalid one and the backout. CI skips it: the IBM MQ image
cannot be pulled reliably from GitHub
+Actions, which is why Camel's own IBM MQ tests are off there too.
+
+## Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+[let us know](https://camel.apache.org/community/support/).
+
+We also love contributors, so
+[get involved](https://camel.apache.org/community/contributing/) :-)
+
+The Camel riders!
diff --git a/connect-service/ibm-mq-payments/application.properties
b/connect-service/ibm-mq-payments/application.properties
new file mode 100644
index 0000000..cc228e0
--- /dev/null
+++ b/connect-service/ibm-mq-payments/application.properties
@@ -0,0 +1,40 @@
+# 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.
+
+# the IBM MQ client is not part of Camel
+camel.jbang.dependencies=com.ibm.mq:com.ibm.mq.jakarta.client:9.4.3.0
+
+# the connection to the queue manager that camel infra run ibmmq starts (the
IBM MQ developer image); a bean
+# declared here serves both the payments routes and the ERP, also when they
run as two apps
+camel.beans.mqConnectionFactory=#class:com.ibm.mq.jakarta.jms.MQConnectionFactory
+camel.beans.mqConnectionFactory.hostName=localhost
+camel.beans.mqConnectionFactory.port=1414
+camel.beans.mqConnectionFactory.queueManager=QM1
+camel.beans.mqConnectionFactory.channel=DEV.APP.SVRCONN
+# 1 is a client connection over TCP
+camel.beans.mqConnectionFactory.transportType=1
+camel.component.jms.connectionFactory=#mqConnectionFactory
+# the app user and password of the developer image; set IBMMQ_USERNAME and
IBMMQ_PASSWORD to use others
+ibmmq.username=app
+ibmmq.password=passw0rd
+camel.component.jms.username={{ibmmq.username}}
+camel.component.jms.password={{ibmmq.password}}
+
+# the developer image has three queues that the app user may use
+payments.queue=DEV.QUEUE.1
+errors.queue=DEV.QUEUE.2
+backout.queue=DEV.QUEUE.3
diff --git a/connect-service/ibm-mq-payments/erp.camel.yaml
b/connect-service/ibm-mq-payments/erp.camel.yaml
new file mode 100644
index 0000000..ed744ad
--- /dev/null
+++ b/connect-service/ibm-mq-payments/erp.camel.yaml
@@ -0,0 +1,19 @@
+# Plays the shop's ERP system: it puts each payment order in payments/ on the
payments queue, one a second.
+- route:
+ id: erp
+ from:
+ uri: file
+ parameters:
+ directoryName: payments
+ noop: true
+ sortBy: "file:name"
+ maxMessagesPerPoll: 1
+ eagerMaxMessagesPerPoll: false
+ delay: 1000
+ steps:
+ - convertBodyTo:
+ type: String
+ - to:
+ uri: "jms:queue:{{payments.queue}}"
+ - log:
+ message: "ERP: ${header.CamelFileName} put on {{payments.queue}}"
diff --git a/connect-service/ibm-mq-payments/ibm-mq-payments.camel.yaml
b/connect-service/ibm-mq-payments/ibm-mq-payments.camel.yaml
new file mode 100644
index 0000000..6a36983
--- /dev/null
+++ b/connect-service/ibm-mq-payments/ibm-mq-payments.camel.yaml
@@ -0,0 +1,91 @@
+# The shop pays its suppliers: payment orders in XML arrive on an IBM MQ
queue. Each order is checked against the
+# XML schema, sent on to the bank one transfer at a time, and parked on
another queue when it is invalid or keeps
+# failing, so it never blocks the queue.
+- route:
+ id: payments
+ # a payment that fails three times is moved to the backout queue as it
arrived, and the next one is processed
+ errorHandler:
+ deadLetterChannel:
+ deadLetterUri: "jms:queue:{{backout.queue}}"
+ useOriginalMessage: true
+ redeliveryPolicy:
+ maximumRedeliveries: 2
+ redeliveryDelay: 500
+ retryAttemptedLogLevel: WARN
+ logStackTrace: false
+ from:
+ uri: "jms:queue:{{payments.queue}}"
+ steps:
+ - setVariable:
+ name: msgId
+ expression:
+ xpath:
+ expression:
"//*[local-name()='GrpHdr']/*[local-name()='MsgId']/text()"
+ resultType: java.lang.String
+ - log:
+ message: "Payment ${variable.msgId} received"
+ - doTry:
+ steps:
+ - to:
+ uri: validator:payment-order.xsd
+ doCatch:
+ - exception:
+ -
org.apache.camel.support.processor.validation.SchemaValidationException
+ steps:
+ # the first error of the schema check, for a person to read
+ - setHeader:
+ name: PaymentError
+ expression:
+ simple:
+ expression: "${exception.errors[0].message}"
+ - to:
+ uri: "jms:queue:{{errors.queue}}"
+ - log:
+ message: "Payment ${variable.msgId} is invalid, put on
{{errors.queue}}"
+ - stop: {}
+ # the bank takes transfers in euro only; another currency fails every
time
+ - filter:
+ expression:
+ xpath:
+ expression: "//*[local-name()='InstdAmt'][@Ccy != 'EUR']"
+ steps:
+ - throwException:
+ exceptionType: java.lang.IllegalStateException
+ message: "the bank takes transfers in EUR only"
+ - split:
+ expression:
+ xpath:
+ expression: "//*[local-name()='CdtTrfTxInf']"
+ steps:
+ - log:
+ message: "Payment ${variable.msgId}:
${xpath(//*[local-name()='InstdAmt']/text())}
${xpath(//*[local-name()='InstdAmt']/@Ccy)} to
${xpath(//*[local-name()='Cdtr']/*[local-name()='Nm']/text())}"
+ - setVariable:
+ name: transfers
+ expression:
+ xpath:
+ expression:
"//*[local-name()='GrpHdr']/*[local-name()='NbOfTxs']/text()"
+ resultType: java.lang.String
+ - setVariable:
+ name: ctrlSum
+ expression:
+ xpath:
+ expression:
"//*[local-name()='GrpHdr']/*[local-name()='CtrlSum']/text()"
+ resultType: java.lang.String
+ - log:
+ message: "Payment ${variable.msgId}: ${variable.transfers}
transfer(s) sent to the bank, control sum ${variable.ctrlSum}"
+
+# A person looks at the parked payments; here the two queues are read and
logged
+- route:
+ id: errors
+ from:
+ uri: "jms:queue:{{errors.queue}}"
+ steps:
+ - log:
+ message: "{{errors.queue}}: an invalid payment order,
${header.PaymentError}"
+- route:
+ id: backout
+ from:
+ uri: "jms:queue:{{backout.queue}}"
+ steps:
+ - log:
+ message: "{{backout.queue}}: payment
${xpath(//*[local-name()='MsgId']/text())} failed three times and needs a
person"
diff --git a/connect-service/ibm-mq-payments/metadata.json
b/connect-service/ibm-mq-payments/metadata.json
new file mode 100644
index 0000000..d4d6c58
--- /dev/null
+++ b/connect-service/ibm-mq-payments/metadata.json
@@ -0,0 +1,46 @@
+{
+ "title": "IBM MQ payments",
+ "description": "A simulated ERP puts four payment orders (XML in the shape
of ISO 20022 pain.001) on an IBM MQ queue of a queue manager started with camel
infra; each order is validated against its XML schema, an invalid one is put on
an errors queue with the schema error, one that fails three times is moved to a
backout queue by a dead letter channel without blocking the next, and a valid
one is split into its credit transfers.",
+ "level": "connect-service",
+ "order": 9,
+ "teaches": {
+ "components": [
+ "jms",
+ "validator",
+ "file",
+ "log"
+ ],
+ "eips": [
+ "deadLetterChannel",
+ "doTry",
+ "filter",
+ "split",
+ "stop",
+ "throwException",
+ "setVariable",
+ "setHeader",
+ "convertBodyTo"
+ ],
+ "languages": [
+ "simple",
+ "xpath"
+ ]
+ },
+ "tags": [
+ "shop",
+ "ibm-mq",
+ "jms",
+ "xml",
+ "xsd",
+ "iso-20022",
+ "payments",
+ "backout",
+ "messaging"
+ ],
+ "infraServices": [
+ "ibmmq"
+ ],
+ "requiresDocker": true,
+ "ciSkip": true,
+ "bundled": false
+}
diff --git a/connect-service/ibm-mq-payments/payment-order.xsd
b/connect-service/ibm-mq-payments/payment-order.xsd
new file mode 100644
index 0000000..035d85c
--- /dev/null
+++ b/connect-service/ibm-mq-payments/payment-order.xsd
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A small payment order with the shape of ISO 20022 pain.001 (customer
credit transfer initiation): a group header
+ with the message id, the number of transactions and their sum, and a
payment with one or more credit transfers. -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:camel:example:payment-order"
+ xmlns="urn:camel:example:payment-order"
+ elementFormDefault="qualified">
+ <xs:element name="Document">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="CstmrCdtTrfInitn">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="GrpHdr">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="MsgId" type="xs:string"/>
+ <xs:element name="NbOfTxs" type="xs:positiveInteger"/>
+ <xs:element name="CtrlSum" type="Amount"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="PmtInf">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Dbtr" type="Party"/>
+ <xs:element name="CdtTrfTxInf" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="EndToEndId" type="xs:string"/>
+ <xs:element name="InstdAmt">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="Amount">
+ <xs:attribute name="Ccy" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="[A-Z]{3}"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Cdtr" type="Party"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="Party">
+ <xs:sequence>
+ <xs:element name="Nm" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:simpleType name="Amount">
+ <xs:restriction base="xs:decimal">
+ <xs:fractionDigits value="2"/>
+ <xs:minExclusive value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
diff --git a/connect-service/ibm-mq-payments/payments/payment-001.xml
b/connect-service/ibm-mq-payments/payments/payment-001.xml
new file mode 100644
index 0000000..61403d9
--- /dev/null
+++ b/connect-service/ibm-mq-payments/payments/payment-001.xml
@@ -0,0 +1,11 @@
+<Document xmlns="urn:camel:example:payment-order">
+ <CstmrCdtTrfInitn>
+
<GrpHdr><MsgId>PMT-001</MsgId><NbOfTxs>3</NbOfTxs><CtrlSum>1250.00</CtrlSum></GrpHdr>
+ <PmtInf>
+ <Dbtr><Nm>Camel Shop</Nm></Dbtr>
+ <CdtTrfTxInf><EndToEndId>PMT-001-1</EndToEndId><InstdAmt
Ccy="EUR">500.00</InstdAmt><Cdtr><Nm>Mug Makers</Nm></Cdtr></CdtTrfTxInf>
+ <CdtTrfTxInf><EndToEndId>PMT-001-2</EndToEndId><InstdAmt
Ccy="EUR">450.00</InstdAmt><Cdtr><Nm>Shirt Supply</Nm></Cdtr></CdtTrfTxInf>
+ <CdtTrfTxInf><EndToEndId>PMT-001-3</EndToEndId><InstdAmt
Ccy="EUR">300.00</InstdAmt><Cdtr><Nm>Cap Company</Nm></Cdtr></CdtTrfTxInf>
+ </PmtInf>
+ </CstmrCdtTrfInitn>
+</Document>
diff --git a/connect-service/ibm-mq-payments/payments/payment-002.xml
b/connect-service/ibm-mq-payments/payments/payment-002.xml
new file mode 100644
index 0000000..89768cc
--- /dev/null
+++ b/connect-service/ibm-mq-payments/payments/payment-002.xml
@@ -0,0 +1,9 @@
+<Document xmlns="urn:camel:example:payment-order">
+ <CstmrCdtTrfInitn>
+
<GrpHdr><MsgId>PMT-002</MsgId><NbOfTxs>1</NbOfTxs><CtrlSum>99,50</CtrlSum></GrpHdr>
+ <PmtInf>
+ <Dbtr><Nm>Camel Shop</Nm></Dbtr>
+ <CdtTrfTxInf><EndToEndId>PMT-002-1</EndToEndId><InstdAmt
Ccy="EUR">99,50</InstdAmt><Cdtr><Nm>Mug Makers</Nm></Cdtr></CdtTrfTxInf>
+ </PmtInf>
+ </CstmrCdtTrfInitn>
+</Document>
diff --git a/connect-service/ibm-mq-payments/payments/payment-003.xml
b/connect-service/ibm-mq-payments/payments/payment-003.xml
new file mode 100644
index 0000000..1923200
--- /dev/null
+++ b/connect-service/ibm-mq-payments/payments/payment-003.xml
@@ -0,0 +1,9 @@
+<Document xmlns="urn:camel:example:payment-order">
+ <CstmrCdtTrfInitn>
+
<GrpHdr><MsgId>PMT-003</MsgId><NbOfTxs>1</NbOfTxs><CtrlSum>800.00</CtrlSum></GrpHdr>
+ <PmtInf>
+ <Dbtr><Nm>Camel Shop</Nm></Dbtr>
+ <CdtTrfTxInf><EndToEndId>PMT-003-1</EndToEndId><InstdAmt
Ccy="SEK">800.00</InstdAmt><Cdtr><Nm>Nordic Hoodies</Nm></Cdtr></CdtTrfTxInf>
+ </PmtInf>
+ </CstmrCdtTrfInitn>
+</Document>
diff --git a/connect-service/ibm-mq-payments/payments/payment-004.xml
b/connect-service/ibm-mq-payments/payments/payment-004.xml
new file mode 100644
index 0000000..89db7d4
--- /dev/null
+++ b/connect-service/ibm-mq-payments/payments/payment-004.xml
@@ -0,0 +1,9 @@
+<Document xmlns="urn:camel:example:payment-order">
+ <CstmrCdtTrfInitn>
+
<GrpHdr><MsgId>PMT-004</MsgId><NbOfTxs>1</NbOfTxs><CtrlSum>120.00</CtrlSum></GrpHdr>
+ <PmtInf>
+ <Dbtr><Nm>Camel Shop</Nm></Dbtr>
+ <CdtTrfTxInf><EndToEndId>PMT-004-1</EndToEndId><InstdAmt
Ccy="EUR">120.00</InstdAmt><Cdtr><Nm>Cap Company</Nm></Cdtr></CdtTrfTxInf>
+ </PmtInf>
+ </CstmrCdtTrfInitn>
+</Document>
diff --git
a/connect-service/ibm-mq-payments/test/ibm-mq-payments.citrus.it.yaml
b/connect-service/ibm-mq-payments/test/ibm-mq-payments.citrus.it.yaml
new file mode 100644
index 0000000..e0fbcbf
--- /dev/null
+++ b/connect-service/ibm-mq-payments/test/ibm-mq-payments.citrus.it.yaml
@@ -0,0 +1,56 @@
+name: ibm-mq-payments-test
+description: The ibm-mq-payments example sends, parks and backs out payment
orders on IBM MQ, as its README shows
+actions:
+ - camel:
+ infra:
+ run:
+ service: ibmmq
+ fixedPort: true
+ - camel:
+ cli:
+ run:
+ integration:
+ name: "ibm-mq-payments"
+ file: "../ibm-mq-payments.camel.yaml"
+ systemProperties:
+ file: "../application.properties"
+ resources:
+ - "payment-order.xsd"
+ - camel:
+ cli:
+ verify:
+ integration: "ibm-mq-payments"
+ logMessage: "(ibm-mq-payments) started"
+ - camel:
+ cli:
+ run:
+ integration:
+ name: "erp"
+ file: "../erp.camel.yaml"
+ systemProperties:
+ file: "../application.properties"
+ resources:
+ - "payments/payment-001.xml"
+ - "payments/payment-002.xml"
+ - "payments/payment-003.xml"
+ - "payments/payment-004.xml"
+ - camel:
+ cli:
+ verify:
+ integration: "ibm-mq-payments"
+ logMessage: "Payment PMT-001: 3 transfer(s) sent to the bank,
control sum 1250.00"
+ - camel:
+ cli:
+ verify:
+ integration: "ibm-mq-payments"
+ logMessage: "DEV.QUEUE.2: an invalid payment order,
cvc-datatype-valid.1.2.1: '99,50' is not a valid value for 'decimal'."
+ - camel:
+ cli:
+ verify:
+ integration: "ibm-mq-payments"
+ logMessage: "DEV.QUEUE.3: payment PMT-003 failed three times and
needs a person"
+ - camel:
+ cli:
+ verify:
+ integration: "ibm-mq-payments"
+ logMessage: "Payment PMT-004: 1 transfer(s) sent to the bank,
control sum 120.00"