Components
Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version. |
The building blocks known as Components fall into three categories: General, Script, and Web Service.
General components execute whenever a message is received. The logic embedded into General components cannot be modified. Components such as Logging, Flow Reference, and Echo fall into this category.
Script components do not contain pre-packaged logic; instead they allow the developer to specify the logic (in the form of a custom script or a Java class) to add into the component. Script components also allow you to:
-
configure interceptors
-
add Spring beans
-
change the value or reference of a specific property within the associated class
The Java Component allows you to reference a Java class. The other Script components support the Groovy, JavaScript, Python and Ruby scripting engines.
Web Service components, as the name implies, enable Mule to use SOAP and RESTful protocols to communicate with external Web services. The SOAP and RESTful components use CXF and Jersey services to convert messages from Java to XML. Web Service components also allow the developer to select or define the logic to be invoked by component. If using the RESTful component you only need to select a Java class and add a script to the component. On the other hand, SOAP configuration requires you to define attributes and select the operation method used to publish a SOAP Web service. As an example of how the CXF component can be used, a SOAP message could be sent to a Web-service-enabled website such as a used car price database, with the parameters needed for a search. The site would then return an XML-formatted document with the resulting data, e.g., prices, model and features. The data returned is then integrated directly into a third-party website or application.
Configuring Components
To configure a component, double-click on the component to open the Properties Editor in the console. Every component in the Studio palette includes two common fields: Display name and Notes, both of which are optional and should be familiar to Studio users, because they are common to virtually all Studio building blocks.
Beyond the two common fields, most Components do not require extensive configuration. The five script components available within Studio support almost identical property pane fields.
For details, see the individual component reference pages on how to use and configure each type of component.
Components Available in Anypoint Studio
The following three tables each detail one of the Studio Component sub-groups:
General Components
General components allow you to enhance a flow by attaching functionality such as logging or displaying output.
Components | Description | Documentation | |
---|---|---|---|
Echo |
Simply passes the message to the next building block in the flow without performing any actions. |
||
Flow Reference |
This building block calls another external flow. The called flow can be one of two types: |
||
Logger |
Logs custom strings, including strings constructed from embedded expressions. Also allows specification of logging level and category. |
Script Components
Script components facilitate Software as a Service (SaaS) integration by providing language-specific "shells" to make custom-coded business logic available in a Mule application. You can write the business logic in Java, Ruby, JavaScript, Groovy, or Python.
Components | Description | Documentation | |
---|---|---|---|
Groovy |
Facilitates the integration of a custom script backed by the Groovy script engine. |
||
Java |
Allows you to select a Java class to be invoked by the application flow. |
||
JavaScript |
Allows integration of a custom script backed by the JavaScript engine. |
||
Python |
Allows integration of a custom script backed by the Python script engine. |
||
Ruby |
Allows integration of a custom script backed by the Ruby script engine. |
||
Script |
Makes a script written in Groovy, JavaScript, Python, or Ruby available to the application flow. |
Web Service Components
Web Service components provide the developer with the framework to reference classes and API’s needed by RESTful and SOAP Web services. These components let you add interceptors, bundled logic which executes before the service is published, that run tasks such as scheduling or logging a specific event.
Components | Description | Documentation | |
---|---|---|---|
REST |
Makes a REST web service available to the application flow via Jersey. |
||
CXF |
Makes a web service available to the application flow via CXF. |