Contact Free trial Login

Mule Connectors

connector 1 Anypoint Connectors receive or send messages between Mule and one or more external sources, such as files, databases, or Web services. Connectors can act as message sources by working as inbound endpoints, they can act as a message processor that performs an operation in middle of a flow, or they can fall at the end of a flow and act as the recipient of the final payload data.

Connectors in Mule are either endpoint-based* or *operation-based. Endpoint-based connectors follow either a one-way or request-response exchange pattern and are often (but not always) named and based around a standard data communication protocol, such as HTTP, FTP, JMS, and SMTP. Operation-based connectors follow an information exchange pattern based on the operation that you select and are often (but not always) named and based around one or more specific third-party APIs.

Endpoint-Based Connectors

Endpoint based connectors are configured as either inbound or outbound endpoints in a flow. Inbound endpoints serve as a message source for a flow. Outbound endpoints can occur mid-flow or at the end of flows, and send information to external systems.


Operation-Based Connectors

Most connectors that are not based on a standard communication protocol are operation-based, which means that when you add the connector to your flow, you immediately define a specific operation for that connector to perform.


The XML element of the connector differs according to the operation that you select, taking the form <connectorName>:<operation>. For example, sfdc:query or sfdc:upsert-bulk. The remaining configuration attributes or child elements are determined by the operation that you select.

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. Many connectors of the same type in one application can reference the connector configuration at the global level. For operation-based connectors, the global connector configuration is mandatory, but for most endpoint-based connectors it is optional.

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 the examples below.


HTTP Connector

This example shows how an HTTP connector, which is endpoint-based, can be configured as an inbound and outbound endpoint in a flow. In this example, the HTTP connector does not require a global connector configuration, but you can still define one to globally specify optional connection attributes.

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="" xmlns="" xmlns:doc=""

    <http:connector name="HTTP_connector_configuration" enableCookies="true" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" doc:name="HTTP-HTTPS">

    <flow name="httpexampleFlow1" doc:name="httpexampleFlow1">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" connector-ref="HTTP_connector_configuration" doc:name="HTTP"/>
        <set-payload value="foo" doc:name="Set Payload"/>
        <http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8082" connector-ref="HTTP_connector_configuration" method="POST" doc:name="HTTP"/>


JMS Connector

This example shows a JMS connector, which is also endpoint-based, configured as an inbound endpoint in a flow. The JMS endpoint includes a mandatory reference to a global connector configuration which contains the connection parameters.

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:jms="" xmlns="" xmlns:doc="" xmlns:spring="" xmlns:xsi="" xsi:schemaLocation="">

    <jms:activemq-connector name="Active_MQ" username="test" password="test" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ"/>

    <flow name="myNewProjectFlow1" doc:name="myNewProjectFlow1">
        <jms:inbound-endpoint queue="test" connector-ref="Active_MQ" doc:name="JMS Endpoint"/>



Salesforce Connector

This example shows a Salesforce connector, which is operation-based, configured to create a new contact in Salesforce based on the payload pulled from a file endpoint. The Salesforce connector includes a mandatory reference to a global connector configuration which contains the connection parameters.

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:sfdc="" xmlns:file=""
    xmlns="" xmlns:doc=""

    <sfdc:config name="Salesforce" username="test" password="test" securityToken="test" doc:name="Salesforce"/>

    <flow name="newprojectFlow1" doc:name="newprojectFlow1">
        <file:inbound-endpoint responseTimeout="10000" doc:name="File" path="/Users/AaronMacbook/Desktop/Input"/>
        <sfdc:create config-ref="Salesforce" type="contact" doc:name="Salesforce">
            <sfdc:objects ref="#[payload]"/>



See Also

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.