Hi, Haiting Jiang

>>  CompletableFuture<MessageId> trigger(SystemEventMessage message);
> 
> Maybe `record` make more sense? 

+1

>>  SystemEventMessageBuilder properties(Map<String,Object> properties);
>> 
>>  SystemEventMessageBuilder addProperty(String key, Object value);
> 
> How to handle  the serialization and deserialization if the value type is 
> Object?  

For this part, I think we need to discuss. Do we create a specific event class 
or use properties in json format?


> I think we don't need to record normal message producing and consuming event? 
> That would make the system topic store too much data.


Agree with you.

Maybe the better way is to record some system internal event like node changed, 
ledger deleted etc.






> On Jan 6, 2022, at 12:10 PM, Haiting Jiang <jianghait...@apache.org 
> <mailto:jianghait...@apache.org>> wrote:
> 
> 
>>  CompletableFuture<MessageId> trigger(SystemEventMessage message);
> 
> Maybe `record` make more sense? 
> 
>>  SystemEventMessageBuilder properties(Map<String,Object> properties);
>> 
>>  SystemEventMessageBuilder addProperty(String key, Object value);
> 
> How to handle  the serialization and deserialization if the value type is 
> Object?  
> 
>> - [ ] Producer publish
>> - [ ] Message delivered
>> - [ ] Message acked
> 
> I think we don't need to record normal message producing and consuming event? 
> That would make the system topic store too much data.
> 
> 
> On 2022/01/05 15:27:33 mattison chao wrote:
>> Original PIP : https://github.com/apache/pulsar/issues/13628 
>> <https://github.com/apache/pulsar/issues/13628>
>> 
>> Pasted bellow for quoting convenience.
>> 
>> —— 
>> 
>> ## 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.
>> 
>> Thanks,
>> Mattisonchao
> 
> Thanks,
> Haiting Jiang

Reply via email to