You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/01/18 16:18:00 UTC

[jira] [Work logged] (CAMEL-13077) Olingo4 Consumer appears to not work with backoffIdleThreshold

     [ https://issues.apache.org/jira/browse/CAMEL-13077?focusedWorklogId=186946&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-186946 ]

ASF GitHub Bot logged work on CAMEL-13077:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Jan/19 16:17
            Start Date: 18/Jan/19 16:17
    Worklog Time Spent: 10m 
      Work Description: phantomjinx commented on pull request #2719: CAMEL-13077: Fix polling return for empty OData ClientEntitySets
URL: https://github.com/apache/camel/pull/2719
 
 
   * ApiConsumerHelper does not recognise ClientEntitySets and thus defaults
     to return a constant 1. This means that the scheduling polling is never
     concluded to be idle and the backoffXXX consumer properties do not work.
   
   * If the ClientEntitySet is empty then return 0 to allow for backoffXXX
     properties to correctly handle the scheduling of the polling.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 186946)
            Time Spent: 10m
    Remaining Estimate: 0h

> Olingo4 Consumer appears to not work with backoffIdleThreshold
> --------------------------------------------------------------
>
>                 Key: CAMEL-13077
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13077
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-olingo4
>    Affects Versions: 2.21.0, 2.22.0, 2.23.0
>            Reporter: Paul Richardson
>            Priority: Major
>             Fix For: 2.22.3, 3.0.0, 2.23.2, 2.24.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Looking into using {{backoffIdleThreshold}} for reducing the amount of polling of OData consuming. So far I cannot see how it would work for the [Olingo4Consumer|https://github.com/apache/camel/blob/master/components/camel-olingo4/camel-olingo4-component/src/main/java/org/apache/camel/component/olingo4/Olingo4Consumer.java]. Bear with me, this may get a little deep to follow!
> Hierarchy: ScheduledPollConsumer > AbstractApiConsumer > Olingo4Consumer
> SchedulePollConsumer maintains an [idleCounter|https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java#L61], which is incremented each time no messages are returned from polling. Once the {{idleCounter}} starts to increment then this in turn starts to increment the backoffCounter taking into account properties such as {{backoffIdleThreshold}}, resulting in delaying polling etc.
> However, in order for {{idleCounter}} to increment, {{poll()}} methods must return 0 messages. Since {{Olingo4Consumer}} defers its {{result[0]}} to [ApiConsumer.getResultsProcessed()|https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/support/component/ApiConsumerHelper.java#L85], the results must be in a form that can be handled by this static method, namely a List, an Iterable or an Array. Otherwise, the result is merely added to the Exchange and the constant '1' is returned.
> Now here is the crux. OData services like to return a {{ClientEntitySet}} hence when the result is passed to {{ApiConsumerHelper}}, it is none of the expected types and ['1'|https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/support/component/ApiConsumerHelper.java#L128] is therefore always returned. Consequently, the return value of {{poll()}} is 1 hence {{idleCounter}} is never incremented.
> I hope that makes sense and if I have made a mistake then please let me know. I think the way to handle this would be to put the entities of the {{ClientEntitySet}} into the result rather than the set itself. That way ApiConsumerHelper would understand a {{Collection}} as an {{Iterable}} and return a proper value based on the size of the collection. Alternatively, if the {{ClientEntitySet}} is desired as the result then maybe {{ApiConsumerHelper}} needs to be extended in some way so as to correctly handle a return value for {{poll()}}.
> Not sure which way to go on this so anxious to start a discussion.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)