Salesforce

Communicate with Salesforce using Java DTOs.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-salesforce-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 109 options, which are listed below.

Name Description Default Type

camel.component.salesforce.all-or-none

Composite API option to indicate to rollback all records if any are not successful.

false

Boolean

camel.component.salesforce.apex-method

APEX method name

String

camel.component.salesforce.apex-query-params

Query params for APEX method

Object>

camel.component.salesforce.apex-url

APEX method URL

String

camel.component.salesforce.api-version

Salesforce API version.

56.0

String

camel.component.salesforce.authentication-type

Explicit authentication method to be used, one of USERNAME_PASSWORD, REFRESH_TOKEN, CLIENT_CREDENTIALS, or JWT. Salesforce component can auto-determine the authentication method to use from the properties set, set this property to eliminate any ambiguity.

AuthenticationType

camel.component.salesforce.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.salesforce.backoff-increment

Backoff interval increment for Streaming connection restart attempts for failures beyond CometD auto-reconnect. The option is a long type.

1000

Long

camel.component.salesforce.batch-id

Bulk API Batch ID

String

camel.component.salesforce.bridge-error-handler

Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.

false

Boolean

camel.component.salesforce.client-id

OAuth Consumer Key of the connected app configured in the Salesforce instance setup. Typically a connected app needs to be configured but one can be provided by installing a package.

String

camel.component.salesforce.client-secret

OAuth Consumer Secret of the connected app configured in the Salesforce instance setup.

String

camel.component.salesforce.composite-method

Composite (raw) method.

String

camel.component.salesforce.config

Global endpoint configuration - use to set values that are common to all endpoints. The option is a org.apache.camel.component.salesforce.SalesforceEndpointConfig type.

SalesforceEndpointConfig

camel.component.salesforce.consumer-worker-pool-enabled

Use thread pool for processing received Salesforce events, for example to process events in parallel.

false

Boolean

camel.component.salesforce.consumer-worker-pool-executor-service

To use a custom thread pool for processing received Salesforce events, for example to process events in parallel. The option is a java.util.concurrent.ExecutorService type.

ExecutorService

camel.component.salesforce.consumer-worker-pool-max-size

Maximum thread pool size size for consumer worker pool.

20

Integer

camel.component.salesforce.consumer-worker-pool-size

Core thread pool size size for consumer worker pool.

10

Integer

camel.component.salesforce.content-type

Bulk API content type, one of XML, CSV, ZIP_XML, ZIP_CSV

ContentType

camel.component.salesforce.default-replay-id

Default replayId setting if no value is found in initialReplayIdMap

-1

Long

camel.component.salesforce.enabled

Whether to enable auto configuration of the salesforce component. This is enabled by default.

Boolean

camel.component.salesforce.event-name

Name of Platform Event, Change Data Capture Event, custom event, etc.

String

camel.component.salesforce.event-schema-format

EXPANDED: Apache Avro format but doesn’t strictly adhere to the record complex type. COMPACT: Apache Avro, adheres to the specification for the record complex type. This parameter is available in API version 43.0 and later.

EventSchemaFormatEnum

camel.component.salesforce.event-schema-id

The ID of the event schema.

String

camel.component.salesforce.fall-back-replay-id

ReplayId to fall back to after an Invalid Replay Id response

-1

Long

camel.component.salesforce.fallback-to-latest-replay-id

Whether the pub/sub consumer needs to fallback to the latest replay id when the provided id is not valid. If set to false, the component will keep retrying; in order to treat this as an exception you can use BridgeExceptionHandlerToErrorHandler and handle the exception in the route.

false

Boolean

camel.component.salesforce.format

Payload format to use for Salesforce API calls, either JSON or XML, defaults to JSON. As of Camel 3.12, this option only applies to the Raw operation.

PayloadFormat

camel.component.salesforce.http-client

Custom Jetty Http Client to use to connect to Salesforce. The option is a org.apache.camel.component.salesforce.SalesforceHttpClient type.

SalesforceHttpClient

camel.component.salesforce.http-client-connection-timeout

