I just contributed the JMX support feature to Activiti. It is merged and will be available in the coming release (release 5.16.4) of Activiti.
It is specially useful for people in operation teams. It reveals performance information and enables the operator to change some parameters on the fly.
To enable the feature it is enough to add the activiti-jmx module to dependencies. Jmx Mbean server will be automatically found and configured with the default settins.
Default configuration makes the JVM instance visible in Jconsole. If it is not visible for any reason, it can be found using this url: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/activiti using jconsole. By default Mbeans are exposed in org.activiti.jmx.Mbeans path.
As of now these informations and operations are available via JMX:
- getting process definitions
- getting deployment
- suspend, activate process definitions by id and key
Default configuration can be changed by putting these parameters in config file or setting them directly via API:
- registryPort (Default is 1099)
- mbeanDomain (default is “DefaultDomain”)
- serviceUrlPath (Default is /jmxrmi/activiti)
- createConnector (default is true)
- disables (default is false)
- domain (default is org.activiti.jmx.mbeanObjectDomainName)
New Mbeans are easy to add thanks to created JMX annotation. You need only to annotate attributes with @ManagedAttribute and methods with @ManagedOperation. The only possible annotation parameter is “description”. The given description will be shown as Mbean description.
There are test cases, which bring up the jmx server and actually query and change the information via JMX. They can be used as the sample for have a taste of what a jmx client can look like.
DeploymentsJMXClientTest and JobExecutorJMXClientTest are such test cases.