[
https://issues.apache.org/jira/browse/CAMEL-15252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17810595#comment-17810595
]
Brice Frisco edited comment on CAMEL-15252 at 1/24/24 11:26 PM:
----------------------------------------------------------------
If nobody else is working on this then I will.
Thinking a solution similar to the one implemented by the Kafka consumer would
work:
[https://github.com/apache/camel/blob/main/components/camel-kafka/src/main/docs/kafka-component.adoc#using-manual-commit-with-kafka-consumer]
Something like -
{code:java}
public void process(Exchange exchange) {
PubSubManualAck manual =
exchange.getIn().getHeader(GooglePubsubConstants.MANUAL_ACK,
PubSubManualAck.class);
manual.commit();
} {code}
was (Author: JIRAUSER299292):
If nobody else is working on this then I will.
Thinking a solution similar to the one implemented by the Kafka consumer would
work:
[https://github.com/apache/camel/blob/main/components/camel-kafka/src/main/docs/kafka-component.adoc#using-manual-commit-with-kafka-consumer]
Something like -
{code:java}
public void process(Exchange exchange) {
PubSubManualCommit manual =
exchange.getIn().getHeader(GooglePubsubConstants.MANUAL_COMMIT,
PubSubManualCommit.class);
manual.commit();
} {code}
> Google Pubsub Component manual acknowledgement mode
> ---------------------------------------------------
>
> Key: CAMEL-15252
> URL: https://issues.apache.org/jira/browse/CAMEL-15252
> Project: Camel
> Issue Type: New Feature
> Components: camel-google-pubsub
> Affects Versions: 3.4.0
> Reporter: Ramesh Venkitaswaran
> Priority: Minor
> Fix For: 4.x
>
>
> The camel documentation states that there are two ways to acknowledge a
> Google pubsub message. They are "ackMode=AUTO" and "ackMode=NONE". If the
> mode is set to NONE, the document states that the "downstream process has to
> acknowledge explicitly". However there are no examples, or pointers on how to
> do that.
> The unit tests also do not reflect this scenario. The
> [AckModeNoneTest.java|https://github.com/apache/camel/blob/master/components/camel-google-pubsub/src/test/java/org/apache/camel/component/google/pubsub/integration/AckModeNoneTest.java]
> sets the ackMode to NONE, and checks if the message is redelivered, but it
> doesn't test how to acknowledge the message. This file
> [AcknowledgeSync.java|https://github.com/apache/camel/blob/master/components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/consumer/AcknowledgeSync.java]
> has the steps to acknowledge, but it's not clear how to do that within a
> Camel route. It seems to need an class called
> com.google.cloud.pubsub.v1.stub.SubscriberStub that is passed into it.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)