Connection timeout used by the HttpClient when connecting to the Salesforce server.

60000

Long

camel.component.salesforce.http-client-idle-timeout

Timeout used by the HttpClient when waiting for response from the Salesforce server.

10000

Long

camel.component.salesforce.http-client-properties

Used to set any properties that can be configured on the underlying HTTP client. Have a look at properties of SalesforceHttpClient and the Jetty HttpClient for all available options.

Object>

camel.component.salesforce.http-max-content-length

Max content length of an HTTP response.

Integer

camel.component.salesforce.http-proxy-auth-uri

Used in authentication against the HTTP proxy server, needs to match the URI of the proxy server in order for the httpProxyUsername and httpProxyPassword to be used for authentication.

String

camel.component.salesforce.http-proxy-excluded-addresses

A list of addresses for which HTTP proxy server should not be used.

String>

camel.component.salesforce.http-proxy-host

Hostname of the HTTP proxy server to use.

String

camel.component.salesforce.http-proxy-included-addresses

A list of addresses for which HTTP proxy server should be used.

String>

camel.component.salesforce.http-proxy-password

Password to use to authenticate against the HTTP proxy server.

String

camel.component.salesforce.http-proxy-port

Port number of the HTTP proxy server to use.

Integer

camel.component.salesforce.http-proxy-realm

Realm of the proxy server, used in preemptive Basic/Digest authentication methods against the HTTP proxy server.

String

camel.component.salesforce.http-proxy-secure

If set to false disables the use of TLS when accessing the HTTP proxy.

true

Boolean

camel.component.salesforce.http-proxy-socks4

If set to true the configures the HTTP proxy to use as a SOCKS4 proxy.

false

Boolean

camel.component.salesforce.http-proxy-use-digest-auth

If set to true Digest authentication will be used when authenticating to the HTTP proxy, otherwise Basic authorization method will be used

false

Boolean

camel.component.salesforce.http-proxy-username

Username to use to authenticate against the HTTP proxy server.

String

camel.component.salesforce.http-request-buffer-size

HTTP request buffer size. May need to be increased for large SOQL queries.

8192

Integer

camel.component.salesforce.http-request-timeout

Timeout value for HTTP requests.

60000

Long

camel.component.salesforce.include-details

Include details in Salesforce1 Analytics report, defaults to false.

false

Boolean

camel.component.salesforce.initial-replay-id-map

Replay IDs to start from per channel name.

Long>

camel.component.salesforce.initial-reply-id-timeout

Timeout in seconds to validate when a custom pubSubReplayId has been configured, when starting the Camel Salesforce consumer.

30

Integer

camel.component.salesforce.instance-id

Salesforce1 Analytics report execution instance ID

String

camel.component.salesforce.instance-url

URL of the Salesforce instance used after authentication, by default received from Salesforce on successful authentication

String

camel.component.salesforce.job-id

Bulk API Job ID

String

camel.component.salesforce.jwt-audience

Value to use for the Audience claim (aud) when using OAuth JWT flow. If not set, the login URL will be used, which is appropriate in most cases.

String

camel.component.salesforce.keystore

KeyStore parameters to use in OAuth JWT flow. The KeyStore should contain only one entry with private key and certificate. Salesforce does not verify the certificate chain, so this can easily be a selfsigned certificate. Make sure that you upload the certificate to the corresponding connected app. The option is a org.apache.camel.support.jsse.KeyStoreParameters type.

KeyStoreParameters

camel.component.salesforce.lazy-login

If set to true prevents the component from authenticating to Salesforce with the start of the component. You would generally set this to the (default) false and authenticate early and be immediately aware of any authentication issues. Lazy login is not supported by salesforce consumers.

false

Boolean

camel.component.salesforce.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.salesforce.limit

Limit on number of returned records. Applicable to some of the API, check the Salesforce documentation.

Integer

camel.component.salesforce.locator

Locator provided by salesforce Bulk 2.0 API for use in getting results for a Query job.

String

camel.component.salesforce.login-config

All authentication configuration in one nested bean, all properties set there can be set directly on the component as well. The option is a org.apache.camel.component.salesforce.SalesforceLoginConfig type.

