8
Developing CloudHub Application

Mule developing a cloud hub application

Embed Size (px)

Citation preview

Page 1: Mule developing a cloud hub application

Developing CloudHub Application

Page 2: Mule developing a cloud hub application

2

Developing a CloudHub Application

The best way to learn how to develop a CloudHub application is to read the

Getting Started with CloudHub guide, which includes walkthroughs of basic

concepts and examples to help get you familiar with the process of

developing and deploying your applications in CloudHub.

Page 3: Mule developing a cloud hub application

3

Specifying a Host

Define the Host address in a 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 these workers for you. As your application scales, work loads automatically distribute between your workers.

Page 4: Mule developing a cloud hub application

4

Providing an External HTTP or 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 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 routes to this port.

CloudHub only supports incoming traffic on port 80 of your application domain URL. 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://0.0.0.0:${http.port}/service/path/onehttp://0.0.0.0:${http.port}/service/path/two

Page 5: Mule developing a cloud hub application

5

Running Your Application Locally

If you want to run a CloudHub application locally, create an application properties file named mule-app.properties in the src/main/app folder of your project. You need to do this whether you work in Anypoint Studio or another IDE. This 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 CloudHub Console or the Command Line Tools.

Page 6: Mule developing a cloud hub application

6

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

Page 7: Mule developing a cloud hub application

7

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

Page 8: Mule developing a cloud hub application