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

Facebook consumer throws IllegalArgumentException with reading parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.16.2
    • 2.16.3, 2.17.0
    • camel-facebook
    • None
    • OpenJDK Runtime Environment (IcedTea 2.6.4) (Arch Linux build 7.u95_2.6.4-1-x86_64)

    • Unknown

    Description

      I've configured a polling Facebook consumer with nearly default Spring configuration as follows:

      <camel:from uri="facebook://getFeed?
          reading.since=2016-01-01T00:00:00Z&amp;
          userId=myUserId&amp;
          consumer.delay=60000&amp;
          oAuthAppId=[s]&amp;
          oAuthAppSecret=[s]&amp;
          oAuthAccessToken=[s]
          "/>
      

      However, an IllegalArgument is thrown with any reading.* parameter regardless of endpoint:

      java.lang.IllegalArgumentException: No matching operation for getFeed, with arguments [readingOptions, reading, userId]
      

      On debugging, the method FacebookEndpoint.configureProperties sets two properties on the configuration object: (readingOptions, reading).

      FacebookPropertiesHelper.configureReadingProperties(configuration, options);
      

      readingOptions is a Map which is finally size 0 after all the relevant properties are extracted into the reading parameter. However, it isn't nullified.

      In the subsequent method initState(), it tries to look for a method in FacebookMethodTypes with the signature:

      getFeed(String userId, Reading reading)
      

      Because readingOptions is non null, it looks for a readingOptions parameter as well which doesn't exist, throwing the Exception.

      Is there a workaround I can use for the moment? Thanks!

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            jusw85 Justin W
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: