DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • MuleSoft Integration With RabbitMQ
  • How to Use Mulesoft VM Connector
  • Idempotency Under Concurrency: Why Your Application Check Isn't the Last Line of Defense
  • Running a Self-Hosted WAF in Production: Practical Lessons From SafeLine

Trending

  • 5 Proven Strategies for Modernizing Legacy .NET Applications
  • Why Your Test Automation Is Always Behind the Code And the Architecture That Fixes It
  • Agentic Test Creation: From Plain-Language Requirements to End-to-End Test Cases
  • Git Branching Strategies for Maintainable Test Automation

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

Mule CloudHub Connector: Part 1

Need help connecting to CloudHub APIs? Use this tutorial to guide you through the steps of how to use CloudHub Connector in Mule Application.

By 
Karan Gupta
·
Jan. 10, 22 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
5.7K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

What are CloudHub Connectors?

This helps you connect to CloudHub APIs through Mule applications. In total, there are 5 features provided by this connector as listed below:

  • Get Application
  • List Applications
  • Create Notification
  • List Notifications
  • Mark Notification

In this article, we are going to look at the first 2 features using a simple demo.

Get Application

Create a Mule Project. Once completed, add the CloudHub connector module from the exchange as shown below.Add CloudHub connector module

You can now see the list of features available for use.List of features available

Now create a simple Mule Flow by dragging an HTTP Listener and CloudHub Get Application Connector as shown.Create MuleFlow

Configure the HTTP Listener and CloudHub connection configuration as below.

HTTP Listener Connector Config:HTTP Listener configHTTP Listener 2

CloudHub Connector Config: 

Select the appropriate environment from which you want to get the application details. In the Domain section, select the Application Name.CloudHub Connector Config 1CloudHub Connector Config 2

Once the above configuration is completed, run the application, and you will get the app information as the Output.

  • Endpoint: http://localhost:8081/getApp
  • Output: 
 
{
    "versionId": "61d69713c792727d25726477",
    "domain": "helloappdemo",
    "fullDomain": "helloappdemo.us-e2.cloudhub.io",
    "properties": {},
    "propertiesOptions": {},
    "status": "STARTED",
    "workers": {
        "type": {
            "name": "Micro",
            "weight": 0.1,
            "cpu": "0.1 vCores",
            "memory": "500 MB memory"
        },
        "amount": 1,
        "remainingOrgWorkers": 1.0,
        "totalOrgWorkers": 1.0
    },
    "workerStatuses": [
        {
            "id": "i-05b4a69e302383205",
            "host": "18.118.132.173",
            "port": 0,
            "status": "STARTED",
            "deployedRegion": "us-east-2",
            "staticIPEnabled": false
        }
    ],
    "lastUpdateTime": 1641453436509,
    "fileName": "helloapp-1.0.0-SNAPSHOT-mule-application.jar",
    "muleVersion": {
        "version": "4.4.0",
        "updateId": "61d3db0536b6517e4ffcf614",
        "latestUpdateId": "61d3db0536b6517e4ffcf614",
        "endOfSupportDate": 1662595200000
    },
    "region": "us-east-2",
    "persistentQueues": false,
    "persistentQueuesEncryptionEnabled": false,
    "persistentQueuesEncrypted": false,
    "monitoringEnabled": true,
    "monitoringAutoRestart": true,
    "staticIPsEnabled": false,
    "hasFile": true,
    "secureDataGatewayEnabled": false,
    "loggingNgEnabled": true,
    "loggingCustomLog4JEnabled": false,
    "cloudObjectStoreRegion": "us-east-2",
    "insightsReplayDataRegion": "us-east-2",
    "isDeploymentWaiting": false,
    "deploymentGroup": {
        "id": "5ac685b0de9e5022ac802745",
        "name": "US East (Ohio)"
    },
    "updateRuntimeConfig": false,
    "trackingSettings": {
        "trackingLevel": "DISABLED"
    },
    "logLevels": [],
    "ipAddresses": []
}

List Applications

We need to again follow the same steps as listed above to configure the Connector Configurations. Below are the snapshots for the same. This will list down all the applications in the given environment.Connector Configurations SnapshotDisplay Name: ListenerDisplay Name: List Applications

Once the above configuration is completed run the application. Below is the sample output you can see.

  • Endpoint: http://localhost:8081/listApp
  • Output:
 
[
    {
        "versionId": "61d69713c792727d25726477",
        "domain": "helloappdemo",
        "fullDomain": "helloappdemo.us-e2.cloudhub.io",
        "properties": {},
        "propertiesOptions": {},
        "status": "STARTED",
        "workers": {
            "type": {
                "name": "Micro",
                "weight": 0.1,
                "cpu": "0.1 vCores",
                "memory": "500 MB memory"
            },
            "amount": 1,
            "remainingOrgWorkers": 1.0,
            "totalOrgWorkers": 1.0
        },
        "lastUpdateTime": 1641453436509,
        "fileName": "helloapp-1.0.0-SNAPSHOT-mule-application.jar",
        "muleVersion": {
            "version": "4.4.0",
            "updateId": "61d3db0536b6517e4ffcf614",
            "latestUpdateId": "61d3db0536b6517e4ffcf614",
            "endOfSupportDate": 1662595200000
        },
        "region": "us-east-2",
        "persistentQueues": false,
        "persistentQueuesEncryptionEnabled": false,
        "persistentQueuesEncrypted": false,
        "monitoringEnabled": true,
        "monitoringAutoRestart": true,
        "staticIPsEnabled": false,
        "hasFile": true,
        "secureDataGatewayEnabled": false,
        "loggingNgEnabled": true,
        "loggingCustomLog4JEnabled": false,
        "cloudObjectStoreRegion": "us-east-2",
        "insightsReplayDataRegion": "us-east-2",
        "isDeploymentWaiting": false,
        "deploymentGroup": {
            "id": "5ac685b0de9e5022ac802745",
            "name": "US East (Ohio)"
        },
        "updateRuntimeConfig": false,
        "trackingSettings": {
            "trackingLevel": "DISABLED"
        },
        "logLevels": [],
        "ipAddresses": []
    }
]


Connector (mathematics) application

Opinions expressed by DZone contributors are their own.

Related

  • MuleSoft Integration With RabbitMQ
  • How to Use Mulesoft VM Connector
  • Idempotency Under Concurrency: Why Your Application Check Isn't the Last Line of Defense
  • Running a Self-Hosted WAF in Production: Practical Lessons From SafeLine

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook