The Mule agent is a plugin extension for a Mule runtime which exposes the Mule API. Using the Mule agent, you can monitor and control your Mule servers by calling APIs from external systems, and/or have Mule publish its own data to external systems.
2. INTRODUCTION
• The Mule agent is a plugin extension for a Mule runtime which exposes the Mule API.
Using the Mule agent, you can monitor and control your Mule servers by calling APIs
from external systems, and/or have Mule publish its own data to external systems. The
agent has many features, including:
• Controlling applications, domains and services:
• List, deploy, undeploy or redeploy domains.
• List, deploy, undeploy, get status of, start or stop applications.
• Publishing Mule metrics to external monitoring systems.
3. COMMUNICATION PROTOCOLS
• The agent supports two communication protocols: REST and WebSockets.
• The agent is installed into your $MULE_HOME/plugins directory; it is configured
via a single configuration file. For installation instructions and download links, see
Installing the Agent.
• Additionally, MuleSoft provides several open source agent modules. These are
provided as is, and receive no support from MuleSoft. To access these modules, check
the GitHub repositories:
• Agent modules (general)
• JMX publisher modules
4. EXTERNAL SYSTEM CHOICES
• You can configure a Mule agent plugin to connect a Mule runtime to a variety of
external systems. The installation script provides options to choose particular
communication methods and external systems, including controlling a Mule runtime
through a Runtime Manager.
• Communication methods include secure and insecure REST communication, and/or
WebSockets connections. Other installation options (using the -H option) allow you
to configure a Mule agent to securely connect the Mule runtime to either a cloud-
based or on-premises version of an Anypoint Runtime Manager. The link that the
Agent establishes allows the Mule runtime to be monitored and managed remotely
through an Anypoint Runtime Management Console.
5. MULE AGENT ARCHITECTURE
• The Mule agent is a Mule plugin that exposes the Mule ESB JAVA API as a service,
allowing users to manipulate and monitor Mule ESB instances from external
systems.
• Further slides will show an overview of the Mule agent architecture and its main
components.
6. MULE AGENT MAIN COMPONENTS
• Mule Service
• Connects to the Mule API. This component is not aware of the transport layer (how the messages are
going to be communicated by/to the user).
• Transport
• Handles the communication layer. Includes keep-alive status, security and protocol.
• External Message handler
• Exposes a Web Service API to users. Any incoming message (e.g. a deployment request) is handled
by an external message handler. Depending on the request, a Mule service or multiple Mule services
may be executed.
• Internal Message Handler
• Called by a Mule service every time it receives a Mule notification.
• Messaging
• The agent has three ways to communicate with Mule, outlined below.
7. MULE AGENT MAIN COMPONENTS
…CONTINUED
• Synchronous communication
• Example: Get deployed applications.
• Asynchronous Communication
• Example: Deploy and notify about the
deployment stages.
• Push Communication
• Example: Push JMX information to an
external system.
8. ARCHITECTURE DIAGRAM
• The agent’s architecture is quite simple:
• The transports handle communication
• The external message handlers dispatch messages
• The services connect to Mule API
• The internal message handlers dispatch Mule notifications
9. ARCHITECTURE DIAGRAM …CONTINUED
• The interaction of
each component
is shown in the
diagram be low
for each of the
three types of
messages
(synchronous,
asynchronous
and push):
10. HOW COMPONENTS INTERACT
• Below is an outline of a typical sequence of component interaction:
• An external system sends a request to the agent.
• An external message handler is executed, and calls a Mule service using the
interface.
• The Mule service calls Mule to perform the corresponding action.
• Mule responds with a notification.
• The service maps the notification to an agent notification, and looks for the
internal message handlers that may handle the notification type.
• The corresponding internal message handlers are executed.
11. MULE AGENT CONFIGURATION
• At startup, the Mule agent reads its configuration from the file
$MULE_HOME/conf/mule-agent.yml. You must manually add, then
edit this file with your installation’s configuration parameters. The
format is self-explanatory; a sample file is available for download.
• During installation, you also have the option to configure the Mule
agent via a quick-start script.