File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
main/java/org/apache/pulsar/broker/resources
test/java/org/apache/pulsar/broker/resources Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ void handleNotification(Notification notification) {
116116 Matcher matcher = entry .getValue ().matcher (notification .getPath ());
117117 if (matcher .matches ()) {
118118 TopicName topicName = TopicName .get (
119- matcher .group (2 ), NamespaceName .get (matcher .group (1 )), matcher .group (3 ));
119+ matcher .group (2 ), NamespaceName .get (matcher .group (1 )), decode ( matcher .group (3 ) ));
120120 entry .getKey ().accept (topicName .toString (), notification .getType ());
121121 }
122122 }
Original file line number Diff line number Diff line change @@ -114,4 +114,13 @@ public void testListenerNotInvokedAfterDeregistered() {
114114 verifyNoMoreInteractions (listener );
115115 }
116116
117+ @ Test
118+ public void testListenerInvokedWithDecodedTopicName () {
119+ BiConsumer <String , NotificationType > listener = mock (BiConsumer .class );
120+ topicResources .registerPersistentTopicListener (NamespaceName .get ("tenant/namespace" ), listener );
121+ topicResources .handleNotification (new Notification (NotificationType .Created ,
122+ "/managed-ledgers/tenant/namespace/persistent/topic%3Atest" ));
123+ verify (listener ).accept ("persistent://tenant/namespace/topic:test" , NotificationType .Created );
124+ }
125+
117126}
You can’t perform that action at this time.
0 commit comments