Technology Stack:
- Quarkus
- K-Native Eventing
- Red Hat Serverless
- Quarkus FUNQY
- Kafka
Company A is sending a payment transaction (credit card) to ACME. ACME has 4 business steps that need to happen for the transaction to be a success.
- Customer Profile Service System | To check if the customer is a valid customer
- Fraud Detection System | We need to verify the transaction is not fraudulent
- Payment Processing System | If the transaction is legitiate, we want to sent it to payments
- If the payment is successful Ledger Service | We want to capture it as successful Notification Service | And notify the customer.
Our current system has a workflow engine, it is stateful. We want to move it to a process that can be distributed, stateless and fully event driven.
- Write your own FUNQY event
- Annotate it in the correct part of your workflow
- Wire it up to a K-Native event
- Verify the result in Kafka
- Triggered by an external Knative CloudEvent (
defaultChain), e.g., from a curl call. - Mocks a call to a Customer Profile Service (verifies customer account is active).
- Marks transaction as VALIDATED.
- Returns a CloudEvent of type
fraudCheck.
NS=$(oc project -q)
oc exec -it curler -n "$NS" -- curl -v \
"http://broker-ingress.knative-eventing.svc.cluster.local/${NS}/default" \
-H "Ce-Id: txn-001" \
-H "Ce-Specversion: 1.0" \
-H "Ce-Type: defaultChain" \
-H "Ce-Source: bash" \
-H "Content-Type: application/json" \
-d '{"transactionId":"txn-1001","customerId":"42","amount":12500,"currency":"JPY"}'- Triggered by the
fraudCheckfunction (annotation-based mapping). - Mocks a Fraud Detection System (rules + ML).
- Business rule:
- If amount > 10,000 → FLAGGED for manual review.
- Otherwise → CLEARED.
- Emits a CloudEvent of type
annotatedto trigger the processPayment step.
NS=$(oc project -q)
oc exec -it curler -n "$NS" -- curl -v \
"http://broker-ingress.knative-eventing.svc.cluster.local/${NS}/default" \
-H "Ce-Id: txn-002" \
-H "Ce-Specversion: 1.0" \
-H "Ce-Type: fraudCheck" \
-H "Ce-Source: bash" \
-H "Content-Type: application/json" \
-d '{"transactionId":"txn-1002","customerId":"57","amount":5000,"currency":"USD"}'- Triggered by the
processPaymentfunction (annotation-based mapping). - Mocks:
- Core Banking API (debit customer account).
- Payment Gateway (Visa/MasterCard).
- Marks transaction as PROCESSED.
- Returns a CloudEvent of type
lastChainLink.
NS=$(oc project -q)
oc exec -it curler -n "$NS" -- curl -v \
"http://broker-ingress.knative-eventing.svc.cluster.local/${NS}/default" \
-H "Ce-Id: txn-003" \
-H "Ce-Specversion: 1.0" \
-H "Ce-Type: annotated" \
-H "Ce-Source: bash" \
-H "Content-Type: application/json" \
-d '{"transactionId":"txn-1003","customerId":"99","amount":2000,"currency":"EUR"}'- Triggered by
settleTransactionfunction. - Mocks:
- Ledger Service (recording transaction).
- Notification Service (alerting customer).
- Publishes the finalized transaction to Kafka using
NS=$(oc project -q)
oc exec -it curler -n "$NS" -- curl -v \
"http://broker-ingress.knative-eventing.svc.cluster.local/${NS}/default" \
-H "Ce-Id: txn-004" \
-H "Ce-Specversion: 1.0" \
-H "Ce-Type: lastChainLink" \
-H "Ce-Source: bash" \
-H "Content-Type: application/json" \
-d '{"transactionId":"txn-1004","customerId":"88","amount":7500,"currency":"GBP","status":"PROCESSED","message":"Payment successfully processed"}'- You have created a FUNQY Event in Quarkus
- You created a K-Native Event that can respond to triggers and trigger itself
- See how quickly Quarkus can build Serverless Events