Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminating a topic does not have the expected behavior from the client #187

Closed
tgrieger-sf opened this issue Sep 9, 2021 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@tgrieger-sf
Copy link

When I terminate a topic from the REST API on a standalone Pulsar container (2.8.0), calling consumer.ReceiveAsynce() does not have the expected behavior. I expect (this line of code)[https://github.com/fsharplang-ru/pulsar-client-dotnet/blob/develop/src/Pulsar.Client/Internal/ConsumerImpl.fs#L1079] to be hit to end the wait on the receive. Instead, it blocks forever.

Am I doing something wrong or missing something?

Here is a simple repro. I am using package version 2.8.0.

private static async Task TestPulsarContainer(string connectionString)
{
	string topicName = "testTopic";
	PulsarClient pulsarClient = await new PulsarClientBuilder().ServiceUrl(connectionString).BuildAsync();
	IProducer<byte[]> producer = await pulsarClient.NewProducer().Topic(topicName).CreateAsync();
	IConsumer<byte[]> consumer = await pulsarClient.NewConsumer().Topic(topicName).SubscriptionName("testSubscription").SubscribeAsync();

	string testMessage = "Test message";
	await producer.SendAsync(Encoding.UTF8.GetBytes(testMessage));

	// Terminate topic with rest api

	Message<byte[]> message = await consumer.ReceiveAsync();
	await consumer.AcknowledgeAsync(message.MessageId);

	// This call should not block because topic is terminated and no other messages are in the queue.
	await consumer.ReceiveAsync();

	// This should be true because topic is terminated and no other messages are in the queue.
	Assert.IsTrue(consumer.HasReachedEndOfTopic);
}
@Lanayx
Copy link
Collaborator

Lanayx commented Sep 9, 2021

Hi! It should be fixed in 2.8.1, can you please check?

Lanayx added a commit that referenced this issue Sep 9, 2021
@Lanayx Lanayx added the bug Something isn't working label Sep 9, 2021
@tgrieger-sf
Copy link
Author

@Lanayx That did fix our issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants