Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Connector Configuration Reference

There are two basic connector structures in Mule: connectors that are endpoint-based and connectors that are operation based. This document describes the general configuration needed for both of these models. Please consult the individual connector’s reference information for configuration instructions that are specific to each connector.

Reference information for all connectors bundled automatically in Anypoint Studio is available via the Reference column in this table.

Assumptions

This document assumes that you are familiar with Mule and the Anypoint Studio interface. To increase your familiarity with Studio, consider completing one or more Anypoint Studio Tutorials. Further, this example assumes that you have a basic understanding of Mule flowsGlobal Elements, and Anypoint Connectors.

Endpoint-Based Connector Configuration

Endpoints pass messages into and out of a Mule flow, usually to external resources such as databases, Web clients, or email servers, but they can exchange messages with other Mule flows as well. 

Inbound Endpoints

An Inbound Endpoint, which resides at the beginning of a flow and acts as a Message Source, triggers a new flow instance each time it receives a message.

Each incoming message must follow the specific protocol supported by the receiving endpoint. For example, email can arrive on a POP3 or IMAP inbound endpoint, but files must use the FTP, File, or SFTP endpoints.

connector+conf+inf+3


    
             
          
1
2
3
4
5
6
<flow name="exampleflow" doc:name="exampleflow">
        <http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8081" doc:name="HTTP"/>
        <set-payload doc:name="Set Payload" value="foo"/>
        <http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8083" method="POST" doc:name="HTTP"/>
        <logger level="INFO" doc:name="Logger" message="bar"/>
    </flow>

Composite Sources

A special scope known as a Composite Source Scope allows you to encapsulate two or more connectors that receive the same type of data (e.g., email, files, database maps, or HTML) into a single message processing block. Each embedded connector listens on its specific channel for incoming messages. Whichever connector receives a message first becomes the message source for that particular instance of the flow.

connector+config+ref2

Drag the Composite Source Scope onto the canvas from the palette, then drag the connectors into the Composite Source Scope processing block. The composite source then allows the each embedded connector to act as a temporary, non-exclusive message source when it receives an incoming message.


    
             
          
1
2
3
4
5
6
7
8
9
<flow name="exampleflow2" doc:name="exampleflow2">
        <composite-source doc:name="Composite Source">
            <jetty:inbound-endpoint exchange-pattern="one-way" address="www.example.com" doc:name="Jetty"/>
            <http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8082" doc:name="HTTP"/>
        </composite-source>
        <set-payload doc:name="Set Payload" value="foo"/>
        <http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8083" method="POST" doc:name="HTTP"/>
        <logger level="INFO" doc:name="Logger" message="bar"/>
    </flow>

Add a composite-source tag into your flow, then embed multiple connectors inside the scope of the tag. The composite source then allows the each connector to act as a temporary, non-exclusive message source when it receives an incoming message.

Outbound Endpoints

If an endpoint-based connector is not the first building block (i.e., the message source) in a flow, it is designated as an outbound endpoint, since it uses the specific transport channel it supports (such as SMTP, FTP, or JDBC) to dispatch messages to targets outside the flow, which can range from file systems to email servers to Web clients and can also include other Mule flows.

In many cases, an outbound endpoint completes a flow by dispatching a fully processed message to its final, external destination. However, outbound endpoints don’t always complete flow processing, because they can also exist in the middle of a flow, dispatching data to an external source, and also passing that (or some other data) to the next message processor in the flow.

 image:connector+config+ref+4.png[connector+config+ref+4]

    
             
          
1
2
3
4
5
6
<flow name="exampleflow" doc:name="exampleflow">
        <http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8081" doc:name="HTTP"/>
        <set-payload doc:name="Set Payload" value="foo"/>
        <http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8083" method="POST" doc:name="HTTP"/>
        <logger level="INFO" doc:name="Logger" message="bar"/>
    </flow>

Configuration Reference

While unique properties exist for various endpoint-based connectors, most of these building blocks share common properties.

The General tab often provides these fields.

Field Description

Display Name

