Use BrokerApi directly instead of ExtendedBrokerApi With Gerrit v3.10 the BrokerApi includes the extra methods introduced in earlier versions as part of the ExtendedBrokerApi interface. Bug: Issue 327226782 Change-Id: Iabde315058669ec84ca86aa109c4246d58e7d5a9
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/event/EventsBrokerMessageConsumer.java b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/event/EventsBrokerMessageConsumer.java index cf7abba..795ce26 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/event/EventsBrokerMessageConsumer.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/event/EventsBrokerMessageConsumer.java
@@ -18,7 +18,6 @@ import static com.googlesource.gerrit.plugins.replication.pull.event.EventsBrokerConsumerModule.STREAM_EVENTS_TOPIC_NAME; import com.gerritforge.gerrit.eventbroker.BrokerApi; -import com.gerritforge.gerrit.eventbroker.ExtendedBrokerApi; import com.google.gerrit.common.Nullable; import com.google.gerrit.extensions.events.LifecycleListener; import com.google.gerrit.extensions.registration.DynamicItem; @@ -76,16 +75,7 @@ brokerApi.receiveAsync(eventsTopicName, this); return; } - - if (!(brokerApi instanceof ExtendedBrokerApi)) { - throw new IllegalArgumentException( - String.format( - "Failed to load the pull-replication plugin: %s does not support the custom group-id '%s'.\n" - + "Remove replication.eventBrokerGroupId from replication.config or install a different event-broker plugin.", - brokerApi.getClass(), groupId)); - } - - ((ExtendedBrokerApi) brokerApi).receiveAsync(eventsTopicName, groupId, this); + brokerApi.receiveAsync(eventsTopicName, groupId, this); } @Override