【问题标题】:Is there ValueInputOption parameter support in google sheet component in Apache camel?Apache camel 的 google sheet 组件中是否有 ValueInputOption 参数支持?
【发布时间】:2019-06-29 13:09:28
【问题描述】:

google sheet API (https://developers.google.com/sheets/api/reference/rest/v4/ValueInputOption) 提到 ValueInputOption 是强制性的。 我正在尝试使用 Apache camel 的 google sheet 组件写入 googlesheet。

我收到ResolveEndpointFailedException:

org.apache.camel.ResolveEndpointFailedException: 解析失败 端点: google-sheets://data/update?ValueInputOption=USER_ENTERED&accessToken=....&applicationName=CamelGoogleApp&clientId=...&clientSecret=....&refreshToken=.....&spreadsheetId=....&values=#vrobj 由于:有 1 个参数无法在端点上设置。 检查 uri 参数是否拼写正确并且它们是 端点的属性。未知 参数=[{ValueInputOption=USER_ENTERED}]

其中骆驼版本是3.0.0-M3,使用的罐子是camel-spring-boot-startercamel-google-sheets-starter

【问题讨论】:

    标签: apache-camel spring-camel


    【解决方案1】:

    您可以使用标头CamelGoogleSheets.valueInputOptionValueInputOption 传递给生产者。

    from("direct:writeToSheet")
        .setHeader("CamelGoogleSheets.valueInputOption", constant("USER_ENTERED"))
        .to("google-sheets://xxx")
    

    【讨论】:

    • 您可能需要参考official documentation,尤其是说明选项可以通过URI 或CamelGoogleSheets.<option> 标头指定的段落
    • @RomanVottner 我没有故意包含这句话。文档指出,每个选项都可以使用 URI 参数或标头进行设置。对于这个具体参数,我不太确定,是否可以将其指定为 URI 参数(我没有在包 org.apache.camel.component.google.sheets 中找到任何名为 valueInputOption 并用 @UriParam 注释的字段)。现在我正在测试 URI 替代方案,如果这可以作为 URI 参数传递,最终将编辑答案。
    猜你喜欢
    • 1970-01-01
    • 2020-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-09
    • 1970-01-01
    • 2015-03-02
    • 1970-01-01
    相关资源
    最近更新 更多