Skip to content

Latest commit

 

History

History
70 lines (49 loc) · 4.21 KB

cloudhub-connector.adoc

File metadata and controls

70 lines (49 loc) · 4.21 KB

CloudHub Connector

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.

MuleSoft maintains this connector under the Select support policy.

Installing

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 and 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.

Demo Configuration

Add and configure the CloudHub connector according to the basic setup in our Deploy 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: 

    CHBasicFlow

  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.

    Important
    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 following the Deploy to CloudHub tutorial.

    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.

    Note
    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.

Important
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.