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

PushTopic client doesn't clear refresh token after a long disconnected period

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.19.0
    • 2.19.5, 2.20.1, 2.21.0
    • camel-salesforce
    • Salesforce API version 41.0 (we don't know if this affect other API versions)

    • Unknown

    Description

      The bayeux client implements a mechanism to reconnect to salesforce's pushtopic after a network failure.

      In production, we experienced a lost of network connection. Bayeux client tried to reconnect and failed to.
      when analyzing, we saw a bunch of logs

      o.a.c.c.s.i.s.SubscriptionHelper : Error restarting: Error during HANDSHAKE: 403::Handshake denied org.apache.camel.CamelException: Error during HANDSHAKE: 403::Handshake denied
      o.a.c.c.s.i.s.SubscriptionHelper : Failed to restart after pausing for 0 msecs
      [skipped...]
      o.a.c.c.s.i.s.SubscriptionHelper : Error restarting: Error during HANDSHAKE: 403::Handshake denied org.apache.camel.CamelException: Error during HANDSHAKE: 403::Handshake denied
      o.a.c.c.s.i.s.SubscriptionHelper : Failed to restart after pausing for 5000 msecs
      [skipped...]
      o.a.c.c.s.i.s.SubscriptionHelper : Error restarting: Error during HANDSHAKE: 403::Handshake denied org.apache.camel.CamelException: Error during HANDSHAKE: 403::Handshake denied
      o.a.c.c.s.i.s.SubscriptionHelper : Failed to restart after pausing for 24000 msecs
      [skipped...]
      o.a.c.c.s.i.s.SubscriptionHelper : Error restarting: Error during HANDSHAKE: 403::Handshake denied org.apache.camel.CamelException: Error during HANDSHAKE: 403::Handshake denied
      o.a.c.c.s.i.s.SubscriptionHelper : Failed to restart after pausing for 30000 msecs

      o.a.c.c.s.SalesforceConsumer : Aborting restart attempt due to: Error during HANDSHAKE: 403::Handshake denied. Caused by: [org.apache.camel.component.salesforce.api.SalesforceException - Aborting restart attempt due to: Error during HANDSHAKE: 403::Handshake denied] org.apache.camel.component.salesforce.api.SalesforceException: Aborting restart attempt due to: Error during HANDSHAKE: 403::Handshake denied
      then the stacktrace.

      When going deeped in analyzing, we figure out that Salesforce, after such a loss of network, can answer by a 401 code (subscription to channel is not valid anymore) and in some circumstances by a 403 code (authentication is not valid anymore - the refresh token has been invalidated by salesforce).

      401 code implies that the client reissue a login with same refreshToken.
      403 code implies that the client reissue a new login phase ( thus invalidating the previous refreshToken).

      401 code is already handled by SubscriptionHelper, while 403 is not.
      see the doStart() method after the handshakeError test

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mabroukb Mabrouk Belhout
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: