Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-9719

[camel-salesforce] limits API throws InvalidFormatException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • fuse-7.3
    • fuse-7.2
    • Camel
    • None
    • % %
    • Hide
      Cause: newer versions of Salesforce REST API add new Limits API metrics making the use of enum for known metrics and supporting new metrics difficult
      Consequence: JSON parsing issues, lack of functionality
      Fix: use a map keyed by Strings instead of enums
      Result: the change should make the Limits API forward compatible
      Show
      Cause: newer versions of Salesforce REST API add new Limits API metrics making the use of enum for known metrics and supporting new metrics difficult Consequence: JSON parsing issues, lack of functionality Fix: use a map keyed by Strings instead of enums Result: the change should make the Limits API forward compatible
    • Fuse 7.3 Sprint 40 - Dev #1

    Description

      I am getting

      com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not deserialize Map key of type org.apache.camel.component.salesforce.api.dto.Limits$Operation from String "DailyAnalyticsDataflowJobExecutions": not a valid representation, problem: (com.fasterxml.jackson.databind.exc.InvalidFormatException) Can not deserialize Map key of type org.apache.camel.component.salesforce.api.dto.Limits$Operation from String "DailyAnalyticsDataflowJobExecutions": not one of values excepted for Enum class: [DailyApiRequests, DailyDurableGenericStreamingApiEvents, ConcurrentAsyncGetReportInstances, DailyGenericStreamingApiEvents, DailyStreamingApiEvents, DailyWorkflowEmails, HourlyDashboardStatuses, HourlySyncReportRuns, DataStorageMB, SingleEmail, HourlyTimeBasedWorkflow, ConcurrentSyncReportRuns, DurableStreamingApiConcurrentClients, DailyBulkApiRequests, FileStorageMB, DailyAsyncApexExecutions, MassEmail, StreamingApiConcurrentClients, HourlyDashboardResults, HourlyAsyncReportRuns, HourlyDashboardRefreshes, HourlyODataCallout, DailyDurableStreamingApiEvents]
       at [Source: java.io.ByteArrayInputStream@6fa0ddf6; line: 1, column: 119]
       at [Source: java.io.ByteArrayInputStream@6fa0ddf6; line: 1, column: 119]
      

      on Fuse on Karaf.

      My java code:

      final Limits limits = producerTemplate.requestBody("salesforce:limits", null, Limits.class);
      

      Salesforce json response (caught in https://github.com/apache/camel/blob/master/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java#L186:

      {"ConcurrentAsyncGetReportInstances":{"Max":200,"Remaining":200},"ConcurrentSyncReportRuns":{"Max":20,"Remaining":20},"DailyAnalyticsDataflowJobExecutions":{"Max":50,"Remaining":50},"DailyApiRequests":{"Max":15000,"Remaining":14823,"Ant Migration Tool":{"Max":0,"Remaining":0},"Dataloader Bulk":{"Max":0,"Remaining":0},"Dataloader Partner":{"Max":0,"Remaining":0},"Force.com IDE":{"Max":0,"Remaining":0},"Salesforce Developers":{"Max":0,"Remaining":0},"Salesforce Mobile Dashboards":{"Max":0,"Remaining":0},"Salesforce Touch":{"Max":0,"Remaining":0},"Salesforce for Outlook":{"Max":0,"Remaining":0},"Syndesisio":{"Max":0,"Remaining":0},"Workbench":{"Max":0,"Remaining":0},"test":{"Max":0,"Remaining":0}},"DailyAsyncApexExecutions":{"Max":250000,"Remaining":250000},"DailyBulkApiRequests":{"Max":10000,"Remaining":10000,"Ant Migration Tool":{"Max":0,"Remaining":0},"Dataloader Bulk":{"Max":0,"Remaining":0},"Dataloader Partner":{"Max":0,"Remaining":0},"Force.com IDE":{"Max":0,"Remaining":0},"Salesforce Developers":{"Max":0,"Remaining":0},"Salesforce Mobile Dashboards":{"Max":0,"Remaining":0},"Salesforce Touch":{"Max":0,"Remaining":0},"Salesforce for Outlook":{"Max":0,"Remaining":0},"Syndesisio":{"Max":0,"Remaining":0},"Workbench":{"Max":0,"Remaining":0},"test":{"Max":0,"Remaining":0}},"DailyDurableGenericStreamingApiEvents":{"Max":10000,"Remaining":10000},"DailyDurableStreamingApiEvents":{"Max":10000,"Remaining":10000},"DailyGenericStreamingApiEvents":{"Max":10000,"Remaining":10000,"Ant Migration Tool":{"Max":0,"Remaining":0},"Dataloader Bulk":{"Max":0,"Remaining":0},"Dataloader Partner":{"Max":0,"Remaining":0},"Force.com IDE":{"Max":0,"Remaining":0},"Salesforce Developers":{"Max":0,"Remaining":0},"Salesforce Mobile Dashboards":{"Max":0,"Remaining":0},"Salesforce Touch":{"Max":0,"Remaining":0},"Salesforce for Outlook":{"Max":0,"Remaining":0},"Syndesisio":{"Max":0,"Remaining":0},"Workbench":{"Max":0,"Remaining":0},"test":{"Max":0,"Remaining":0}},"DailyStreamingApiEvents":{"Max":10000,"Remaining":10000,"Ant Migration Tool":{"Max":0,"Remaining":0},"Dataloader Bulk":{"Max":0,"Remaining":0},"Dataloader Partner":{"Max":0,"Remaining":0},"Force.com IDE":{"Max":0,"Remaining":0},"Salesforce Developers":{"Max":0,"Remaining":0},"Salesforce Mobile Dashboards":{"Max":0,"Remaining":0},"Salesforce Touch":{"Max":0,"Remaining":0},"Salesforce for Outlook":{"Max":0,"Remaining":0},"Syndesisio":{"Max":0,"Remaining":0},"Workbench":{"Max":0,"Remaining":0},"test":{"Max":0,"Remaining":0}},"DailyWorkflowEmails":{"Max":390,"Remaining":390},"DataStorageMB":{"Max":5,"Remaining":4},"DurableStreamingApiConcurrentClients":{"Max":20,"Remaining":20},"FileStorageMB":{"Max":20,"Remaining":20},"HourlyAsyncReportRuns":{"Max":1200,"Remaining":1200},"HourlyDashboardRefreshes":{"Max":200,"Remaining":200},"HourlyDashboardResults":{"Max":5000,"Remaining":5000},"HourlyDashboardStatuses":{"Max":999999999,"Remaining":999999999},"HourlyODataCallout":{"Max":1000,"Remaining":1000},"HourlySyncReportRuns":{"Max":500,"Remaining":500},"HourlyTimeBasedWorkflow":{"Max":50,"Remaining":50},"MassEmail":{"Max":10,"Remaining":10},"MonthlyPlatformEvents":{"Max":300000,"Remaining":300000},"Package2VersionCreates":{"Max":6,"Remaining":6},"PermissionSets":{"Max":1500,"Remaining":1500,"CreateCustom":{"Max":1000,"Remaining":1000}},"SingleEmail":{"Max":15,"Remaining":15},"StreamingApiConcurrentClients":{"Max":20,"Remaining":20}}
      

      Attachments

        Activity

          People

            zregvart@redhat.com Zoran Regvart
            jbouska@redhat.com Jan Bouska
            Jan Bouska Jan Bouska
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: