mattisonchao opened a new issue #13628:
URL: https://github.com/apache/pulsar/issues/13628


   ## Motivation
   
   In some case or for better observability. We can support Pulsar event 
notification mechanism, that can let user subscribe this system topic to 
receive some **"we need notice to user"** event.
   
   ## Goal
   
   Enable users to receive Pulsar system event.
   
   ## API Changes
   
   1. Add config ``pulsarSystemEventEnabled``
   
   ```java
   pulsarSystemEventEnabled=false
   ```
   2. Add ``SystemEventMessageBuilder``
   ```java
   
   public interface SystemEventMessageBuilder {
   
       SystemEventMessageBuilder eventType(SystemEvent event);
   
       SystemEventMessageBuilder properties(Map<String,Object> properties);
       
       SystemEventMessageBuilder addProperty(String key, Object value);
   
       SystemEventMessage build();
   
   }
   
   ```
   3. Add ``SystemEventService``
   
   ```java
   
   public interface SystemEventService {
       
       void init();
       
       CompletableFuture<MessageId> trigger(SystemEventMessage message);
       
       void close();
   }
   
   ```
   
   ## Implementation
   
   This PIP just is a simple version, it's purpose is to discuss what event we 
need to trigger? how to trigger? and what is the event message structure.
   
   I think we need to trigger some event as bellow:
   
   - [ ] Client connected
   - [ ] Client disconnected
   - [ ] Consumer subscribe
   - [ ] Consumer unsubscribe
   - [ ] Producer publish
   - [ ] Message delivered
   - [ ] Message acked
   
   These are far from enough, and we need to continue to make supplements here.
   Please fell free to give me more advice for this PIP.
   
   ## Reject Alternatives
   
   none.


-- 
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]


Reply via email to