Defaults to the connector name. Change the display name, which must be alpha-numeric, to reflect the endpoint’s specific role, e.g., Order Entry Endpoint

Exchange-Pattern

Defines the interaction between the client and server. The available patterns are one-way and request-response. A one-way exchange-pattern assumes that no response from the server is necessary, while a request-response exchange-pattern waits for the server to respond before it allows message processing to continue.

Host

The default name is localhost. Enter the Fully Qualified Domain Name (FQDN) or IP address of the server.

Port

The port number used to connect to the server. (For example, 80)

Path

Allows specification of a path. for example, /enter/the/path

Connector Configuration

Define global connection parameters.

Depending on the protocol and type (inbound or outbound); these additional parameters may appear on the General tab:

Field Description

Polling Frequency

Time is milliseconds (ms) to check for incoming messages. Default value is 1000 ms.

Output Pattern

Choose the pattern from a drop down list. Used when writing parsed filenames to disk.

Query Key

Enter the key of the query to use.

Transaction

Lets you select the element to use for a transaction. Use the (plus) button to add Mule transactions.

Cron Information

Enter a cron expression to schedule events by date and time.

Method

The operation performed on message data. Available options are: OPTION, GET, HEAD, POST, PUT, TRACE, CONNECT and DELETE.

The Advanced tab often includes these fields.

Field Description

Address

Enter the URL address. If using this attribute, include it as part of the URI. Mutually exclusive with host, port, and path.

Response Timeout

How long the endpoint waits for a response (in ms).

Encoding

Select the character set the transport will use. e.g., UTF-8

Disable Transport Transformer

Check this box if you do not want to use the endpoint’s default response transport.

MIME Type

Select a format from the drop-down list that this endpoint supports.

Connector Endpoint

Define a global version of the connector configuration details.

Business Events

Check the box to enable default event tracking.

The Transformers tab often includes these fields.

Field Description

Global Transformers (Request)

Enter the list of transformers that will be applied to a message before delivery. The transformers will be applied in the order they are listed.

Global Transformers (Response)

Enter a list of synchronous transformers that will be applied to the response before it is returned from the transport.

Operation-Based Connector Configuration

Operation-based connectors vary too widely to make generic configuration instructions possible. However, at minimum, all operation-based connectors will require the following fields to be configured on the General tab:

Field Description

Connector Configuration

Define global connection parameters. Most operation-based connectors require that the connection credentials be configured at the global level instead of inside the flow where the operation is specified.

Operation

Select an operation from the drop-down list to specify the function that the connector should perform against the API or protocol.

Be sure to refer to the connector-specific configuration instructions for guidance on the remaining fields.

To configure an operation-based connector in your flow:

  1. Configure a global connector configuration. Click the Global Element tab below the canvas in Anypoint Studio to create a new global connector configuration, or add a <connectorname>:config to your flow in the XML editor.

  2. Configure connector operation in your flow. Drag and drop a connector from the palette onto your canvas and select the appropriate operation, or add a <connectorname>:<operation> in your flow in the XML editor.

  3. Reference the connector configuration from the connector operation.* Click the drop-down next to Connector Configuration in the properties editor to select the global connector that you configured in step 1, or add a config-ref attribute in the XML editor and supply the name of the global connector configuration.

  4. Configure any additional parameters necessary for the operation.

Global Connector Configuration

Some connectors require that connection information such as username, password, and security tokens be configured in a global element rather than at the level of the message processor within the flow. This global connector configuration maintains the configuration and state, and many connectors of the same type in one application can reference the connector configuration at the global level. For example, a Mule application with four different HTTP connectors may all reference the same globally-configured HTTP connector which defines specifics such as security, protocol, and proxy settings. Because they all reference the same global connector configuration, all four HTTP endpoints behave consistently within the application.

Selected global connector configurations can also be defined as shared resources for a domain, then referenced by all applications that reference that same domain. For more information, see Shared Resources.

Note that the global element that you configure in Anypoint Studio is called a Connector Configuration. The corresponding XML tags are <connectorName>:config for operation-based connectors and <connectorName>:connector for endpoint-based connectors.

See Also