Contact Us 1-800-596-4880

Deploying Studio Applications

After modeling, then configuring your Mule Studio application, only two steps remain to put your application to work: debugging, then deploying.

debug_deploy

Quick Version

  1. Under the Window menu, select Open Perspective > Other. . . *.

  2. Select Debug, then click OK. Debug your application (refer to Eclipse documentation for details).

  3. Access the main Mule perspective again, then right-click your project name, then select Run As > Mule Application.

  4. Studio runs the application on the embedded Mule test server. (Unless you stop it, Studio runs the application for a period of 12 hours.) View the application’s activities in the Studio console.

  5. To stop the application from running, click the red, terminate button at the top edge of the console.

Debugging an Application

As an Eclipse plugin, Mule Studio incorporates all Eclipse debugging features. Studio’s Debug perspective lets you control the execution of your application by setting breakpoints, suspending launched applications, stepping through your code, or examining the contents of variables.

Refer to see the Eclipse documentation for more information debugging your application.

Opening the Debug Perspective

  1. Above the Package Explorer, Studio displays icons that represent the project’s perspectives. By default, the Studio opens the Mule perspective (see below) in which you model and configure your application. Click the table icon next to the Mule perspective, then select Other. . ..

    perspective
  2. In the perspectives panel, select Debug, then click OK.

  3. Studio opens the Debug perspective, which looks similar to the Mule perspective, minus the Package Explorer, and including two new panels above the canvas (see below).

    debug_perspective
  4. To close the Debug perspective, right click its icon, the select Close.

Deploying an Application

You can deploy an application developed in Mule Studio in four ways:

  1. Deploy on the embedded test server

  2. Deploy on a Mule Enterprise server

  3. Publish to the Mule Management Console Application Repository

  4. Deploy to Cloudhub

Deploy on the embedded test server

Run your application locally, on the Mule server embedded in Studio, to test it. The embedded Mule test server bundled with the Community Edition runs for 12 hours before it must be restarted.

deploy_embedded

When you specify Run as a Mule Application, Studio automatically builds and deploys your application to the internal Mule server, which starts automatically, if necessary.

  1. In the Package Explorer, right-click your project’s name, then select Run As > Mule Application.

  2. Studio runs the application on the embedded Mule test server. (Unless you stop it, Studio runs the application for a period of 12 hours.) View the application’s activities in the Studio console.

  3. To stop the application from running, click the red, terminate button at the top edge of the console.

    terminate_button2

Deploy on an a Mule Enterprise server

Export the Studio application to a zip file, then run it on a Mule Enterprise server. This approach is ideal for Mule servers in production environments. The zip file contains all the resources (such as code libraries and application metadata) necessary to run the application, and import it into Studio again for further development.

deploy_enterprise

Deploying a Studio-built application in production on an Mule Enterprise server involves three steps:

  1. Export the application from Studio

  2. Launch the Enterprise server

  3. Deploy the application on the Enterprise server

Exporting an Application from Studio

Studio lets you save a project as a Mule Deployable Archive (i.e. zip file). Such a packaged Mule archive provides a convenient method for transferring files between editions of Studio or backing up Studio projects. The package includes all information specific to your application(s), including flows, configuration files, Java classes, referenced HTML files, and more.

  1. Right-click the project name in the Package Explorer pane, then select Export . . ..

  2. In the Export wizard, click Mule to expand the associated node, select Mule Studio Project to Mule Deployable Archive (includes Studio metadata), then click Next.

    export_archive
  3. Select an output folder to which your project archive will be saved, then click Finish.

Launching the Enterprise Server

  1. If you do not already have Mule ESB Enterprise Standalone installed on your system, download Mule ESB 3.3 Enterprise Runtime trial.

  2. Start Mule.

    Need more detail?

    +

    1. Open a new command line. PC: Open the Console. Mac: Open the Terminal application (Applications > Utilities > Terminal).

    2. Access the directory and folder in which you unpacked Mule Standalone (i.e. the application folder in Mule). For example, type cd /Users/aaron/Downloads/mule-enterprise-standalone-3.3.1/

    3. Start Mule. For example, type ./bin/mule

Deploying an Application on the Enterprise Server

  1. Navigate to the folder on your local drive into which saved your archived Studio application, then copy the zip file.

  2. Navigate to the folder that contains your copy of Mule ESB Standalone, then paste the application’s zip file into the apps folder.

  3. Mule polls the apps folder every 5 seconds; it picks up the application you copied to the apps folder, then extracts and deploys it automatically. In the command line, Mule notifies you that it has deployed the application.

    **********************************************************************
    *            - - + APPLICATION + - -            * - - + STATUS + - - *
    **********************************************************************
    * my_first_application	              * DEPLOYED           *
    * mmc                                          	* DEPLOYED           *
    * default                                       	* DEPLOYED           *
    * 00_mmc-agent                        	* DEPLOYED           *
    **********************************************************************
    
    INFO  2012-10-29 15:40:57,516 [WrapperListener_start_runner] org.mule.module.launcher.DeploymentService:
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    + Mule is up and kicking (every 5000ms)                    +
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  4. If you wish to undeploy your application but keep Mule ESB running, navigate to the app directory and delete the file your_application.txt. This removes your application from the /app directory.

  5. To stop Mule ESB from running in the command line, hit CTRL-C.

Publish to the Mule Management Console Application Repository

Publish the application to the Application Repository in the Mule Management Console. Once in the repository, the application can be deployed from the repository to multiple Mule server instances, and even to multi-node Mule clusters. (The Mule Management Console is only available in Mule ESB Enterprise Edition.)

deploy_mmc

Once in the repository, the application can be deployed from the Repository to multiple Mule server instances and even to multi-node high-availability clusters. To publish an application to the management console’s app repo, you must first download, then install and set-up Mule ESB Standalone with Mule Management Console. Access the management console’s Quick Start Guide to set up a console environment, then complete the following steps to publish your Studio application to its application repository.

  1. In Studio, right-click the project name in the Package Explorer pane, then select Mule Management Console > Publish to Application Repository . . ..

  2. In the publication wizard, input a value for each of the fields to specify the location, login credentials of your management console, and the settings for your application.

  3. Click Finish to publish the app to the repository.

  4. Follow the directions in the management console Quick Start Guide to deploy your application to the Mule server (or cluster of servers).

Deploy to CloudHub

Deploy the application to CloudHub, Mule’s platform for cloud-based integration. CloudHub represents the least painful approach for fast, worry-free cloud-to-cloud and cloud-to-premise deployment.

deploy_cloud

CloudHub is a cloud-based integration Platform as a Service (iPaaS). It provides a convenient way for developers to launch their applications on a cloud platform, while also providing many enhanced features for solving cloud-to-cloud and cloud-to-premise integration problems. Mule Studio is fully integrated with CloudHub and facilitates simple application deployment.

Deploying a Studio-built application to CloudHub involves three steps:

  1. Create an Anypoint Platform account.

  2. Adapt your Studio application to CloudHub

  3. Deploy your Studio application to CloudHub

Creating an Anypoint Platform Account

  1. If you have a Mule Community account, simply log into CloudHub using your Community credentials. If you do not have a community account, go to cloudhub.io/signup.html to create an account.

  2. Next, visit the Anypoint Platform to log in to the Runtime Manager interface.

For this example, however, we deploy our application directly from Studio, as detailed below.

Adapting an Application for CloudHub

Many projects can be deployed directly to CloudHub. However, some projects require minor modifications, as summarized below.

  • If you are deploying a project that listens on a static port, you need to change the port to a dynamic value so that CloudHub can set it at deployment time. To do so, change your port values to ${http.port}. You can create an application.properties file that allows you to run your project locally on a specific port and also on CloudHub as a dynamic port. See the example Hello World on CloudHub for details on how to create this file.

  • If using the Jetty component, set the host to 0.0.0.0 instead of localhost.

Deploying an Application to CloudHub

  1. In Studio, right-click the project name in the Package Explorer pane, then select Deploy to Anypoint PlatformCloud.

  2. In the deploymen wizard, enter your Anypoint Platform login credentials, then choose a domain in which to deploy your application. The value you enter must be a unique sub-domain which CloudHub creates for your application on the cloudhub.io domain such as, My-Project-Name. CloudHub automatically checks the availability of the sub-domain, then displays a checkmark icon to confirm that your entry is unique.

    subdomain
  3. Click Finish to deploy your application to CloudHub.

  4. On your Web browser, access your Runtime Manager console to view your newly deployed application.

    deployed_cloud