Custom Application Alerts using CloudHub Connector

Lets understand how to create custom application alerts and send notifications using CloudHub connector…..


The CloudHub Connector provides the ability to interact with CloudHub within Mule application. Using the CloudHub connector, we can send the custom notification from your mule application to CloudHub. It is used for other operations as well such as starting, stopping, deploying, and updating Mule applications the Mule application to CloudHub.


Add a CloudHub connector in Anypoint studio

  • First of all, you have to go on your ‘Mule Palette’  and then you have to write CloudHub in Search box. If CloudHub connector is installed, it will be visible in mule Palette. Else will select ‘Search in Exchange’  where you can add the dependencies by searching them in Exchange.
  • Search for the CloudHub connector
  • Select, add and click on Finish. The connector will be added successfully in the Mule Palette.

Get Environment ID

Steps to Trigger Custom Notification

There are 2 steps to send the custom notifications.

Step 1) Trigger Custom notification from Mule Application to CloudHub.

Step 2) Trigger Alerts to send the CloudHub Notification.

Step 1) Trigger Custom Notification from Mule Application to CloudHub

  1. Create a new project as “custom-notification”.
  2. Add a Listener.
  3. Search the CloudHub connector in Mule Palette.
  4. Select the Create Notification and drag in the component in flow.
  5. Click on adding Connector configuration
  6. Update the Connector Configuration
  7. Update the Domain (Application Name), Alert Message, custom Properties, Alert Notification Priority and Transaction ID.
  8. Run the Application and trigger the Alert Notification for the same.
  9. Click on the notification Icon in CloudHub Runtime and You can see the Alert in CloudHub Notifications as below :

Step 2) Trigger Email notification for CloudHub Notification Click on the Alert Button in CloudHub Dashboard

  1. Click on the Alert Button in CloudHub Dashboard
  2. Click ok “create an Alert” option as below :

  3. Update the Required information for Creating the Alert notification.
  4. Update the Alert name (Ex: Trigger Custom Notification), Severity Level (Critical, Warning or Info, Based on Requirement), Application Type as CloudHub, Application Name (which will trigger the Alert Notification, Ex. Custom-Notification)
  5. Update the Alert Condition
    • Select the priority from the Priority menu or leave the priority as Any to send notifications regardless of priority.
    • In Contains, enter the string to use to trigger a notification. This string must match a string in the Message field that you configured in CloudHub Connector.

      Note : There are multiple pre-defined Conditions we can create Alert Based on requirement but in this case, we created Custom Alert Notification as “Custom Application notification” (Alert name will be same as the Application Name)
  6. Update the Email Subject and Email Message Body to include in the notification email.
  7. Update the Email Recipients for notification recipients.
  8. Once Notification Alert Trigger, we will receive the email on Recipients Email Address.

You can use variables in the alert Subject and Message fields. For information about using variables in alerts, see Alert Variables.

When you trigger the alert, the specified recipients receive an email with the custom message you added to the app.

Note : CloudHub stores up to a maximum of 1000 notifications per application. If the number of notifications exceeds the maximum, CloudHub deletes the oldest notification. Each notification can contain up to 10,000 characters.


In this Blog, we learned how to create custom Alert notification in Mule4 using CloudHub Connector.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post