Adapt BrokerApiWrapper to the newest BrokerApi interface With Gerrit v3.10 the BrokerApi includes the extra methods introduced in earlier versions as part of the ExtendedBrokerApi interface. Also add dependency from the healthcheck plugin during the change validation phase, because of the x-plugin dependency with the pull-replication plugin. Bug: Issue 327226782 Change-Id: I3fcfeb28618273763a8c7c58c3aa3eb609306797
diff --git a/Jenkinsfile b/Jenkinsfile index 6ef43af..be0b4fc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile
@@ -1,4 +1,4 @@ pluginPipeline(formatCheckId: 'gerritforge:multi-site-format-47168e90078b0b3f11401610930e82830e76bff7', buildCheckId: 'gerritforge:multi-site-47168e90078b0b3f11401610930e82830e76bff7', - extraPlugins: [ 'pull-replication' ], + extraPlugins: [ 'pull-replication', 'healthcheck' ], extraModules: [ 'events-broker', 'global-refdb' ])
diff --git a/src/main/java/com/googlesource/gerrit/plugins/multisite/broker/BrokerApiWrapper.java b/src/main/java/com/googlesource/gerrit/plugins/multisite/broker/BrokerApiWrapper.java index 9cab884..32fb0a5 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/multisite/broker/BrokerApiWrapper.java +++ b/src/main/java/com/googlesource/gerrit/plugins/multisite/broker/BrokerApiWrapper.java
@@ -16,6 +16,7 @@ import com.gerritforge.gerrit.eventbroker.BrokerApi; import com.gerritforge.gerrit.eventbroker.TopicSubscriber; +import com.gerritforge.gerrit.eventbroker.TopicSubscriberWithGroupId; import com.gerritforge.gerrit.eventbroker.log.MessageLogger; import com.google.common.base.Strings; import com.google.common.util.concurrent.FutureCallback; @@ -116,11 +117,21 @@ } @Override + public void receiveAsync(String topic, String groupId, Consumer<Event> consumer) { + apiDelegate.get().receiveAsync(topic, groupId, consumer); + } + + @Override public void disconnect() { apiDelegate.get().disconnect(); } @Override + public void disconnect(String topic, String groupId) { + apiDelegate.get().disconnect(topic, groupId); + } + + @Override public Set<TopicSubscriber> topicSubscribers() { return apiDelegate.get().topicSubscribers(); } @@ -129,4 +140,9 @@ public void replayAllEvents(String topic) { apiDelegate.get().replayAllEvents(topic); } + + @Override + public Set<TopicSubscriberWithGroupId> topicSubscribersWithGroupId() { + return apiDelegate.get().topicSubscribersWithGroupId(); + } }