Contact Us 1-800-596-4880

Runtime Manager Agent Notifications

The Anypoint Runtime Manager agent publishes notifications, in JSON format, about events that occur in the Mule instance. This enables you to implement a system for receiving and handling notifications. Notifications are sent over both the REST and WebSocket transports. For more information about transports, see Runtime Manager Agent Architecture.

Configure the Agent Notifications Callback URL

To forward Runtime Manager agent notifications to a URL over the REST transport, configure a callback URL in the mule-agent.yml file.

To configure the callback URL:

  1. Add the callback URL to the mule-agent.yml file:

    transports:
      rest.agent.transport:
        enabled: true
        callback:
          url: http://localhost:8080/
        port: 8888

    The values for port and url depend on the external server that will receive the notifications.

    The configured URL must end with a trailing slash (/) because the agent appends the path to the URL.

  2. Restart Mule runtime engine.

Application Deployment Notifications

The Runtime Manager agent sends a notification every time there is a change in state during an application deployment or undeployment. Notifications are sent via a PUT request to the applications/<appname>/deployment path:

PUT <callback URL>/applications/<application name>/deployment HTTP/1.1

Example Notification

{
  "application": {
    "name": "applicationName",
    "domain": "domainName",
    "state": "STARTED"
  },
  "status": "DEPLOYED",
  "message": "Application successfully deployed."
}

Notification Fields

Fields in each application deployment notification:

Field Description

application

Contains the following itemized information about the application:

  • Application name

  • Name of the domain to which the application is deployed

  • Current state of the application

For a list of all possible application states, see the Application States and Deployment Status section.

status

Current status of the deployment. After a deployment operation is completed, the message remains as DEPLOYED; after an undeployment operation the message remains as UNDEPLOYED.

For a list of all possible status messages, see the Application States and Deployment Status section.

message

An informational message about the current deployment stage. In case of a deployment failure, information about the reason for the failure is included in the message.

Domain Deployment Notifications

The Runtime Manager agent sends a notification every time there is a change in state during a domain deployment or undeployment.

Notifications are sent via a PUT request to the domains/<domainname>/deployment path:

PUT <callback URL>/domains/<domain name>/deployment HTTP/1.1

Example Notification

"domain": {
    "name": "domainName",
    "applications": [
      {
        "name": "application1",
        "domain": "domainName",
        "state": "STARTED"
      },
      {
        "name": "application2",
        "domain": "domainName",
        "state": "STOPPED"
      },
    ]
  },
  "status": "DEPLOYED",
  "message": "Domain successfully deployed."
}

Notification Fields

Fields in each domain deployment notification:

Field Description

domain

Contains the following itemized information about the domain:

  • Domain name

  • List of applications deployed to the domain, specifying:

    • Application name

    • Domain name

    • Application status

status

Current status of the deployment. After a deployment operation is completed, the message remains as DEPLOYED; after an undeployment operation the message remains as UNDEPLOYED.

For a list of all possible status messages, see the Application States and Deployment Status section.

message

An informational message about the current deployment stage. In case of a deployment failure, information about the reason for the failure is included in the message.

Keep-Alive Notifications

The Runtime Manager agent sends a periodic keep-alive notification to verify that the Mule instance is still running. The notification is sent via a POST request with an empty body to the keepAlive path:

POST <callback URL>/keepAlive HTTP/1.1

Application States and Deployment Status

Application States

Application states represent the different stages in the lifecycle of a Mule application.

For the list of application states, see Application Status States.

Deployment Status

Deployment statuses represent the different steps for successful deployment or undeployment of an application or a domain.

For the list of valid deployment statuses, see Application Deployment States.