Examples
Runnable Apache Camel Quarkus examples for every pattern category, built with the shipping domain on Podman.
Chapter 100
Each pattern category has a corresponding runnable Quarkus project under examples/. Every example:
- Uses Apache Camel on Quarkus with the Java DSL and shipping domain
- Runs against the local Podman stack (Kafka, Pulsar, Redis, PostgreSQL)
- Can be started with a single command:
mvn quarkus:dev
Getting started
# Start the infrastructure stack
./scripts/setup-stack.sh
# Run a specific example
cd examples/09-routing-fundamentals
mvn quarkus:dev
Pattern examples
| Example | Patterns | Infrastructure | Chapter |
|---|---|---|---|
| 04-channel-types | Point-to-Point, Publish-Subscribe, Datatype Channel, Redis Pub/Sub | Kafka + Pulsar + Redis | Ch 4 |
| 05-reliability | Dead Letter Channel, Guaranteed Delivery | Kafka | Ch 5 |
| 06-channel-infra | Channel Adapter, Messaging Bridge, Message Bus | Kafka + Pulsar + PostgreSQL | Ch 6 |
| 07-message-types | Command, Document, Event Message | Kafka | Ch 7 |
| 08-message-metadata | Correlation ID, Message Sequence, Expiration, Format Indicator | Kafka | Ch 8 |
| 09-routing-fundamentals | Content-Based Router, Filter, Splitter, Recipient List | Kafka | Ch 9 |
| 10-composed-routing | Scatter-Gather, Routing Slip | Kafka | Ch 10 |
| 11-advanced-routing | Dynamic Router, Wire Tap, Resequencer, Composed Message Processor, Load Balancer | Kafka | Ch 11 |
| 12-transformation | Message Translator, Content Enricher (Redis), Content Filter | Kafka + Redis | Ch 12 |
| 13-aggregator | Aggregator (in-memory + PostgreSQL JDBC), Normalizer | Kafka + PostgreSQL | Ch 13 |
| 14-consumer-patterns | Polling Consumer (Kafka + PostgreSQL), Event-Driven Consumer (Kafka + Pulsar), Competing Consumers, Message Dispatcher | Kafka + Pulsar + PostgreSQL | Ch 14 |
| 15-endpoints | Idempotent Receiver (JDBC), Outbox Pattern (PostgreSQL), Durable Subscriber (Pulsar), Service Activator | Kafka + Pulsar + PostgreSQL | Ch 15 |
| 16-endpoint-management | Messaging Gateway, Selective Consumer, Channel Purger, Messaging Mapper | Kafka | Ch 16 |
| 17-observability | Control Bus, Wire Tap, Message History, Message Store (PostgreSQL) | Kafka + PostgreSQL | Ch 17 |
| 18-testing-management | Test Message, Detour, Smart Proxy, Circuit Breaker | Kafka | Ch 18 |
Appendix examples
| Example | Patterns | Infrastructure | Appendix |
|---|---|---|---|
| 20-kafka-deep-dive | Key-based partitioning, transactional pipeline, consumer lag monitoring | Kafka | Appendix B |
| 21-pulsar-deep-dive | Shared/Key_Shared subscriptions, dead letter topics | Pulsar | Appendix C |
| 22-redis-integration | Caching enrichment, idempotent receiver, distributed locking | Kafka + Redis | Appendix D |
| 24-drools-rules | Rule-based content routing with Drools 10 rule units | Kafka | Appendix F |
| 25-quarkus-flow | Order fulfillment saga with CDI state machine and Camel routes | Kafka | Appendix G |
| 27-observability-stack | OpenTelemetry tracing, Micrometer metrics, health probes | Kafka (LGTM optional) | Appendix I |
| 32-kafka-consumer-tuning | Throughput-tuned, safety-first, and static-membership consumers | Kafka | Appendix N |
| 33-kafka-producer-tuning | Batched, compressed, idempotent, and synchronous producers | Kafka | Appendix O |
| 37-testing-strategies | Three-tier testing: unit (MockEndpoint), integration (REST Assured), Newman | None (self-contained) | Appendix S |
Case studies
| Example | Description | Appendix |
|---|---|---|
| loan-broker | Scatter-Gather โ fan out to banks, aggregate best offer (13 EIP patterns) | Appendix J |
| bond-trading | Market data normalization, desk filtering, trade execution (16 EIP patterns) | Appendix K |
Infrastructure
The shared Podman stack provides all backing services:
# Base stack: Kafka (KRaft), Pulsar, Redis, PostgreSQL, Apicurio, Kafka UI
./scripts/setup-stack.sh
# With observability: Grafana, Loki, Tempo, Mimir, OTel Collector
./scripts/setup-stack.sh --lgtm
See Prerequisites & Setup for full environment details.