- BRM – rules execution (Drools)
- BPM – business process execution, task management, background jobs (jBPM)
- BPM-UI – visualize your bpm components on runtime such as process definition and instance (since 6.4)
- BRP – business resource planning (Optaplanner) (since 6.4)
- JBoss EAP
- Wildfly
- Tomcat
- WebLogic
- WebSphere
It’s time to introduce Wildfly Swarm (to those that haven’t heard about it yet) …
Swarm offers an innovative approach to packaging and running JavaEE applications by packaging them with just enough of the platform to “java -jar” your application
So what Wildfly Swarm means in context of KIE Server?
Actually it means a lot:
- first of all it allows us to build executable jars that will bring in KIE Server capabilities to simple java -jar way of working with all it’s power!
- next you can have a “executable kjar” just by starting it with argument that identifies kjar to be available for execution (Group Artifact Version)
- you can still run in managed mode – connected to controller and managed from within controller but without a need to provision your application server
- Clone this repository kie-server-swarm into your local environment.
- Build the project with maven (mvn clean package)
- Make sure you run it with latest Maven otherwise you might run into build errors – I tested it with 3.3.9 so it works certainly with it
- Once it’s successfully build you’ll find following file inside the target folder
- kie-server-swarm-1.0-swarm.jar
- Now you’re ready to rock with KIE Server on Wildfly Swarm
- BRM – includes BRM capability of the KIE Server that allows rules execution only
- no server components besides REST is configured
- build it with – mvn clean package -PBRM
- BPM – includes both BRM and BPM capabilities of the KIE Server – this is the default profile
- configures Swarm to have transactions and data sources enabled
- build it with – mvn clean package -PBPM or mvn clean package
Let’s get our hands dirty with running KIE Server on Wildfly Swarm
First thing, let’s just start empty server that will let us manage it manually – creating containers, running rules and processes via REST api
Make sure you’re in the project folder (where you executed maven build) and then simply run this command:
java -Dorg.kie.server.id=swarm-kie-server -Dorg.kie.server.location=http://localhost:8380/server -Dswarm.port.offset=300 -jar target/kie-server-swarm-1.0-swarm.jar
NOTE: since KIE Server requires authentication, whenever you attempt to access its REST endpoints you need to logon – by default you should be able to logon with kieserver/kieserver1!
you can customize users and roles by editing following files:
Now let’s examine a bit what all these parameters mean:
- -Dorg.kie.server.id=swarm-kie-server – specifies the unique identifier of the kie server – it is important when running in managed mode but good to use it always to make it a habit
- -Dorg.kie.server.location=http://localhost:8380/server – specifies the actual location where our KIE Server is going to be available – this must be a direct URL to actual instance even it if’s behind load balancer – again important when running in managed mode
- -Dswarm.port.offset=300 – sets global port offset to avoid port conflicts when running many instances of wildfly on same machine
java -Dorg.kie.server.id=swarm-kie-server -Dorg.kie.server.location=http://localhost:8380/server -jar target/kie-server-swarm-1.0-swarm.jar org.jbpm:HR:1.0
org.jbpm:HR:1.0
Before you start wildfly Swarm with KIE Server, make sure you start controller (KIE workbench) so you’ll see how nicely it registers automatically upon start.
Once controller (workbench) is running issue following command:
java -Dorg.kie.server.id=swarm-kie-server -Dorg.kie.server.location=http://localhost:8380/server -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller -jar target/kie-server-swarm-1.0-swarm.jar
- -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller
- host (localhost in this case)
- port (8080 in this case)
- context root (kie-wb in this case)
Enjoy your dive into Swarm and as usual comments are more than welcome.