Mule Studio Essentials
Mule Studio is an Eclipse-based, integration development environment. It offers two development environments you can use to create Mule applications:
- a visual, drag-and-drop editor
- an XML editor
Whatever you develop or configure in one editor is reflected in the other. Same tool, different editor.
What is the relationship between Mule ESB and Mule Studio?
Mule ESB is the core Enterprise Service Bus application. You can install and use Mule ESB without Mule Studio (a.k.a. Mule ESB standalone, or Mule ESB runtime) and interact with it — building and running integration applications and Web services — via an independent external integration development environment (IDE), like IntelliJ, Eclipse, or JDeveloper.
Mule Studio is the graphical user interface you can use to access Mule ESB's functionality. Rather than writing XML code in an IDE to create Mule applications, you can use Studio, Everyman's visual integration development environment. Use Studio (a.k.a. Mule ESB Designtime) to drag and drop elements into place to quickly model, configure, then deploy applications on-premise or in the cloud.
How Do I Use Studio?
The visual editor enables a developer to arrange building blocks on a composition canvas to create Mule flows, which form the basis of a Mule applications. Simply drag-and-drop building blocks on the canvas to create a sequence of events that facilitate the processing of Mule messages.
The visual editor provides dialog boxes to configure building blocks. The dialogs accept plain English entries, rather than formatted XML, so developers don't have to bother with XML syntax when configuring each building block.
Developers already comfortable with XML may prefer to use the XML editor to set configuration details by writing XML statements directly into the XML configuration file. Studio makes XML coding easier by providing syntax guidance (suggestions for auto-completion) and providing drop-down menus that list the available options for XML attributes.
Studio includes a debugger to run a Mule application and watch the source code and examine the variables during execution. Set break points in an application, then let Mule get to work.
Deploy a new Studio application locally to test it, or externally to put it to work in a production environment. A developer can also deploy a Studio application to the application repository in the Mule Management Console or deploy to CloudHub.
How Do I Use the Visual Editor?
Studio's visual editor is divided into four quadrants:
- Package Explorer
The Package Explorer displays project folders and files in a tree format. Click to expand or contract Mule project folders and examine the files that make up a Mule project.
The Canvas provides a space that facilitates arrangement of Studio components into Mule flows. The Palette, on the right-hand edge of the canvas, displays a list of Mule building blocks that you can click and drag onto the canvas to build your application. At the base of the canvas, Studio offers three tabs which offer different ways to interface with your application:
- Message Flow: the drag-and-drop interface that facilitates arrangement of Studio components into Mule flows
- Global Elements: the interface for creating or editing reusable configurations for Mule building blocks
- Configuration XML: the XML editor interface displays the XML statements that correspond to the building blocks arranged on the Message flow canvas
The Outline displays a miniaturized overview of the whole canvas, along with a box cursor that scrolls with the display in the canvas pane. This provides a high-level, bird's eye view of your complete Mule application as it extends beyond the borders of the canvas.
The Console displays a list of events and problems (if any) that Studio reports as you create or run your Mule application. The JavaDoc and Declarations tabs display additional categories of information related to your code.
What Do I Build with Studio?
Use Mule Studio to arrange building blocks on the canvas to create flows which, together, form an application to process messages.
Confused? Let's break it down:
A building block is a pre-packaged unit of business logic that comes bundled with Mule. As the name implies, it is a block (a block of code, really) that you can arrange with other blocks to form a structure. In this case, you are arranging building blocks to form a Mule flow.
Building blocks fall into one of three categories depending on their function within a Mule flow:
filter, alter, route, or validate messages
Payload Filter, Choice Flow Control, Email to String Transformer
also known as Inbound Endpoints, accept messages into flows and trigger message processing (Technically, message sources, which receive messages, rather than process them, do not qualify as message processors.)
HTTP endpoint, Ajax endpoint
Logger, Echo, Java
To arrange building blocks to form a flow, simply drag and drop them from the palette onto the canvas.
After you have arranged building blocks into a flow, you must configure each building block individually. Double click the building block to open its Properties pane, then supply the values for the configuration fields (see image below). Studio saves all of your configurations in the XML file for your application. To see the XML version of your flow, click the Configuration XML tab below the canvas.
A flow resides at the heart of every Mule application, orchestrating message processing and, at times, triggering other flows. Typically, a message source receives a message, which triggers the main message processing flow. Each building block in the flow evaluates or processes the message until the message has passed through all the building blocks in the flow. Refer to the image above to see an example of a simple flow labelled
For more information on the types of flows and variations in behavior, see Mule Application Architecture.
Applications are collections of flows that work together to process a message. Simple applications consist of a single flow of message processors, but complex applications can contain several flows. Within the context of Mule Studio, the terms “application” and “project” are used interchangeably.
Messages are the functional data units, or packets, that Mule applications process. For example, each customer order submitted to a Mule purchase fulfillment application qualifies as a message. Each message contains a header and a payload, the latter of which may contain XML, JSON, files, streams, maps, Java objects, or any other type of data.
XML Editor Tips and Tricks
Because Mule Studio leverages the Eclipse IDE, the Configuration XML editor incorporates many Eclipse features provided. The following is a list of handy tips and tricks for using Mule Studio's XML editor.
Show Attribute Options
- Double click to select an attribute of an element, such as the
hostattribute of the
- Press Ctrl+space bar to open a list of suggested attributes you can configure for the element (see below).
- Use the up and down scroll arrows to browse through the suggestions.
- When you have highlighted the attribute you wish to use, press enter to insert it into the XML configuration.
- Enter an element's left bracket ( < ), then press Ctrl+space bar.
- Recognizing that you are entering a new element, Studio lists all possible element for that particular situation.
- Use the up and down scroll arrows to browse through the suggestions.
- When you have highlighted the element you wish to use, press enter to insert it into the XML configuration.