[ 
https://issues.apache.org/jira/browse/CAMEL-11125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15962138#comment-15962138
 ] 

Claus Ibsen commented on CAMEL-11125:
-------------------------------------

An example with 1000 messages then notice how we receive 128 from the start, 
and then almost all the time request 1 message. This is when using 10 
concurrent consumers
{code}
2017-04-09 15:30:50,149 [main           ] INFO  nsumerInflightBackPressureTest 
- Requesting 128 messages
2017-04-09 15:30:50,189 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 2 messages
2017-04-09 15:30:50,189 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,189 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,189 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,189 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,189 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,190 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,190 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,190 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,200 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,201 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,201 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,200 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,201 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,201 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,201 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
2017-04-09 15:30:50,201 [streams://inbox] INFO  nsumerInflightBackPressureTest 
- Requesting 1 messages
{code}

> camel-reactive-streams - Consumer should allow to not refill so frequently
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-11125
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11125
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-reactive-streams
>    Affects Versions: 2.19.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> Every time a consumer has completed onNext it calculates a refill, and 
> because it has completed 1 message, it will always ask for at least 1 
> message. 
> This happens even if there is 127 messages already in the buffer. 
> We should probably have some way of having a low/high watermark so if the 
> buffer has many messages already we dont need to refill so frequently.
> This happens in the code: 
> org.apache.camel.component.reactive.streams.engine.CamelSubscriber#onNext
> By having those watermark threshold we allow to not be so chatty and request 
> data all the time, but instead request data in more bulks. Otherwise chances 
> are that we just keep requesting = 1 all the time.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to