Tags

, , , , ,

We need different types of nontifications when creating an integration application using Mule or any other technology. We can of course use something like email or SMTP or any other specific API, but that ties the code strongly to the implementation. A better option is to use Mule Cloudhub’s Notifications which can generate different types of alerts with lot of details and also send email if required.

There are of course 2 parts to the solution –

A) Configuration and Setup in CloudHub

Follow instructions here to setup alert in CloudHub. These instructions work well, so I won’t repeat those.

B) Configuration and coding in Anypoint Studio

      1. Add Cloudhub Connector to your application. If you do not find it, download it from exchange inside your studio.
        1
      2. In your error handler flow, add a Cloudhub Create Notification component.
        2
      3. You may need to define a Cloudhub Configuration, Use your cloudhub username, password and environment details to do this.
      4. Now in the code open the file in XML, you can do this using the visual UI as well, but I prefer this in XML.
      5. Create a subflow to handle actual notifications
        3
        You can add any number of custom properties and then refer to them when creating your notification in CloudHub
      6. Call the subflow from your error handler section
        4