fmiguelez opened a new issue #7619:
URL: https://github.com/apache/pulsar/issues/7619
**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**
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]