You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Justin W (JIRA)" <ji...@apache.org> on 2016/02/02 07:07:39 UTC

[jira] [Created] (CAMEL-9557) Facebook consumer throws IllegalArgumentException with reading parameters

Justin W created CAMEL-9557:
-------------------------------

             Summary: Facebook consumer throws IllegalArgumentException with reading parameters
                 Key: CAMEL-9557
                 URL: https://issues.apache.org/jira/browse/CAMEL-9557
             Project: Camel
          Issue Type: Bug
          Components: camel-facebook
    Affects Versions: 2.16.2
         Environment: OpenJDK Runtime Environment (IcedTea 2.6.4) (Arch Linux build 7.u95_2.6.4-1-x86_64)

            Reporter: Justin W


I've configured a polling Facebook consumer with nearly default Spring configuration as follows:
{code}
<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]
    "/>
{code}

However, an IllegalArgument is thrown with any reading.* parameter regardless of endpoint:
{code}
java.lang.IllegalArgumentException: No matching operation for getFeed, with arguments [readingOptions, reading, userId]
{code}

On debugging, the method FacebookEndpoint.configureProperties sets two properties on the configuration object: (readingOptions, reading).
{code}
FacebookPropertiesHelper.configureReadingProperties(configuration, options);
{code}

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:
{code}
getFeed(String userId, Reading reading)
{code}

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!




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)