Bartosz Popiela created CAMEL-24569:
---------------------------------------

             Summary: Support Salesforce Streaming API Server-Initiated 
Disconnect Messages
                 Key: CAMEL-24569
                 URL: https://issues.apache.org/jira/browse/CAMEL-24569
             Project: Camel
          Issue Type: Improvement
          Components: camel-salesforce
    Affects Versions: 4.22.0
            Reporter: Bartosz Popiela


Starting with Salesforce Streaming API version 64.0, the Salesforce server can 
send disconnect messages to connected Streaming API clients via the 
{{/meta/disconnect}} channel.

These server-initiated disconnects can occur as a result of infrastructure 
auto-scaling and are expected to happen more frequently on Salesforce 
Hyperforce instances. When such a disconnect occurs, clients are required to 
reconnect to the Streaming API endpoint to keep their subscriptions active.

The Apache Camel Salesforce component should be enhanced to support this 
behavior.

The Salesforce Streaming API client should:
 * Register a listener for the {{/meta/disconnect}} CometD channel.
 * Detect server-initiated disconnect messages.
 * Trigger reconnection to the Salesforce Streaming API endpoint after 
receiving a disconnect message.
 * Restore existing Streaming API subscriptions after reconnecting.
 * Ensure the reconnection mechanism integrates with the component's existing 
connection and retry/recovery logic.
 * Provide appropriate logging to make server-initiated disconnects and 
subsequent reconnection attempts observable.

This change is required to ensure reliable long-running Salesforce Streaming 
API subscriptions with API version 64.0 and later, particularly for Salesforce 
Hyperforce environments where server-initiated disconnects can occur more 
frequently.

*Salesforce documentation:*
[https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_client_connection.htm]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to