In this example we are going to:
- build a Sample Mule application to run into Spring boot Mule 4 Runtime
- build and run Spring boot Admin server to monitor Spring boot Mule 4 Runtime
- build Spring boot Mule 4 Runtime and run Sample Mule application.
- Optionally, build docker images and deploy docker compose.
This Mule application contains a simple 'echo' API (APIKit router + APIKit console) exposed on port 8081 and a simple fixed scheduler.
Build sample Mule application test-mule-app
.
cd test-mule-app
mvn clean package
Build and run spring-boot-admin-server
:
cd spring-boot-admin-server
mvn clean package
java -jar target/spring-boot-admin-server-1.0.0.jar
Build spring-boot-mule4-runtime-ce
:
cd spring-boot-mule4-runtime-ce
mvn clean package -Dmule.bom.version=4.5.0-20220221
Run Sample Mule application:
java -Dmule.base=./test/mule -Dmule.apps=file:../test-mule-app/target/test-mule-app-1.0.0-mule-application.jar -Dmule.cleanStartup=true -jar target/spring-boot-mule4-runtime-ce-4.5.0.jar
Open your browser http://localhost:8882 to access Spring Boot Admin Server:
Open your browser http://localhost:8081/console to access sample Mule application api console.
-
Ensure sample Mule application
test-mule-app
is built:cd test-mule-app mvn clean package
-
Activate
docker
maven profile to install the docker image for Spring boot Admin server:cd spring-boot-admin-server mvn clean install -Pdocker
-
Activate
docker
maven profile to install the docker image for Spring boot Mule 4 Runtime:cd spring-boot-mule4-runtime-ce mvn clean install -Pdocker -Dmule.bom.version=4.5.0-20220221
-
docker-compose -f sample-docker-compose.yml --project-name my-mule4-stack up -d
-
Open your browser http://localhost:8882 to access Spring Boot Admin Server.
-
Open your browser http://localhost:8081/console to access sample Mule application api console.
Take a look to spring-boot-mule4-runtime-ee sample project.
Cluster core extension turns, transparently, Mule Runtime into a high performance clustered and horizontally scalable system. Once activated, Mule's VM queues and ObjectStores are turned into full clustered structures.
Take a look to product documentation for more details.
Build and run spring-boot-mule4-runtime-ce
with Hawkore's cluster core extension:
cd spring-boot-mule4-runtime-ce
mvn clean package -Phk-cluster-ext -Dmule.bom.version=4.5.0-20220221
java -Dmule.base=./test/mule -Dmule.ignite.cluster.configfile=[FULL PATH TO MULE BASE]/conf/ignite-mule-config-local-test.xml -jar target/spring-boot-mule4-runtime-ce-4.5.0.jar
NOTE: For testing purposes, a "server mode" ignite configuration is used. On production, mule runtimes should run as "client nodes".
If you want to take full distributed computation power into your Mule's applications, check Apache Ignite Connector for Mule 4 for more details.