← Projects

mulesoft-patterns-examples

Mule 4 · MIT · Active

On this page

Code

When an article describes a pattern in a Mule 4 flow, you want the flow running, not just the drawing. mulesoft-patterns-examples has runnable flows for the patterns: it is the code for Integration patterns in Mule: you already use them, you just don’t know their names and for the series on SOLID and Enterprise Integration Patterns, with small, tested flows. One curl and you see the pattern answer.

The catalog

The EIP catalog of the site uses these 26 icons from signwright, redrawn from the Enterprise Integration Patterns icons by Gregor Hohpe and Bobby Woolf (CC BY 4.0).

A grid of the 26 integration pattern icons, each with its pattern name, from Aggregator to Transactional Client; icons redrawn from the Enterprise Integration Patterns icons by Gregor Hohpe and Bobby Woolf, CC BY 4.0.

What it does

  • SOLID: for each principle, a “before” endpoint that breaks it and an “after” endpoint that follows it, with MUnit tests that show where the two behave the same and where the “before” causes trouble.
  • EIP: patterns around an order that is routed, charged, paid, reserved and invoiced, using only HTTP, DataWeave and object stores.
  • Everything runs in a single Mule application, with no external systems: ERPs, banks and payment providers are simulated.

Limit: publish-subscribe, dead letter channel and point-to-point channel are documented on the wiki, not executable here, because they need an Anypoint MQ broker.

Getting started

Needs Java 17, Maven 3.9.x and Mule runtime 4.9. The application listens on port 8081.

curl -s 'localhost:8081/lsp/before/orders/ORD-1001?provider=new'

MUnit runs on the Enterprise runtime, so mvn clean test needs credentials for MuleSoft’s Enterprise repository in ~/.m2/settings.xml.

Where it appears

Code for this page