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

ASF subversion and git services commented on NIFI-7889:
-------------------------------------------------------

Commit c9d778a8eedad64b243d28fa481fedbe21222e6e in nifi's branch 
refs/heads/main from Pierre Villard
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=c9d778a ]

NIFI-7889 - ConsumeMQTT - use offer instead of add

This closes #4578.

Signed-off-by: Peter Turcsanyi <[email protected]>


> ConsumeMQTT - use offer instead of add
> --------------------------------------
>
>                 Key: NIFI-7889
>                 URL: https://issues.apache.org/jira/browse/NIFI-7889
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Pierre Villard
>            Assignee: Pierre Villard
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> In ConsumeMQTT, we are filling the internal queue of the processor using this 
> code:
> {code:java}
>         if (mqttQueue.size() >= maxQueueSize){
>             throw new IllegalStateException("The subscriber queue is full, 
> cannot receive another message until the processor is scheduled to run.");
>         } else {
>             mqttQueue.add(new MQTTQueueMessage(topic, message));
>         }
> {code}
> Instead of throwing an exception when the internal queue is full, we could 
> have a blocking call with {{offer}}() to give some time for the queue to be 
> drained and then add the message to the queue. If the queue is still full, 
> we'd throw the exception which would cause data loss in case the QoS is 
> configured to 0.
> Documentation should also be improved around the implications of such 
> configuration.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to