Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate JRebel with Mule ESB?

Has anybody sometime tried to use JRebel with Mule instead of a typical application server? If so, could you describe your experience?

As far as I know, currently, Mule is not officially supported by the JRebel team. However, I was wondering if there might be some workaround to this limitation.

like image 823
Enrique Avatar asked Oct 14 '15 17:10

Enrique


People also ask

What is JRebel used for?

JRebel is a productivity tool that allows developers to reload code changes instantly. JRebel skips the rebuild, restart, and redeploy cycle common in Java development.

Is MuleSoft an ESB?

Mule, the runtime engine of Anypoint Platform, is a lightweight Java-based enterprise service bus (ESB) and integration platform that allows developers to connect applications together quickly and easily, enabling them to exchange data.

Is MuleSoft based on Apache Camel?

Both platforms are open-source, but they differ significantly in their implementation of the open-source model. Apache Camel is a free standalone program supported solely by its community of developers. Mule ESB is the runtime engine of MuleSoft's Anypoint Platform, a licensed and professionally-supported product.


1 Answers

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.
like image 55
Enrique Avatar answered Sep 21 '22 00:09

Enrique