Although Mule ESB is not officially supported by JRebel, we have found a workaround. First of all, let me start by stating that:
- As of today, it is not possible to hot-deploy Mule XML flows by using JRebel. Mule, however, offers its own mechanisms for achieving this same thing. As such, the lack of JRebel support for this is no deal breaker.
So, the only thing we can hot-deploy are the Java classes, which is still very welcome. How do we do that?
Start by configuring the JRebel agent in $MULE_HOME/conf/wrapper.conf. The required lines, in our case, were:
wrapper.java.additional.13=-javaagent:{path to jrebel.jar}
wrapper.java.additional.14=-Xbootclasspath:{path to rebelboot.jar}
wrapper.java.additional.16=-Drebel.remoting_plugin=true
wrapper.java.additional.19=-Drebel.remoting_port={whatever}
These are the JVM paremeters required to launch JRebel along with Mule. The numbering of the parameters is arbitrary.
We want to use JRebel in remote mode. You can read about this mode in the docs. That's the reason for the wrapper.java.additional.16=-Drebel.remoting_plugin=true
and wrapper.java.additional.19=-Drebel.remoting_port={whatever}
paremeters.
- Now go ahead and launch Mule by either executing mule.bat or mule.sh, depending on your environment (Windows or *nix). JRebel should start along with it.
- Place your Mule applications inside $MULE_HOME/apps. They will be automatically deployed and, from now on, their .class files will be monitored by JRebel.
- Inside your IDE, install the JRebel plugin and apply your license. Afterwards, add the JRebel nature to your project and configure its remote server URL using the port we previously defined inside
wrapper.conf
.
- Do whatever changes you need to do to your code and sync. They should be successfully hot-deployed into the running Mule instance.