SalesforceLoginConfig

camel.component.salesforce.login-url

URL of the Salesforce instance used for authentication, by default set to https://login.salesforce.com

https://login.salesforce.com

String

camel.component.salesforce.long-polling-transport-properties

Used to set any properties that can be configured on the LongPollingTransport used by the BayeuxClient (CometD) used by the streaming api

Object>

camel.component.salesforce.max-backoff

Maximum backoff interval for Streaming connection restart attempts for failures beyond CometD auto-reconnect. The option is a long type.

30000

Long

camel.component.salesforce.max-records

The maximum number of records to retrieve per set of results for a Bulk 2.0 Query. The request is still subject to the size limits. If you are working with a very large number of query results, you may experience a timeout before receiving all the data from Salesforce. To prevent a timeout, specify the maximum number of records your client is expecting to receive in the maxRecords parameter. This splits the results into smaller sets with this value as the maximum size.

Integer

camel.component.salesforce.not-found-behaviour

Sets the behaviour of 404 not found status received from Salesforce API. Should the body be set to NULL NotFoundBehaviour#NULL or should a exception be signaled on the exchange NotFoundBehaviour#EXCEPTION - the default.

exception

NotFoundBehaviour

camel.component.salesforce.notify-for-fields

Notify for fields, options are ALL, REFERENCED, SELECT, WHERE

NotifyForFieldsEnum

camel.component.salesforce.notify-for-operation-create

Notify for create operation, defaults to false (API version >= 29.0)

false

Boolean

camel.component.salesforce.notify-for-operation-delete

Notify for delete operation, defaults to false (API version >= 29.0)

false

Boolean

camel.component.salesforce.notify-for-operation-undelete

Notify for un-delete operation, defaults to false (API version >= 29.0)

false

Boolean

camel.component.salesforce.notify-for-operation-update

Notify for update operation, defaults to false (API version >= 29.0)

false

Boolean

camel.component.salesforce.notify-for-operations

Notify for operations, options are ALL, CREATE, EXTENDED, UPDATE (API version < 29.0)

NotifyForOperationsEnum

camel.component.salesforce.object-mapper

Custom Jackson ObjectMapper to use when serializing/deserializing Salesforce objects. The option is a com.fasterxml.jackson.databind.ObjectMapper type.

ObjectMapper

camel.component.salesforce.packages

In what packages are the generated DTO classes. Typically the classes would be generated using camel-salesforce-maven-plugin. Set it if using the generated DTOs to gain the benefit of using short SObject names in parameters/header values. Multiple packages can be separated by comma.

String

camel.component.salesforce.password

Password used in OAuth flow to gain access to access token. It’s easy to get started with password OAuth flow, but in general one should avoid it as it is deemed less secure than other flows. Make sure that you append security token to the end of the password if using one.

String

camel.component.salesforce.pk-chunking

Use PK Chunking. Only for use in original Bulk API. Bulk 2.0 API performs PK chunking automatically, if necessary.

false

Boolean

camel.component.salesforce.pk-chunking-chunk-size

Chunk size for use with PK Chunking. If unspecified, salesforce default is 100,000. Maximum size is 250,000.

Integer

camel.component.salesforce.pk-chunking-parent

Specifies the parent object when you’re enabling PK chunking for queries on sharing objects. The chunks are based on the parent object’s records rather than the sharing object’s records. For example, when querying on AccountShare, specify Account as the parent object. PK chunking is supported for sharing objects as long as the parent object is supported.

String

camel.component.salesforce.pk-chunking-start-row

Specifies the 15-character or 18-character record ID to be used as the lower boundary for the first chunk. Use this parameter to specify a starting ID when restarting a job that failed between batches.

String

camel.component.salesforce.pub-sub-batch-size

Max number of events to receive in a batch from the Pub/Sub API.

100

Integer

camel.component.salesforce.pub-sub-deserialize-type

How to deserialize events consume from the Pub/Sub API. AVRO will try a SpecificRecord subclass if found, otherwise GenericRecord.

