Mule Studio Essentials

7 篇文章 0 订阅

Mule Studio is an Eclipse-based, integration development environment. It offers two development environments you can use to create Mule applications:

  1. a visual, drag-and-drop editor
  2. 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?


A. Model

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.

B. Configure

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.

C. Debug

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.

D. Deploy

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:

  1. Package Explorer
  2. Canvas
  3. Outline
  4. Console

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. TheJavaDoc 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:

Building Blocks

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:

Type

Function

Examples

Message Processors

filter, alter, route, or validate messages

Payload Filter, Choice Flow Control, Email to String Transformer

Message Sources

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

Component

pre-packaged or custom-coded, integrate specific functionality (The custom code can be developed as a Java class, a Spring bean, or as a Ruby, JavaScript, Groovy, or Python script.)

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.

Flows

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

For more information on the types of flows and variations in behavior, see Mule Application Architecture.

Applications

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

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
  1. Double click to select an attribute of an element, such as the host attribute of the HTTP endpoint element.
  2. Press Ctrl+space bar to open a list of suggested attributes you can configure for the element (see below).
  3. Use the up and down scroll arrows to browse through the suggestions.
  4. When you have highlighted the attribute you wish to use, press enter to insert it into the XML configuration. 

Suggest Elements
  1. Enter an element's left bracket ( < ), then press Ctrl+space bar.
  2. Recognizing that you are entering a new element, Studio lists all possible element for that particular situation.
  3. Use the up and down scroll arrows to browse through the suggestions.
  4. When you have highlighted the element you wish to use, press enter to insert it into the XML configuration.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值