Contact Free trial Login

Develop Applications for CloudHub

logo cloud active logo hybrid disabled logo server disabled logo rtf disabled

Mule applications that are meant for deploying to CloudHub may sometimes require that you do things a little differently than for applications that are meant to be deployed to an on-premise server. For the most part, the same Flow Elements and Global Elements apply in the same way, but there are some specificities that you must consider. Deployment Options covers the key differences between both deployment environments, this document lists a few best practices to employ when deploying to CloudHub.

The CloudHub guide includes basic concepts and deployment examples.

Specify an HTTP/HTTPS Host

If you employ any HTTP Connectors, define the Host address in a CloudHub configuration as CloudHub routes requests from your application domain URL to the endpoint. If you deploy multiple workers, CloudHub load-balances incoming traffic automatically across these workers for you. As your application scales, work loads automatically distribute between your workers.

Provide an External HTTP/HTTPS Port

If your application requires an externally accessible HTTP or HTTPS port to receive messages, trigger events, or expose a web service or user interface, declare the HTTP Listener port using the reserved property ${http.port} or ${https.port}. On CloudHub, port ${http.port} or ${https.port} is assigned automatically by the platform services. Traffic on port 80 to your application domain’s URL is routed to ${http.port} and traffic on port 443 is route to ${https.port}.

To support routing to multiple CloudHub services over this port, you need to configure each with unique paths on the URL that is exposed. For example:${http.port}/service/path/one${http.port}/service/path/two

Deployment Option Flexibility

If you want to deploy a same Mule application via various different deployment options – such as to an on-prem server and on CloudHub – you should abstract some parameters of the application to application properties that you can set with different values in each case.

Create an application properties file named in the src/main/app folder of your project. You need to do this whether you work in Anypoint Studio (Studio) or another IDE and want to deploy to Studio’s built-in server. Creating a properties file allows you to define a local value for the variable http.port or https.port.

If you have other runtime settings that you want to configure differently when running locally, you may also place them in the application properties file and refer to them using the syntax ${propertyname} in your Mule application configuration. Each application can declare a set of environment variables when it is deploys to provide a different value when deploying on CloudHub. You can define these environment variables using the Runtime Manager Console or the Anypoint Platform Command-Line Interface.


All log messages from your application are captured by the CloudHub logging service and available through the log search tool in the Runtime Manager console. If you wish to expose additional information in your logs for diagnostic or audit purposes, Mule provides a logger element for fine grained logging of message content.

On CloudHub, after you delete an application, your log data is no longer accessible through the console. CloudHub archives old log data for a limited period of time before being purged. This allows you to recover the data if needed. Open a support case at: MuleSoft Help Center for more information.

Package Third-Party Libraries

CloudHub provides services in the platform that support connecting over many different protocols and transforming many data formats. All the standard Mule libraries are included and available to your application. If you have the need to include a different third party library, you can package that library in the <mule application zip>/lib folder of your application package. Any libraries that are packaged in your Mule application lib folder are available on the classpath to your application at run time.

Access Resources Behind the Firewall

When developing an application that needs to access resources from inside your firewall, you can configure a Anypoint Virtual Private Cloud (Anypoint VPC) to host your CloudHub workers and configure an IPSec tunnel to access your applications.

Access Third-Party APIs and Services

CloudHub includes connectors for many third party applications, such as Salesforce, NetSuite, Twitter, and others. Anypoint Studio includes a few of the most common ones out of the box for developing with CloudHub, and the Anypoint Connector DevKit documentation provides more detail on how to find and deploy these connectors with your application.

Secure Properties

Note that you can flag application properties as secure so that their values are not visible to users at runtime or passed between the server and the console. See Secure Application Properties for more information.

Add a UI for Your Application

Applications deployed to CloudHub can have a web UI using HTML and JavaScript. The AJAX Module provides support for interacting with your application from the browser and provides support for serving up static content.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub