You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have my .NET client (windows service) which subscribes to Salesforce streaming API CDC.
I am able to connect to Salesforce and can get the notifications to my client. Everything is working fine, but When there is no activity on the channel (no changes for Salesforce object) after some time (maybe 2 hours) if I update the object, I am not receiving any notification from Salesforce. Can anyone please help me, I read in some of previous posts about implementing "meta/callback" but not able to figure out the implementation, below is the code. I will appreciate if anyone can provide me example for implementation of "meta/handshake" to resubscribe the channels
public async Task StartAsync(CancellationToken cancellationToken)
{
appLifetime.ApplicationStarted.Register(OnStarted);
appLifetime.ApplicationStopping.Register(OnStopping);
appLifetime.ApplicationStopped.Register(OnStopped);
logger.LogInformation("StreamingService.StartAsync has been called.");
logger.LogInformation("Authenticating with Salesforce...");
var authToken = await salesforceClient.GetToken();
logger.LogInformation("Enabling Bayeux protocol...");
var options = new Dictionary<String, Object>
{
{ ClientTransport.TIMEOUT_OPTION, readTimeOut }
};
var headers = new NameValueCollection { { "Authorization", "OAuth " + authToken.AccessToken } };
var transport = new LongPollingTransport(options, headers);
var serverUri = new Uri(authToken.InstanceUrl);
var endpoint = $"{serverUri.Scheme}://{serverUri.Host}{sfOptions.StreamEndpoint}";
bayeuxClient = new BayeuxClient(endpoint, new[] { transport });
logger.LogInformation("Handshaking with Salesforce stream...");
bayeuxClient.Handshake();
bayeuxClient.WaitFor(1000, new[] { BayeuxClient.State.CONNECTED });
logger.LogInformation("Connected to Salesforce stream...");
bayeuxClient.GetChannel(sfOptions.Channel).Subscribe(new Listener(logger));
logger.LogInformation("Waiting for data from server...");
}
The text was updated successfully, but these errors were encountered:
I have my .NET client (windows service) which subscribes to Salesforce streaming API CDC.
I am able to connect to Salesforce and can get the notifications to my client. Everything is working fine, but When there is no activity on the channel (no changes for Salesforce object) after some time (maybe 2 hours) if I update the object, I am not receiving any notification from Salesforce. Can anyone please help me, I read in some of previous posts about implementing "meta/callback" but not able to figure out the implementation, below is the code. I will appreciate if anyone can provide me example for implementation of "meta/handshake" to resubscribe the channels
public async Task StartAsync(CancellationToken cancellationToken)
{
appLifetime.ApplicationStarted.Register(OnStarted);
appLifetime.ApplicationStopping.Register(OnStopping);
appLifetime.ApplicationStopped.Register(OnStopped);
The text was updated successfully, but these errors were encountered: