CloudHub Connector

Anypoint Connector for CloudHub (CloudHub Connector) enables you to create custom notifications inside your flows and exception strategies, as well as manage actions and alerts in your CloudHub instance. Here we show you how to set up custom notifications.

Review the technical reference linked at top to learn how to manage applications and tenancies through the CloudHub connector.


Install from Anypoint Exchange

To deploy, start, stop, and update applications as well as send notifications from your application to CloudHub, get the CloudHub connector from Anypoint Exchange.

Install from Studio

To access the CloudHub connector from Anypoint Studio, click Help > Install New Software. In Work with, click Anypoint Connectors Update Site.

In the Community category, click CloudHub Connector. If this option is not listed, click Help > Installation Details and see if the connector was previously installed.

Click Next > then Next again > I accept the terms of the license agreement > Finish, and restart Studio.

CloudHubConnector Installation

Demo Configuration

Add and configure the CloudHub connector according to the basic setup in Deploying to CloudHub.

  1. In Anypoint Studio, find the CloudHub connector on the right menu and then drag and drop it next to the Set Payload transformer:

  2. Open the configuration for the CloudHub connector. Create a new Connector Configuration for the connector by clicking the plus sign "+":

    cloudhub connector props blank
  3. For this demo, select Basic Authentication configuration, which must be configured with the corresponding Username and Password.

    Inherited Token Authentication is a new configuration option that works only when your CloudHub connector’s application is run inside a CloudHub instance. With this approach the connector retrieves the API Token from the CloudHub instance where the app is deployed.
  4. Enter your credentials into the configuration fields and click OK:

    cloudhub basic auth config
  5. Make sure that you have selected the Create notification operation and set the properties for:

    1. Domain: This should be the domain you set for your application when you first created it.

    2. Message: The message you want your notification to show (e.g. "Your application has been hit"). In the example below, the notification will simply display a "Hello World!" message.

    3. Priority: The type of the notification. By selecting "INFO", your notification will display an informative message while selecting "ERROR" will display a red alert message.

    cloudhub connector settings
  6. Additional information can be included with the notification by configuring the "Custom Properties" section.

    The expected "Custom Properties" format is Map <String, String> and is typically referenced using a bean or a variable where you have defined that map, for example, #[flowVars.magicMap], or by defining a map using MEL #[['key1':'value1']]
  7. At this point, your application is set to be deployed and run. When your domain root is visited, the Create notification operation in the CloudHub connector creates a "Hello World!" notification message for the domain that the application is currently running on.

If you always want to create notifications on CloudHub, even when running locally, you can use the Create notification operation. This requires you to configure the connector with your username and password.
The "Retrieve Logs" operation is no longer supported - to download logs use CH API or Anypoint CLI.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub
Submit your feedback!
Share your thoughts to help us build the best documentation experience for you!
Take our latest survey!