avro

PubSubDeserializeType

camel.component.salesforce.pub-sub-host

Pub/Sub host

api.pubsub.salesforce.com

String

camel.component.salesforce.pub-sub-pojo-class

Fully qualified class name to deserialize Pub/Sub API event to.

String

camel.component.salesforce.pub-sub-port

Pub/Sub port

7443

Integer

camel.component.salesforce.pubsub-allow-use-system-proxy

Allow the Pub/Sub API client to use the proxy detected by java.net.ProxySelector. If false then no proxy server will be used.

true

Boolean

camel.component.salesforce.query-locator

Query Locator provided by salesforce for use when a query results in more records than can be retrieved in a single call. Use this value in a subsequent call to retrieve additional records.

String

camel.component.salesforce.raw-http-headers

Comma separated list of message headers to include as HTTP parameters for Raw operation.

String

camel.component.salesforce.raw-method

HTTP method to use for the Raw operation

String

camel.component.salesforce.raw-path

The portion of the endpoint URL after the domain name. E.g., '/services/data/v52.0/sobjects/Account/'

String

camel.component.salesforce.raw-payload

Use raw payload String for request and response (either JSON or XML depending on format), instead of DTOs, false by default

false

Boolean

camel.component.salesforce.raw-query-parameters

Comma separated list of message headers to include as query parameters for Raw operation. Do not url-encode values as this will be done automatically.

String

camel.component.salesforce.refresh-token

Refresh token already obtained in the refresh token OAuth flow. One needs to setup a web application and configure a callback URL to receive the refresh token, or configure using the builtin callback at https://login.salesforce.com/services/oauth2/success or https://test.salesforce.com/services/oauth2/success and then retrive the refresh_token from the URL at the end of the flow. Note that in development organizations Salesforce allows hosting the callback web application at localhost.

String

camel.component.salesforce.replay-preset

Replay preset for Pub/Sub API.

latest

ReplayPreset

camel.component.salesforce.report-id

Salesforce1 Analytics report Id

String

camel.component.salesforce.report-metadata

Salesforce1 Analytics report metadata for filtering. The option is a org.apache.camel.component.salesforce.api.dto.analytics.reports.ReportMetadata type.

ReportMetadata

camel.component.salesforce.result-id

Bulk API Result ID

String

camel.component.salesforce.s-object-blob-field-name

SObject blob field name

String

camel.component.salesforce.s-object-class

Fully qualified SObject class name, usually generated using camel-salesforce-maven-plugin

String

camel.component.salesforce.s-object-fields

SObject fields to retrieve

String

camel.component.salesforce.s-object-id

SObject ID if required by API

String

camel.component.salesforce.s-object-id-name

SObject external ID field name

String

camel.component.salesforce.s-object-id-value

SObject external ID field value

String

camel.component.salesforce.s-object-name

SObject name if required or supported by API

String

camel.component.salesforce.s-object-query

Salesforce SOQL query string

String

camel.component.salesforce.s-object-search

Salesforce SOSL search string

String

camel.component.salesforce.ssl-context-parameters

SSL parameters to use, see SSLContextParameters class for all available options. The option is a org.apache.camel.support.jsse.SSLContextParameters type.

SSLContextParameters

camel.component.salesforce.stream-query-result

If true, streams SOQL query result and transparently handles subsequent requests if there are multiple pages. Otherwise, results are returned one page at a time.

false

Boolean

camel.component.salesforce.update-topic

Whether to update an existing Push Topic when using the Streaming API, defaults to false

false

Boolean

camel.component.salesforce.use-global-ssl-context-parameters

Enable usage of global SSL context parameters

false

Boolean

camel.component.salesforce.user-name

Username used in OAuth flow to gain access to access token. It’s easy to get started with password OAuth flow, but in general one should avoid it as it is deemed less secure than other flows.

String

camel.component.salesforce.worker-pool-max-size

Maximum size of the thread pool used to handle HTTP responses.

20

Integer

camel.component.salesforce.worker-pool-size

Size of the thread pool used to handle HTTP responses.

10

Integer