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

Salesforce - Wrong Channel Name for Standard Platform Events

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.2
    • 3.4.3, 3.5.0
    • camel-salesforce
    • None
    • Unknown

    Description

      For channels starting with "/event/" "__e" suffix is always added to the channel name in SubscriptionHelper.

       

      However, according to salesforce documentation API names of standard platform events, such as AssetTokenEvent, don't include a suffix.

       

      As a result, camel salesforce component cannot subscribe to Standard Event channels. 

      Suggestion: not to add "__e" suffix to all events, but leave it to endpoint configuration.

       

        EndPoint Channel Name returned by SubscriptionHelper Result
      Current Approach salesforce:/event/LoginEventStream?replayId=-1 /event/LoginEventStream__e "subscription":"/event/LoginEventStream__e"
      "error":"403:denied_by_security_policy:create_denied"
      "successful":false
        salesforce:/event/CustomEvent?replayId=-1 /event/CustomEvent__e "subscription":"/event/CustomEvent__e",
      "successful":true
        salesforce:/event/CustomEvent__e?replayId=-1 /event/CustomEvent__e "subscription":"/event/CustomEvent__e",
      "successful":true
      Suggested Approach salesforce:/event/LoginEventStream?replayId=-1 /event/LoginEventStream "subscription":"/event/LoginEventStream"
      "successful":true
        salesforce:/event/CustomEvent__e?replayId=-1 /event/CustomEvent__e "subscription":"/event/CustomEvent__e",
      "successful":true

       

      To receive the result described in the suggested approach, I removed channel suffix hardcoding from SubscriptionHelper.getChannelName

      static String getChannelName(final String topicName) {
          final StringBuilder channelName = new StringBuilder();
          if (topicName.charAt(0) != '/') {
              channelName.append('/');
          }
      
          if (topicName.indexOf('/', 1) > 0) {
              channelName.append(topicName);
          } else {
              channelName.append("topic/");
              channelName.append(topicName);
          }
          
          /*
           * suffix hardcoding for event channels is removed
           */
      
          return channelName.toString();
      }

       

      Pull request

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            acosentino Andrea Cosentino
            Yullia.buzlukova Yulia Buzlukova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment