Replay Push Topic Streaming Events Using webMethods CloudStreams Provider For Salesforce

Summary:

This article describes the detailed steps to configure the replay options for a Connector listener. Instructions described in this article are for webMethods Product version 10.5 onwards.

Event Replay in Salesforce:

Salesforce supports guaranteed delivery of events from API version 37.0 onward. It does this by storing standard event volumes for 24 hours. Events are published to the event bus. In Salesforce each event is assigned a unique id stored in the ReplayId field of the corresponding event object. It mostly refers to the position of the event in the event stream. A subscriber can retrieve missed event objects using these ReplayId values.

For further information please go through the salesforce documentation:

https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_durability.htm

Prerequisites:

  • Create a Salesforce.com developer account.
  • Create a push topic. Use the Developer Console to create the PushTopic record that contains a SOQL query.
    1. Open the Developer Console.
    2. Click Debug | Open Execute Anonymous Window.
    3. In the Enter Apex Code window, paste in the following Apex code, and click Execute
  • Install the WmSalesforceProvider package of 10.4 or higher version from the TECHCommunity to your IS.

Steps:

  1. Create a CloudStreams connection for Salesforce CRM connector (version 44.0 onwards) to connect to Salesforce.com by logging into the Integration Server Administrator.
  2. Create a Connector Listener for Salesforce connector using SoftwareAG designer (service development). Refer to article: How to configure connector listener for salesforce and get the notifications.
  3. In the listener, configure the Push Topic Name in the parameter tab as shown below to get the realtime notification for any salesforce object, for example: Contact.
  4. Go to Event tab of listener and configure the processing action for the incoming events by using the Add Action option.
  5. Once the listener is configured in designer, go to CloudStreams admin page and choose Salesforce CRM connector ( version 44.0 onwards).
  6. Go to listener tab and it will list your listener configured in designer.
  7. Click on the Configure button of the listener and provide the instance of your salesforce account in the Streaming API endpoint.
  8. Configure the replay option field as ALL to receive all the events in the 24 hours window.
  9. Save changes and enable the listener.
  10. Now create one Contact object in salesforce using Cloud Connector Service or at the Salesforce UI.
  11. Once the contact is created, the configured connector listener receives the notification and executes the configured action.
  12. Disable the listener and create 3-4 contacts object in salesforce. Since listener is disabled, it will not receive any notification.However once you enable the listener, you will receive all the notifications in the 24 hour retention window inclusing the missed notifications because replay option has been set as ALL for the listener.