sijie commented on a change in pull request #3983: [Issue#3976]
[component/client] Adding config for ReaderImpl
URL: https://github.com/apache/pulsar/pull/3983#discussion_r272865594
##########
File path:
pulsar-broker/src/test/java/org/apache/pulsar/client/api/TopicReaderTest.java
##########
@@ -86,6 +87,33 @@ public void testSimpleReader() throws Exception {
producer.close();
}
+ @Test
+ public void testReaderAtSelectedTimestamp() throws Exception {
+ Producer<byte[]> producer =
pulsarClient.newProducer().topic("persistent://my-property/my-ns/testReaderAtSelectedTimestamp")
+ .create();
+ for (int i = 0; i < 10; i++) {
+ String message = "my-message-" + i;
+ producer.send(message.getBytes());
+ Thread.sleep(1000);
+ }
+
+ Reader<byte[]> reader =
pulsarClient.newReader().topic("persistent://my-property/my-ns/testReaderAtSelectedTimestamp")
+ .startMessageId(3000).create();
+
+ Message<byte[]> msg = null;
+ Set<String> messageSet = Sets.newHashSet();
+ for (int i = 3; i < 10; i++) {
+ msg = reader.readNext(1, TimeUnit.SECONDS);
+
+ String receivedMessage = new String(msg.getData());
Review comment:
use UTF_8 encoding
----------------------------------------------------------------
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]
With regards,
Apache Git Services