---
schema_version: "1"
id: 17983e4eddb13732270e76f76dd81048d3f07e726d0fea8a8b19765cc06edb9f
title: Develop Applications for CloudHub
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/cloudhub/developing-applications-for-cloudhub.md
canonical_url: https://docs.mulesoft.com/cloudhub/developing-applications-for-cloudhub
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 824f9831841b7086e7f697324e5e1f3e06df84b28e25a8ea50fb014fd846dc60
description: MuleSoft Documentation Site
latest: true
---
---
product: CloudHub
---

# Develop Applications for CloudHub

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

When developing applications for deployment to CloudHub, review the following considerations.

## Specify an HTTP/HTTPS Host

If you use Anypoint Connector for HTTP (HTTP Connector), define the host address in the CloudHub
configuration as `0.0.0.0`. CloudHub routes requests from your application domain URL to the
endpoint. If you deploy multiple workers, CloudHub load-balances incoming traffic automatically
across the 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:

```console
http://0.0.0.0:${http.port}/service/path/one
http://0.0.0.0:${http.port}/service/path/two
```

## Deployment Option Flexibility

To deploy the same Mule application to different deployment targets, such as an on-premises server
and CloudHub, see [Deploy Mule Applications](https://docs.mulesoft.com/mule-runtime/latest/deploying).

For the key differences between deployment environments, see
[Deployment Options](https://docs.mulesoft.com/runtime-manager/deployment-strategies).

You can define properties and variables for each deployment outside of the application and then
reference them from your application. For example, you can define a local value for the variable
`http.port` or `https.port`. For information, see
[Configuring Properties](https://docs.mulesoft.com/mule-runtime/latest/configuring-properties).

You can also set these property variables using Runtime Manager or the Anypoint Platform
command-line interface.

### Avoid HTTP Proxy Settings

In the CloudHub environment, Mule applications access a target HTTP server directly on the internet.
In local development environments, the internet is accessible only via an HTTP proxy server.

You can avoid adding proxy settings in the HTTP request configuration in a Mule application by using
JVM system properties so that when you deploy the application to CloudHub, you don’t need to change
the code.

To do this:

1.  For Mule 4 applications, enter timeout settings on the HTTP request configuration, for example:

    - **HTTP Request configuration** > **General** > **Connection idle timeout:** 30000

    - **HTTP Request configuration** > **Settings** > **Response timeout:** 30000

      Adjust the timeout values to any number greater than 0. A blank or 0 timeout value can cause a
      connection failure.

2.  Add the following to the local Mule runtime command line. In Anypoint Studio, change the **Run
    Configurations** and add the following parameters as one line:

```console
-Dhttp.nonProxyHosts="localhost"\-Dhttps.proxyHost={proxy server ip}\-Dhttps.proxyPort={proxy server port}\-Dhttp.proxyHost={proxy server ip}\-Dhttp.proxyPort={proxy server port}\-Djava.net.useSystemProxies=false\-Dcom.ning.http.client.AsyncHttpClientConfig.useProxySelector=false\-Dcom.ning.http.client.AsyncHttpClientConfig.useProxyProperties=true
```

> [!NOTE] Replace `{proxy server ip}` and `{proxy server port}` with the actual HTTP proxy server IP
> address and port number.

## Configure Logging

The CloudHub logging service captures all log messages from your application. You can view logs in
the **Logging** tab in the Runtime Manager console. To expose additional information in your logs
for diagnostic or audit purposes, use the
[Logger component](https://docs.mulesoft.com/mule-runtime/latest/logger-component-reference).

> [!IMPORTANT] 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 it is
> purged, so you can recover the data if needed. For more information, open a support case at
> [Salesforce Help](https://help.salesforce.com).

## Package Third-Party Libraries

CloudHub provides services in Anypoint Platform that support connecting over different protocols and
transforming many data formats. All the standard Mule libraries are included and available to your
application. If you need to include another third-party library, you can package that library in the
application JAR file. For information, see
[Introduction to Mule 4: Packaging Applications](https://docs.mulesoft.com/mule-runtime/latest/mule-app-dev).

## Access Resources Behind the Firewall

When developing an application that needs to access resources from inside your firewall, you can
configure 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

MuleSoft provides connectors for many third-party applications, such as Salesforce, NetSuite, and
Twitter. For information about how to find and use connectors with your application, see the
[Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors).
In addition, you can create your own connectors using Anypoint Connector DevKit.

## Understand Local Storage Limitations

CloudHub worker local storage is ephemeral. Unlike local development environments, CloudHub clears
local data when an app restarts.

This limitation affects:

Persistent object stores

Configuring `persistent="true"` writes data to local disk. This works in Anypoint Studio and
standalone Mule runtimes, but data doesn’t persist across CloudHub restarts. Use
[Object Store v2](https://docs.mulesoft.com/object-store/) for persistent storage.

Local file operations

The File connector and other file-based operations write to the worker’s local disk. CloudHub
deletes these files when the app restarts.

Temporary files and caches

App-generated files, custom logs, and local cache data don’t persist.

To ensure data persistence in CloudHub:

- Use [Object Store v2](https://docs.mulesoft.com/object-store/) instead of persistent object stores for app state and
  synchronization data.

- Store files in external cloud storage services.

- Design stateless integrations by persisting data in external databases or messaging queues.

For more information about designing resilient applications, see
[CloudHub High Availability and Disaster Recovery](https://docs.mulesoft.com/cloudhub/cloudhub-hadr).

## Use Secure Properties

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. For information, see
[Secure Application Properties](https://docs.mulesoft.com/cloudhub/secure-application-properties).

## See Also

- [HTTP Connectors](https://docs.mulesoft.com/http-connector/1.10/)

- [Deployment Options](https://docs.mulesoft.com/runtime-manager/deployment-strategies)

- [Deploy to CloudHub](https://docs.mulesoft.com/cloudhub/deploying-to-cloudhub)

- [Anypoint Studio](https://docs.mulesoft.com/studio/)

- [Manage Deployed Applications](https://docs.mulesoft.com/runtime-manager/managing-deployed-applications)

- [Anypoint Platform Command-Line Interface](https://docs.mulesoft.com/anypoint-cli/latest/)

- [View Log Data](https://docs.mulesoft.com/cloudhub/viewing-log-data)

- [Virtual Private Cloud](https://docs.mulesoft.com/cloudhub/virtual-private-cloud)

- [Secure Application Properties](https://docs.mulesoft.com/cloudhub/secure-application-properties)
