liangyepianzhou commented on code in PR #21495:
URL: https://github.com/apache/pulsar/pull/21495#discussion_r1390205340
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorSubscriptionTest.java:
##########
@@ -704,6 +705,66 @@ public void
testReplicatedSubscriptionWhenReplicatorProducerIsClosed() throws Ex
Awaitility.await().untilAsserted(() ->
assertNotNull(topic2.getSubscription(subscriptionName)));
}
+ @Test
+ public void testReplicateSubBackLog() throws Exception {
+ String namespace =
BrokerTestUtil.newUniqueName("pulsar/testReplicateSubBackLog");
+ String topic = "persistent://" + namespace +
"/when-replicator-producer-is-closed";
+ String subName = "sub";
+
+ admin1.namespaces().createNamespace(namespace);
+
pulsar1.getConfiguration().setReplicatedSubscriptionsSnapshotFrequencyMillis(100);
+ @Cleanup
+ PulsarClient client1 =
PulsarClient.builder().serviceUrl(url1.toString())
+ .statsInterval(0, TimeUnit.SECONDS)
+ .build();
+ @Cleanup
+ Consumer<byte[]> consumer = client1.newConsumer()
+ .topic(topic)
+ .subscriptionName(subName)
+ .ackTimeout(5, TimeUnit.SECONDS)
+ .subscriptionType(SubscriptionType.Shared)
+ .replicateSubscriptionState(true)
+ .subscribe();
+ @Cleanup
+ Producer<byte[]> producer = client1.newProducer()
+ .topic(topic)
+ .create();
Review Comment:
Thanks for your suggestion. I have added the ack message case into the test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]