Adapt to CommandProcessor.handle() returning CompletableFuture<Boolean> PubSubMessageProcessor.handle() is updated to return CompletableFuture<Boolean>, propagating the future from CommandProcessor.handle() to the caller. MessageReceiverProvider chains thenAccept/exceptionally on the future so that the Pub/Sub message is acked or nacked only after processing truly completes, fixing a race condition where a message could be acked before an async index operation finished. This fixes premature Pub/Sub ack for forwarded index commands Change-Id: I426a2723f926f4fe16ef6b168e81e55c49f10b3d
This plugin provides an extension of the Gerrit's high-availability plugin: it provides GCP pubsub based message forwarding.
This plugin is released under the same Apache 2.0 license and copyright holders as of the Gerrit Code Review project.
Refer to the build instructions in the plugin documentation.
Install
high-availability-gcp plugin in the Gerrit site's plugins folder.This is a minimal configuration:
[pubsub] projectId = my-gcp-project privateKeyLocation = /path/to/private/key/my-gcp-project-6f0d80a3f655.json
A complete set of configuration options is given in the following example. The example values given here are also the default values:
[pubsub] projectId = my-gcp-project privateKeyLocation = /path/to/private/key/my-gcp-project-6f0d80a3f655.json [pubsub "topics"] main = default streamEvents = stream-events [pubsub "limits"] subscriptionTimeout = 10s shutdownTimeout = 10s publisherThreadPoolSize = 4 subscriberThreadPoolSize = 4 [pubsub "retention"] ackDeadline = 10s messageRetentionDuration = 7d retainAckedMessages = false [pubsub "retry"] maxDeliveryAttempts = 5 minimumBackoff = 10s maximumBackoff = 10m