Skip to main content

Legacy Streaming Source Connector

sh.oso.salesforce.streaming.SalesforceStreamingSourceConnector

A compatibility fallback using the legacy Streaming API (CometD/Bayeux over HTTP long-polling) for orgs where the Pub/Sub API is unavailable (e.g. Government Cloud). For everything else, prefer the unified source connector.

Supports one subscription per connector (tasks.max is effectively 1) on any of the three channel types:

sf.channel.typeChannelNotes
pushtopic/topic/<name>Auto-creates the PushTopic from the object describe when missing
cdc (default)/data/<channel>ChangeEvents (all entities), <Entity>ChangeEvent, or a custom __chn channel
platform_event/event/<name>__eEvent must pre-exist

Replay & checkpointing

Events carry a numeric replayId that the connector checkpoints in Kafka Connect's offset store. On restart it resubscribes with the stored replayId (durable streaming, API v37.0+). Cold starts use sf.event.start: latest (replayId −1) or all (replayId −2, everything retained — 24h for PushTopics, 72h for CDC/platform events).

When Salesforce rejects a stored replayId as expired/invalid, the connector resubscribes according to sf.invalid.replay.behaviour (all or latest).

Record shape

Values are schemaless maps with _EventType and _ObjectType added. The target topic comes from kafka.topic, which may reference ${_EventType} and ${_ObjectType} — e.g. kafka.topic=sf.${_ObjectType}.

Configuration reference

Full property reference

Streaming Source Configuration — generated from the connector's ConfigDef.

Auth properties are shared with the other connectors — see the source connector.

PropertyTypeDefaultDescription
sf.channel.typeenumcdcpushtopic, cdc, or platform_event
sf.objectstringSObject backing an auto-created PushTopic
sf.pushtopic.namestringPushTopic name (required for pushtopic)
sf.pushtopic.createbooleantrueAuto-create the PushTopic when missing
sf.pushtopic.notify.createbooleantrueNotify on create
sf.pushtopic.notify.updatebooleantrueNotify on update
sf.pushtopic.notify.deletebooleantrueNotify on delete
sf.pushtopic.notify.undeletebooleantrueNotify on undelete
sf.cdc.channelstringChangeEventsCDC channel name
sf.channel.entitieslistEntity filter for multi-entity CDC channels
sf.platform.event.namestringPlatform event API name (.*__e)
sf.event.startenumlatestlatest (−1) or all (−2)
sf.invalid.replay.behaviourenumallRecovery when the stored replayId expired
kafka.topicstringTarget topic template
sf.connection.timeout.mslong30000CometD handshake/subscribe timeout
sf.request.max.retries.time.mslong900000Retry budget

Example — PushTopic

{
"name": "salesforce-streaming",
"config": {
"connector.class": "sh.oso.salesforce.streaming.SalesforceStreamingSourceConnector",
"sf.auth.grant.type": "client_credentials",
"sf.instance.url": "https://acme.my.salesforce.com",
"sf.consumer.key": "...",
"sf.consumer.secret": "...",
"sf.channel.type": "pushtopic",
"sf.object": "Account",
"sf.pushtopic.name": "AccountUpdates",
"kafka.topic": "sf.streaming.accounts",
"sf.event.start": "all"
}
}