---
schema_version: "1"
id: 25ed2d9ec20a4fd482539950a4b1799f0133211178cdedf5a6f763f385662555
title: Using Anypoint Code Builder to Configure a Connector
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/connectors/introduction/intro-config-use-acb.md
canonical_url: https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8fe711d69270c8d72dc1c74b01b7ad8b89284846bdcfd83174763ef179e11220
description: MuleSoft Documentation Site
latest: true
---
---
product: Connectors
---

# Using Anypoint Code Builder to Configure a Connector

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

To use Anypoint Code Builder to configure a connector:

- [Create a basic integration project](#create-integration-project) in Anypoint Code Builder.

- [Add connectors](#add-connector-to-project) and other components to your Mule application to
  process your business logic.

- [Configure the connector’s trigger](#configure-trigger).

- [Configure the connector’s operations](#configure-component-attributes).

## Before You Begin

Before creating an integration project, you must:

- [Set up and access the Anypoint Code Builder web or desktop IDE.](https://docs.mulesoft.com/anypoint-code-builder/start-acb)

- Have credentials to access the connector’s API.

To use connectors, you must be familiar with:

- The connector’s API

- Anypoint Connectors

- Mule runtime engine (Mule)

After you complete the prerequisites, you are ready to create an app and configure the connector by
using Anypoint Code Builder.

## Create a New Integration Project

1.  In the activity bar of the IDE, click the
    ![Anypoint Code Builder icon](/mulesoft/current/en-us/connectors/_images/acb-icon-ms-logo.png) (**Anypoint Code Builder**) icon.

2.  From **Quick Actions**, click **Develop an Integration**:

    ![Develop an Integration link highlighted in the Getting started section](/mulesoft/current/en-us/anypoint-code-builder/_images/develop-integration-option-mat.png)

3.  Complete the **Develop an Integration** form.

    <table><colgroup><col> <col></colgroup><thead><tr><th>Attribute</th><th>Value</th></tr></thead><tbody><tr><td><div><div><p><strong>Project Name</strong></p></div></div></td><td><div><div><p>Unique name for your project.</p></div><div><p>This name is used as the title and name of the integration project file. For example, if the project name is "Salesforce Integration," the project file name is <code>salesforce-integration</code>.</p></div></div></td></tr><tr><td><div><div><p><strong>Project Location</strong></p></div></div></td><td><div><div><p>Your home directory or another directory you create. Click <strong>Browse</strong> to select a different directory for the integration project.</p></div><div><p>Don’t create the project within another project directory.</p></div><div><p>See <a href="https://docs.mulesoft.com/anypoint-code-builder/start-add-folders">Adding Folders to Your Home Directory</a>.</p></div></div></td></tr></tbody></table>

4.  Click **Create Project**.

## Add the Connector to Your Integration Project

Anypoint Connectors provide operations for retrieving, modifying, and sending data to and from
systems.

In addition to the
[built-in connectors](https://docs.mulesoft.com/anypoint-code-builder/acb-reference#builtin-connectors) that Anypoint
Code Builder provides, you can download many other connectors from Anypoint Exchange.

To import a connector from Exchange and add it to your configuration:

1.  In the Explorer view, open the configuration XML file for your project, such as
    `my-project-name.xml`.

2.  Click the
    ![Show Mule graphical mode icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-tree-view.png) (**Show
    Mule graphical mode**) icon in the activity bar to open the canvas UI if it doesn’t open
    automatically.

3.  Add the connector the same way you added other components from the canvas UI:

    1.  In the canvas UI, click the
        ![Add Component icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**)
        icon.

    2.  In the **Add Component** panel, click **Connectors**.

    3.  Click the connector name and then click the operation to add, such as **Publish**:

        ![Add Publish operation from the Anypoint MQ Connector](/mulesoft/current/en-us/anypoint-code-builder/_images/int-add-connector-operation.png)

        If the connector isn’t available locally, click the
        ![Search in Exchange icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-search-exchange.png)
        (**Search in Exchange**) toggle:

        ![Search in Exchange toggle](/mulesoft/current/en-us/anypoint-code-builder/_images/int-connector-search-exchange.png)

        <table><tbody><tr><td><i data-value="1"></i><b>1</b></td><td>Search locally</td></tr><tr><td><i data-value="2"></i><b>2</b></td><td>Search in Exchange</td></tr></tbody></table>

    4.  Select the connector to add to your project.

    5.  Select the operation from the **Add Component** panel.

Adding a connector to an integration project does not make that connector available to other
projects in your Anypoint Code Builder workspace.

## Update the Connector Version

To update a connector to a newer version in Anypoint Code Builder, see
[Select Connector Versions for a Project](https://docs.mulesoft.com/anypoint-code-builder/int-versions#project-versions-connectors).

Updating to a new major version (for example, from `1.x` to `2.x`) can introduce
backward-compatibility changes. Before you upgrade, review the release notes and, if available, the
upgrade and migration guide for the connector.

## Creating a Configuration File

A configuration file is a YAML file that references other configurations and specifies values for
your connector’s properties. Define the configuration properties based on the environment that you
are deploying your application to.

1.  In the **Explorer** view, right-click the **resources** folder (`src/main/resources`) and select
    **New File**.

2.  Name the file `config.yaml`.

3.  Populate your file with the connection properties required to connect to your connector. The
    following shows examples of Salesforce, Gmail, and Slack connection properties:

    ```YAML
    salesforce:
     username: "yourUserName"
     password: "yourPassword"
     token: "yourToken"

    email:
     host: "smtp.gmail.com"
     username: "yourGmailEmail"
     password: "yourEmailAppPassword"

    slack:
     token: "yourSlackToken"
    ```

4.  Navigate to your project XML, add a new line before the `</mule>` tag, type `configuration`, and
    select **mule:configurationProperties**:

    ![List of components with an arrow pointing to the mule:configurationProperties component](/mulesoft/current/en-us/anypoint-code-builder/_images/select-mule-config-properties-contacts-sync.png)

5.  Scroll through the attributes and set the value of `file` to `config.yaml`:

    ```XML
    <configuration-properties file="config.yaml" doc:name="Configuration properties" />
    ```

### Salesforce Connector Configuration Example

Use the values in your `config.yaml` file to connect Salesforce Connector to your Salesforce
environment:

1.  In your project XML file, create a new line after the `<configuration-properties/>` element,
    type `salesforce`, and select **salesforce:sfdc-config**.

2.  Set the **name** field to `Salesforce-Config`.

3.  Create a new line, type `basic`, and select **Salesforce:Basic**.

4.  Configure the `username` and `password` properties to use your configuration file values:

    ```XML
    <salesforce:basic-connection username="${salesforce.username}" password="${salesforce.password}" securityToken="${salesforce.token}" />
    ```

    > [!NOTE] When you move your cursor over the `${salesforce.username}` and
    > `${salesforce.password}` elements, Anypoint Code Builder shows the values from the
    > configuration file.

5.  Click **Test Connection** for the `<salesforce:sfdc-config/>` element to verify your connection
    to Salesforce:

    ![Arrow pointing to the Test Connection option in the connection XML](/mulesoft/current/en-us/anypoint-code-builder/_images/sync-api-sfdc-test-connection.png)

    Anypoint Code Builder returns a **Connection is valid** message.

    If you get an error, check the error message to troubleshoot further. For more information, see
    [Troubleshooting Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting).

## Configuring a Trigger for the Flow

A trigger (source) starts the flow when specified conditions are met. If a connector has its own
associated sources, you can use a connector-specific trigger to initiate the flow. Each connector
trigger has a unique configuration.

### Configuring HTTP Listener

To use HTTP Listener as a trigger for the flow:

1.  Click the **Listener** component on the canvas.

2.  (Optional) Click the edit icon to change the name of the **Listener** component.

3.  (Optional) If you created a configuration file for the connector, select it.

4.  In the **General** tab, in the **Path** field, enter the relative path for the path set in the
    HTTP configuration element. See
    [Configure Paths](https://docs.mulesoft.com/http-connector/latest/http-listener-ref#configure-paths).

5.  Select the **Advanced** tab to configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Allowed methods</p></td><td><p>To allow all HTTP methods (default), do not define this attribute. To restrict specific methods, specify the allowed HTTP methods in a comma-separated format, for example, <code>POST,GET</code>.</p></td><td><p>No</p></td></tr><tr><td><p>Response streaming mode</p></td><td><div><div><p>Whether to use streaming when the response is sent. When HTTP Connector manages response bodies, the connector considers the type of data to send and uses <em>chunked</em> encoding when the body size isn’t clear. This causes streams with no size information. To control this behavior, select any of these options:</p></div><div><ul><li><p><strong>AUTO (default)</strong><br>Uses <code>Content-Length</code> encoding if a size is defined for the body, otherwise uses <code>Transfer-Encoding: chunked</code>.</p></li><li><p><strong>ALWAYS</strong><br>Uses <code>Transfer-Encoding: chunked</code> regardless of any size data present.</p></li><li><p><strong>NEVER</strong><br>Uses <code>Content-Length</code> encoding, consuming streams if necessary to determine the data size.</p></li></ul></div></div></td><td><p>No</p></td></tr><tr><td><p>Output MIME type</p></td><td><p>MIME type of the payload that this component outputs.</p></td><td><p>No</p></td></tr><tr><td><p>Parameters</p></td><td><p>Appends a key-value pair for a reader property to the value of the Output MIME attribute. Multiple key-value pairs are allowed.</p></td><td><p>No</p></td></tr><tr><td><p>Output encoding</p></td><td><p>Encoding of the payload that this component outputs.</p></td><td><p>No</p></td></tr><tr><td><p>Streaming Strategy</p></td><td><div><div><ul><li><p><a href="https://docs.mulesoft.com/http-connector/latest/http-documentation#repeatable-in-memory-stream">Repeatable in-memory stream</a></p></li><li><p><a href="https://docs.mulesoft.com/http-connector/latest/http-documentation#repeatable-file-store-stream">Repeatable file store stream</a></p></li><li><p>Non-repeatable stream</p></li></ul></div><div><p>For more information about configuring the streaming strategy, see <a href="#configuring-streaming-strategy">Configuring the Streaming Strategy in XML</a>.</p></div></div></td><td><p>No</p></td></tr><tr><td><p>Primary node only</p></td><td><p>If selected, executes the <strong>Listener</strong> trigger on the primary node only when the app is running in a cluster.</p></td><td><p>No</p></td></tr><tr><td><p>Redelivery policy</p></td><td><p>Configures the redelivery policy for executing requests that generate errors. You can add a redelivery policy to any source in a flow. For more information about configuring the redelivery policy, see <a href="https://docs.mulesoft.com/http-connector/latest/http-documentation#RedeliveryPolicy">Redelivery Policy</a>.</p></td><td><p>No</p></td></tr><tr><td><p>Reconnection strategy</p></td><td><p>When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. See <a href="https://docs.mulesoft.com/http-connector/latest/http-documentation#reconnect">Reconnect</a>, <a href="https://docs.mulesoft.com/http-connector/latest/http-documentation#reconnect">Reconnect Forever</a>, and <a href="#configuring-reconnection-strategy">Configuring the Reconnection Strategy in XML</a>.</p></td><td><p>No</p></td></tr><tr><td><p>Response</p></td><td><p>Attributes that contain the metadata associated with the body (or payload) of the message. For more information, see <a href="https://docs.mulesoft.com/http-connector/latest/http-documentation#HttpResponseAttributes">HTTP Response Attributes</a>.</p></td><td><p>No</p></td></tr><tr><td><p>Error Response</p></td><td><p>If selected, the HTTP error response returns a status code for the error.</p></td><td><p>No</p></td></tr><tr><td><p>Body</p></td><td><p>Body of the error message.</p></td><td><p>No</p></td></tr><tr><td><p>Headers</p></td><td><div><div><p>Headers to include in the error message. Each header attribute is a key-value pair separated by an equal sign (=), for example:</p></div><div><div><pre><code data-lang="text">Headers=[
          date=Sun, 20 Jan 2019 19:13:51 GMT
          content-type=text/html;
          charset=UTF-8
          transfer-encoding=chunked
          connection=keep-alive
          set-cookie=__cfduid=d03462713a0b2c57c8d2ad3bf311287041548011631;
          expires=Mon, 20-Jan-20 19:13:51 GMT;
          path=/;
          domain=.typicode.com;
          HttpOnly
          x-powered-by=Express
          vary=Origin, Accept-Encoding
          access-control-allow-credentials=true
          cache-control=public, max-age=14400
          last-modified=Tue, 15 Jan 2019 18:17:15 GMT
          via=1.1 vegur
          cf-cache-status=HIT
          expires=Sun, 20 Jan 2019 23:13:51 GMT
          expect-ct=max-age=604800,
          report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
          server=cloudflare
          cf-ray=49c3dc570c2f281c-SJC
       ]</code></pre></div></div></div></td><td><p>No</p></td></tr><tr><td><p>Status code</p></td><td><p>Status code of the error response, for example, <code>Status Code=500</code>.</p></td><td><p>No</p></td></tr><tr><td><p>Reason phrase</p></td><td><p>Reason for the error, for example, <code>Gateway Timeout</code> or <code>Internal Server Error</code>.</p></td><td><p>No</p></td></tr></tbody></table>

For details about the Listener configuration attributes, see
[Listener Configuration](https://docs.mulesoft.com/http-connector/latest/http-documentation#listenerConfig).

### Configuring Scheduler

The Scheduler sets a scheduling strategy at a fixed frequency or an interval based on a cron
expression.

When adding a Scheduler to your Mule application, consider these points:

- Schedulers use the same timezone as the machine on which Mule is running. However, if an
  application is running in CloudHub, the Scheduler conforms to the UTC timezone, regardless of the
  geographic region in which the application is running.

  To set a different time zone for the Scheduler, see `timeZone` in the
  [cron scheduling strategy attributes](#cron-attributes).

- The `disallowConcurrentExecution` property enables you to prevent the Scheduler from triggering
  the execution of the flow while a previously-triggered execution is running.

- If [back-pressure](https://docs.mulesoft.com/mule-runtime/latest/execution-engine#backpressure) occurs because no
  resources are available at the time of the scheduled trigger, Mule skips that execution.

- In a Mule runtime engine cluster or multi-worker CloudHub deployment, the Scheduler executes only
  on the primary node (that is, only in one Mule instance).

```xml
<scheduler doc:name="Scheduler" doc:id="snswxf" >
  <scheduling-strategy/>
</scheduler>
```

Scheduler (`<scheduler/>`) attributes are configurable through the UI and XML.

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute Name</th><th>Attribute XML</th><th>Description</th></tr></thead><tbody><tr><td><p><strong>Scheduler</strong> (default)</p></td><td><p><code>doc:name</code></p></td><td><div><div><p>Editable name for the component to display in the canvas.</p></div></div></td></tr><tr><td><p>N/A</p></td><td><p><code>doc:id</code></p></td><td><div><div><p>Automatically generated identifier for the component.</p></div></div></td></tr><tr><td><p><strong>Disallow concurrent execution</strong></p></td><td><p><code>disallowConcurrentExecution</code></p></td><td><div><div><p>When this attribute is set to <code>true</code>, the Scheduler skips its scheduled execution if a previous execution is still running. Once the flow finishes, the Scheduler executes at the next configured interval. The default value is <code>false</code>.</p></div></div></td></tr></tbody></table>

**Scheduling strategy** (`<scheduling-strategy/>`) is a child element of Scheduler.

<table><colgroup><col> <col></colgroup><thead><tr><th>Child Element</th><th>Description</th></tr></thead><tbody><tr><td><p><code>&lt;scheduling-strategy/&gt;</code></p></td><td><div><div><p>Accepts a <a href="#fixed-frequency-attributes"><code>&lt;fixed-frequency/&gt;</code></a> or <a href="#cron-attributes"><code>&lt;cron/&gt;</code></a> configuration.</p></div></div></td></tr></tbody></table>

### Fixed Frequency Attributes

Scheduler accepts a fixed frequency (`<fixed-frequency/>`) element that accepts these attributes:

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute Name</th><th>Attribute XML</th><th>Description</th></tr></thead><tbody><tr><td><p>N/A</p></td><td><p><code>frequency</code></p></td><td><div><div><p>The frequency at which the Scheduler triggers the flow given the <code>timeUnit</code> setting. Defaults to <code>1000</code>.</p></div></div></td></tr><tr><td><p>N/A</p></td><td><p><code>startDelay</code></p></td><td><div><div><p>The amount of time to delay execution of the Scheduler for the first time after the application starts. This property uses the same <code>timeUnit</code> as the frequency. Defaults to <code>0</code>.</p></div></div></td></tr><tr><td><p>N/A</p></td><td><p><code>timeUnit</code></p></td><td><div><div><p>One of the following time units for the values of <code>frequency</code> and <code>startDelay</code>: <code>MILLISECONDS</code>, <code>SECONDS</code>, <code>MINUTES</code>, <code>HOURS</code>, or <code>DAYS</code>. Defaults to <code>MILLISECONDS</code>.</p></div></div></td></tr></tbody></table>

See the [fixed frequency examples](#example1).

### Cron Attributes

For more complex scheduling, configure a cron expression in the `<cron/>` element.

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute Name</th><th>Attribute XML</th><th>Description</th></tr></thead><tbody><tr><td><p>N/A</p></td><td><p><code>expression</code></p></td><td><div><div><p>A cron expression for triggering the Scheduler. There is no default cron expression. For guidance with expressions, see <a href="#cron-expressions">Cron Expressions</a>. Example: <code>expression="1 1 1 1,7 * ?"</code>.</p></div></div></td></tr><tr><td><p>N/A</p></td><td><p><code>timeZone</code></p></td><td><div><div><p>Time zone passed as a system property, or in a machine’s operating system. <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html" target="_blank" rel="noopener">Java time zone</a> values are supported. Avoid Java abbreviations, such as <code>PST</code> and <code>AGT</code>, and instead use the full-name Java equivalents, such as <code>America/Los_Angeles</code>. Example: <code>timeZone="America/Argentina/Buenos_Aires"</code>.</p></div></div></td></tr></tbody></table>

See the [cron examples](#example2).

### Fixed Frequency Examples

In the following example, the Scheduler executes every fifteen seconds:

```xml
<flow name="ex-fixed-frequency-flow" >
  <scheduler doc:name="Scheduler">
    <scheduling-strategy>
      <fixed-frequency frequency="15" timeUnit="SECONDS" />
    </scheduling-strategy>
  </scheduler>
  <!-- One or more processors here. -->
</flow>
```

In the following example, the Scheduler skips its execution if the flow takes longer to complete
than the fixed frequency of 10 milliseconds:

```xml
<flow name="scheduler-disallowConcurrentExecution-ex" >
  <scheduler doc:name="Scheduler" disallowConcurrentExecution="true" >
    <scheduling-strategy>
      <fixed-frequency frequency="10" timeUnit="MILLISECONDS"/>
    </scheduling-strategy>
  </scheduler>
  <!-- processors here -->
</flow>
```

Each time a Scheduler skips its execution, Mule logs an `Execution skipped` message, for example
(edited for readability):

```logs
INFO  2022-11-09 15:15:43,082 ...
...scheduler.DefaultSchedulerMessageSource:
Flow 'scheduler-disallowConcurrentExecution-ex' is already running and
'disallowConcurrentExecution' is set to 'true'. Execution skipped.

INFO  2022-11-09 15:15:43,083 ...
...scheduler.DefaultSchedulerMessageSource:
Flow 'scheduler-disallowConcurrentExecution-ex' is already running and
'disallowConcurrentExecution' is set to 'true'. Execution skipped.
```

The following example shows a fixed-frequency scheduling strategy that executes the Scheduler every
10 seconds after an initial 10 second delay:

```xml
<scheduler doc:name="Scheduler" >
  <scheduling-strategy >
    <fixed-frequency frequency="10" timeUnit="SECONDS" startDelay="10"/>
  </scheduling-strategy>
</scheduler>
```

### Cron Examples

The following example uses a cron expression to trigger the generation of a Mule message in a new
execution of the flow every fifteen seconds:

```xml
<flow name="ex-cron-expression-flow" >
  <scheduler doc:name="Scheduler" >
    <scheduling-strategy >
      <cron expression='0/15 * * * * ? '/>
    </scheduling-strategy>
  </scheduler>
  <!-- One or more processors here. -->
</flow>
```

The following example uses a cron expression to trigger the flow at 12:00 every day in the
`America/Los_Angeles` time zone.

```xml
<flow name="componentsFlow">
  <scheduler>
    <scheduling-strategy>
      <cron expression="0 0 12 * * ?" timeZone="America/Los_Angeles"/>
    </scheduling-strategy>
  </scheduler>
  <logger message="my message"/>
</flow>
```

## Cron Expressions

Cron is a widely used standard for describing time and date information. The Cron Expression
(`<cron expression />` scheduling strategy (`<scheduling-strategy >`) is useful for triggering a
flow at intervals not available through the Fixed Frequency scheduling strategy.

The Scheduler keeps track of every second and creates a Mule event when the Quartz Cron expression
matches your time-date setting. You can trigger the event just once or at regular intervals.

A date-time expression consists of six required settings and can include the optional year setting.
Specify the settings in the following order:

1.  Seconds (`0`\-`59`)

2.  Minutes (`0`\-`59`)

3.  Hours (`0`\-`23`)

4.  Day of month (`1`\-`31`)

5.  Month (`1`\-`12` or `JAN`\-`DEC`)

6.  Day of the week (`1`\-`7` or `SUN`\-`SAT`)

7.  Year (empty or a 4-digit year between `1970`\-`2099`, for example, `2019`)

The Scheduler supports Quartz Cron expressions. Here are a few examples:

<table><colgroup><col> <col></colgroup><thead><tr><th>Expression</th><th>Behavior</th></tr></thead><tbody><tr><td><p><code>1/2 * * * * ?</code></p></td><td><p>Run every 2 seconds of the day, every day.</p></td></tr><tr><td><p><code>0 15 10 ? * *</code></p></td><td><p>Run at 10:15 a.m., every day. <code>0 15 10 * * ? *</code> and <code>0 15 10 * * ?</code> produce the same effect.</p></td></tr><tr><td><p><code>0 15 10 * * ? 2019</code></p></td><td><p>Run at 10:15 a.m., every day during the year 2019.</p></td></tr><tr><td><p><code>0 * 14 * * ?</code></p></td><td><p>Run every minute starting at 2pm and ending at 2:59pm, every day.</p></td></tr><tr><td><p><code>0 0/5 14 * * ?</code></p></td><td><p>Run every 5 minutes starting at 2pm and ending at 2:55pm, every day</p></td></tr><tr><td><p><code>1 1 1 1,7 * ?</code></p></td><td><p>Run the first second of the first minute of the first hour, on the first and seventh day, every month.</p></td></tr></tbody></table>

The Scheduler component also supports Quartz Scheduler special characters:

- `*`: All values.

- `?`: No specific value.

- `-`: Range of values, for example, `1-3`.

- `,`: Additional values, for example, `1,7`.

- `/`: Incremental values, for example, `1/7`.

- `L`: Last day of the week or month, or last specific day of the month (such as `6L` for the last
  Saturday of the month).

- `W`: Weekday, which is valid in the month and day-of-the-week fields.

- `#`: "nth" day of the month. For example, `#3` is the third day of the month.

This example logs the message "hello" every second:

```XML
<flow name="cronFlow" >
  <scheduler doc:name="Scheduler" >
    <scheduling-strategy >
      <cron expression="* * * * * ?" />
    </scheduling-strategy>
  </scheduler>
  <logger level="INFO" doc:name="Logger" message='"hello"'/>
</flow>
```

Note that there are many free online tools that can help you build Cron expressions.

### Using a Connector-Specific Trigger

If a connector has associated triggers, you can use a connector-specific trigger to initiate the
flow. Each connector trigger has a unique configuration.

For example, you can configure one of these triggers to use with Salesforce Connector:

- **On Deleted Object**

  Initiates your app when a Salesforce user deletes an object. Possible object types are `Contact`,
  `Lead`, `Account`, `Contracts`, `Opportunity`, or the name of a custom object.

- **On Modified Object**

  Initiates your app when a Salesforce user modifies an object. Possible object types are `Contact`,
  `Lead`, `Account`, `Contracts`, `Opportunity`, or the name of a custom object.

- **On New Object**

  Initiates your app when a Salesforce user creates a new object. Possible object types are
  `Contact`, `Lead`, `Account`, `Contracts`, `Opportunity`, or the name of a custom object.

- **Replay channel listener**

  Subscribes to a streaming channel. This source provides channel-related notification settings for
  new events and events stored by Salesforce within the 24-hour retention period. Events that occur
  in the specified channel source trigger the flow.

- **Replay topic listener**

  Subscribes to a topic. This source provides topic-related notification settings for new events and
  events stored by Salesforce within the 24-hour retention period. Events that occur on records in
  the specified topic trigger the flow.

- **Subscribe channel listener**

  Subscribes to a streaming channel. This source provides channel-related notification settings for
  new events that occur after you subscribe.

- **Subscribe topic listener**

  Subscribes to a topic. This source provides topic-related notification settings for new events
  that occur after you subscribe.

> [!NOTE] A channel or topic must be published to Salesforce before a subscription to the channel
> can be created.

For example, to configure the **On New Object** source:

1.  Add the **On New Object** component to the canvas.

2.  Click the **On New Object** component on the canvas.

3.  In the **General** tab, select the configuration file to use, and configure the following
    attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Object type</p></td><td><p>Salesforce object type.</p></td><td><p>Yes</p></td></tr><tr><td><p>Triggers query</p></td><td><p>Query that filters the trigger results, for example, <code>Name='Filter'</code>.</p></td><td><p>No</p></td></tr><tr><td><p>Since</p></td><td><p>Date in the <code>YYYY-MM-DD hh:mm:ss</code> format, for example, <code>2017-03-17 16:30:40</code>. If this field is empty, this source retrieves the selected objects from the time the Mule app started.</p></td><td><p>No</p></td></tr><tr><td><p>Scheduling strategy</p></td><td><p>Triggers the flow’s execution based on a time-based condition. See <a href="#use-scheduler-trigger">Configuring Scheduler</a>.</p></td><td><p>Yes</p></td></tr></tbody></table>

4.  Select the **Advanced** tab to configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Primary node only</p></td><td><p>Executes the <strong>On New Object</strong> trigger only on the primary node when the app is running in a cluster if selected.</p></td><td><p>No</p></td></tr><tr><td><p>Redelivery policy</p></td><td><p>For more information, see <a href="https://docs.mulesoft.com/salesforce-connector/latest/salesforce-connector-reference#RedeliveryPolicy">Redelivery Policy</a></p></td><td><p>No</p></td></tr><tr><td><p>Read timeout</p></td><td><p>How long the consumer waits for a response before it times out.</p></td><td><p>No</p></td></tr><tr><td><p>Time unit</p></td><td><div><div><p>Time unit for the <strong>Read timeout</strong> attribute. Enumeration, one of:</p></div><div><ul><li><p>NANOSECONDS</p></li><li><p>MICROSECONDS</p></li><li><p>MILLISECONDS</p></li><li><p>SECONDS</p></li><li><p>MINUTES</p></li><li><p>HOURS</p></li><li><p>DAYS</p></li></ul></div></div></td><td><p>No</p></td></tr><tr><td><p>Reconnection strategy</p></td><td><p>See <a href="https://docs.mulesoft.com/salesforce-connector/latest/salesforce-connector-reference#reconnect">Reconnect</a> and <a href="https://docs.mulesoft.com/salesforce-connector/latest/salesforce-connector-reference#reconnect-forever">Reconnect Forever</a>, and <a href="#configuring-reconnection-strategy">Configuring the Reconnection Strategy in XML</a>.</p></td><td><p>No</p></td></tr></tbody></table>

## Configure the Component Attributes

After you add components to your integration project, configure the attributes in the component UI,
or configure the attributes directly in the XML code editor.

Connector XML tags start with a namespace followed by an operation, following the syntax
`namespace:operation`, such as `<db:select/>` for a **Select** operation in Anypoint Connector for
Database (Database Connector).

## Configuring a Connector in XML

Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Code Builder:

- If you manually code a Mule runtime engine (Mule) app in XML from the Anypoint Code Builder XML
  editor, you can access the connector from your app by adding reference statements to both your XML
  Mule flow and the Apache Maven `pom.xml` file.

- If you add the connector in Anypoint Code Builder, Studio automatically populates the XML code
  with the connector’s namespace and schema location and it also adds a dependency to the `pom.xml`
  file.

This example shows how the namespace statements are placed in the `<mule>` XML block:

```xml
<mule xmlns:{lc-connector-name}="http://www.mulesoft.org/schema/mule/{lc-connector-name}"
	xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns:file="http://www.mulesoft.org/schema/mule/file"
	xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
	http://www.mulesoft.org/schema/mule/core/current/mule.xsd
	http://www.mulesoft.org/schema/mule/file
	http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
	http://www.mulesoft.org/schema/mule/http
	http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
	http://www.mulesoft.org/schema/mule/ee/core
	http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
	http://www.mulesoft.org/schema/mule/{lc-connector-name}
	http://www.mulesoft.org/schema/mule/{lc-connector-name}/current/mule-{lc-connector-name}.xsd">
```

The Apache Maven `pom.xml` file generated by Anypoint Code Builder contains dependencies for a Mule
app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable
access to this connector:

```xml
<dependency>
  <groupId>{group-id-exchange}</groupId>
  <artifactId>{artifact-id-exchange}</artifactId>
  <version>x.x.x</version>
  <classifier>mule-plugin</classifier>
</dependency>
```

Replace `x.x.x` with the version that corresponds to the connector you are using.

To obtain the most up-to-date `pom.xml` file information:

1.  Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/).

2.  In Exchange, click **Login** and supply your Anypoint Platform username and password.

3.  In Exchange, search for the connector.

4.  Select the connector.

5.  Click **Dependency Snippets**.

### Configuring the Streaming Strategy in XML

You can configure how Mule handles streams with streaming strategies.

### File-Stored Repeatable Stream

The following is an XML example of reading a file that is configured with a 1 MB buffer:

```xml
<file:read path="bigFile.json">
  <repeatable-file-store-stream
    inMemorySize="1"
    bufferUnit="MB"/>
</file:read>
```

If you consistently process a file that’s no larger than 10 KB, you can save memory by reducing the
`inMemorySize` attribute:

```xml
<file:read path="smallFile.json">
  <repeatable-file-store-stream
    inMemorySize="10"
    bufferUnit="KB"/>
 </file:read>
```

### In-Memory Repeatable Stream

The following XML example shows an in-memory repeatable stream with a 512 KB initial size, which
grows at a rate of 256 KB and allows up to 2000 KB (2 MB) of content in memory:

```xml
<file:read path="exampleFile.json">
  <repeatable-in-memory-stream
    initialBufferSize="512"
    bufferSizeIncrement="256"
    maxInMemorySize="2000"
    bufferUnit="KB"/>
</file:read>
```

## Configuring the Reconnection Strategy in XML

The following is an XML example of a standard reconnection strategy setting the count of
reconnection attempts before failing to `5` and setting `failsDeployment` to true, which causes the
application deployment to fail if the connection test fails. Because a frequency is not specified,
the retry interval is the default of every 2000 ms:

```xml
<db:config name="Database_Config" doc:name="Database Config" doc:id="79ae8d0f-e0af-4901-961d-b80befbf3f86" >
	<db:data-source-connection >
		<reconnection failsDeployment="true" >
           <reconnect count="5"/>
        </reconnection>
	</db:data-source-connection>
</db:config>
```

The following is an XML example of a reconnect forever strategy where the connector attempts to
reconnect every 4000 ms for as long as the application runs:

```xml
<db:config name="Database_Config1" doc:name="Database Config" doc:id="c0aaf1dd-ab6e-49ee-9e4d-8b5799945cc9">
    <db:data-source-connection>
        <reconnection failsDeployment="true">
            <reconnection>
                <reconnect-forever frequency="4000"/>
            </reconnection>
        </reconnection>
    </db:data-source-connection>
</db:config>
```

## See Also

- [Anypoint Code Builder Overview](https://docs.mulesoft.com/anypoint-code-builder/)

- [Creating Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations)

- [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb)

- [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference)

- [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs)

- [Triggering Flows in Your Development Environment](https://docs.mulesoft.com/anypoint-code-builder/int-trigger-flows)

- [Configuring Components](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components)

- [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps)

- [Salesforce Help](https://help.salesforce.com)
