Skip to content

Commit

Permalink
[fix][client] Fix multi-topic consumer stuck after redeliver messages (
Browse files Browse the repository at this point in the history
…#18491)

(cherry picked from commit 7a93ff9)
  • Loading branch information
poorbarcode authored and congbobo184 committed Nov 18, 2022
1 parent 961d5b5 commit 97a4bbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
import org.apache.pulsar.broker.service.persistent.PersistentReplicator;
import org.apache.pulsar.broker.service.persistent.PersistentSubscription;
import org.apache.pulsar.broker.service.persistent.PersistentTopic;
import org.apache.pulsar.broker.service.schema.DefaultSchemaRegistryService;
import org.apache.pulsar.broker.service.schema.SchemaRegistryService;
import org.apache.pulsar.client.api.MessageId;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.Schema;
Expand Down Expand Up @@ -184,6 +186,8 @@ public void setup() throws Exception {
pulsar = spyWithClassAndConstructorArgs(PulsarService.class, svcConfig);
doReturn(svcConfig).when(pulsar).getConfiguration();
doReturn(mock(Compactor.class)).when(pulsar).getCompactor();
DefaultSchemaRegistryService schemaRegistryService = new DefaultSchemaRegistryService();
doReturn(schemaRegistryService).when(pulsar).getSchemaRegistryService();

mlFactoryMock = mock(ManagedLedgerFactory.class);
doReturn(mlFactoryMock).when(pulsar).getManagedLedgerFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public void run() {
count++;
}
// because don't have the redeliver epoch, so receive the message count is bigger than 9
assertTrue(count > 9);
assertTrue(count > 8);
Assert.assertEquals(0, datas.size());
}

Expand Down

0 comments on commit 97a4bbf

Please sign in to comment.