Expose an attribute or method of a custom application module through JMX/JConsole with the Wowza Streaming Engine Java API

By default, all custom Wowza Streaming Engine™ media server software modules are exposed in JMX/JConsole at runtime. You can easily add attributes or operations to your custom module that are available through JMX/JConsole at runtime. To make an attribute available, be sure you add public getter and setter methods to access your attribute. All public methods will be made available through JMX as long as they use simple Java types (string, int, long, Boolean, short, etc.).

For example, if you have a module MyModule and you want to expose the attribute connectionLimit and the method logSomething, the code will look something like this:

package com.wowza.wms.plugin.test.module;

import com.wowza.wms.module.*;

public class MyModule extends ModuleBase
{
	private int connectionLimit  = 100;

	public void onAppStart(IApplicationInstance appInstance)
	{
		getLogger().info("onAppStart " );
	}

	public void onAppStop(IApplicationInstance appInstance)
	{
		getLogger().info("onAppStop " );
	}

	public int testGetConnectionLimit()
	{
		return this.connectionLimit;
	}

	public void testSetConnectionLimit(int connectionLimit)
	{
		this.connectionLimit = connectionLimit;
	}

	public void logSomething(String logStr)
	{
		getLogger().info("logSomething: "+logStr);
	}
}

Your module will be located in the MBeans tab of JConsole in the following path:

WowzaMediaServerPro:VHosts,_defaultVHost_,Applications,[application],ApplicationInstances,_definst_,Modules,MyModul,Instance

The attributes will be available in the Attributes section and the methods in the Operations section.