Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15233

camel-salesforce - CometDReplayExtension does not keep replayId for each message/channel

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.25.2, 3.4.2, 3.5.0
    • Component/s: camel-salesforce
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      CometDReplayExtension class try to read the replayId from the message by doing 

      final Object value = message.get(EXTENSION_NAME);
      

      However, the replayId (based on this https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_durability.htm) is actually within data -> event -> replayId.

       By doing the following (the same thing the salesforce consumer does https://github.com/apache/camel/blob/master/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java#L250)

      final Map<String, Object> data = (Map<String, Object>) message.get("data");
      final Map<String, Object> event = (Map<String, Object>) data.get("event");
      
      final Object value = event.get("replayId");
      

      I was able to properly fetch the replayId from the message.

       Since the current version does not do this properly, If the component loses the connection and has to subscribe again it will use the replayid value from the endpoint which it will be outdated if any message was read before the connection failure.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                edgarc Edgar Chernick
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: