nodece opened a new pull request, #23680:
URL: https://github.com/apache/pulsar/pull/23680
### Motivation
I have a broker interceptor, which will add a topic event listener to listen
the topic creation in the
`org.apache.pulsar.broker.intercept.BrokerInterceptor#initialize`. However, the
partitioned topic creation event can not be recorded(`bin/pulsar-admin topics
create-partitioned-topic -p 3 test-topic-event`).
```java
pulsar.getBrokerService().addTopicEventListener((topic, event, stage, t) -> {
log.info("got event {}__{} for topic {}", event, stage, topic);
});
```
The non-partitioned topic works fine.
### Modifications
- Call `topicEventsDispatcher` with the `TopicEvent.CREATE` and
`EventStage.BEFORE` before creating the persistent/non-persistent partitioned
topic.
- Call `topicEventsDispatcher` with the `TopicEvent.CREATE` and
`EventStage.SUCCESS/FAILURE` after the persistent/non-persistent partitioned
topic is created.
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update
later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
--
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]