Using Mule Agents
An agent is a service that is associated with or used by Mule ESB but is not a Mule-managed component. Agents have the same lifecycle as the Mule instance they are registered with, so you can initialize and destroy resources when the Mule instance starts or is disposed.
Mule provides several agents for JMX support, including notifications and remote management. You can also create custom agents to plug any functionality into Mule, such as running functionality as a background process or embedding a server in Mule.
Configuring an Agent
Agents are defined in the Management module. To use an agent, specify the
management namespace and schema, and then specify the properties for the agents you want to use. For example:
For a list of agents provided with Mule and how to configure them, see JMX Management. You can also create a custom agent as described below.
Creating Custom Agents
To create your own agent, your agent class must implement
You then configure your agent using the
<custom-agent> element, which takes two attributes:
name specifies a unique name for this agent, and
class specifies the class where it's defined. If your agent requires that you pass in properties, you can specify them as name/value pairs. Note that this element is now in the core Mule namespace.