2
votes

We often have Custom Mediators (Java classes) that are performing transformations or other things. Each time we want to change only one little thing inside the class, we need to restart the whole WSO2 ESB.

May the "custom mediator" approach is wrong, but we'd like to keep the java classes, but de-coupled from the whole server - like proxies or endpoints. (Our classes are inside a .jar in /components/lib)

How can a custom mediator or java class added to the WSO2 ESB without restarting?

<class name="my.domain.MyJavaClassThatMustBeUpdatedWithoutRestart"/>
2

2 Answers

0
votes

You can create an osgi bundle from your class and then you can control the classes behavior from the OSGI Console. You need to start esb with -DosgiConsole option. You can find more information from this blog post.

http://lalajisureshika.blogspot.co.uk/2013/03/some-useful-osgi-commands-to-find.html

0
votes

While starting up we make OSGI bundles out of the non-OSGI jars in components/libs. So you must restart if you want to change the custom mediator jars.

As per the below coment explaining the answer,

WSO2 Products are running on an OSGI based platform. So if you change an OSGI bundle you can restart the bundle from the OSGI Console without restarting the whole server. Also the OSGI Container used by WSO2 is Eclipse Equinox OSGI Container. It provides the ability to add non-OSGI jars to product with the feature of, converting those jars in to OSGI Bundles. And that feature works only at the server startup. So if you want to add/change those jars you should restart the server. In runtime you can change OSGI bundles, but you can not convert non-OSGI bundeles to OSGI in runtime.