StevenLuMT commented on code in PR #20481:
URL: https://github.com/apache/pulsar/pull/20481#discussion_r1220665562
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java:
##########
@@ -1386,6 +1386,27 @@ public void testGetMessageById() throws Exception {
}
}
+ @Test
+ public void testGetMessageById4SpecialPropsInMsg() throws Exception {
+ TenantInfoImpl tenantInfo = new TenantInfoImpl(Set.of("role1",
"role2"), Set.of("test"));
+ admin.tenants().createTenant("tenant-xyz", tenantInfo);
+ admin.namespaces().createNamespace("tenant-xyz/ns-abc",
Set.of("test"));
+ final String topicName1 =
"persistent://tenant-xyz/ns-abc/testGetMessageById1";
+ admin.topics().createNonPartitionedTopic(topicName1);
+ Map<String, String> specialProps = new HashMap<>();
+ specialProps.put("city=shanghai", "tag");
+ specialProps.put("city,beijing", "haidian");
+ @Cleanup
+ ProducerBase<byte[]> producer1 = (ProducerBase<byte[]>)
pulsarClient.newProducer().topic(topicName1)
+ .enableBatching(false).create();
+ String data1 = "test1";
+ MessageIdImpl id1 = (MessageIdImpl)
producer1.newMessage().value(data1.getBytes()).properties(specialProps)
+ .send();
+
+ Message<byte[]> message1 = admin.topics().getMessageById(topicName1,
id1.getLedgerId(), id1.getEntryId());
+ Assert.assertEquals(message1.getData(), data1.getBytes());
Review Comment:
done,thanks
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]