Skip to content

Subscription initial position ignored with NonDurable subscriptions #7619

@fmiguelez

Description

@fmiguelez

Describe the bug
After fix #7118 on BUG #7046 another BUG was introduced as initial subscription position is ignored with NonDurable subscriptions.

To Reproduce

		final Producer<byte[]> producer = client.newProducer().topic(topicUri).create();
		// We produce one message
		producer.newMessage().key("1").value("Hello world!".getBytes()).send();
		producer.close();

		final Consumer<byte []> consumer = client.newConsumer().topic(topicUri)
				.batchReceivePolicy(BatchReceivePolicy.builder().maxNumMessages(batchSize)
						.timeout(timeoutMillis, TimeUnit.MILLISECONDS).build())
				.readCompacted(true)
				.subscriptionMode(SubscriptionMode.NonDurable)  // Commenting out this line works
				.startMessageIdInclusive().subscriptionType(SubscriptionType.Exclusive).subscriptionName("test")
				.subscriptionInitialPosition(SubscriptionInitialPosition.Earliest).subscribe();
		
		
		// This should receive produced message above but nothing is returned
		Message<byte[]> msg = consumer.receive(1, TimeUnit.SECONDS);

Expected behavior
We expect NonDurable subscriptions to work like normal ones allowing positioning subscription.

Screenshots

Desktop (please complete the following information):

  • Windows with Docker Destktop

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/brokertype/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions