> What about:
> 
> public interface MessageFilter {
>        enum FilterOutcome {
>            ACCEPT, -> deliver to the Consumer
>            REJECT, -> skip the message
>            SYSTEM  -> use standard system processing
>       }
> 
>         public FilterOutcome filterMessages(List<MessageWrapper> messages,
> FilterContext context) throws Exception;
> 
> }
> 
> interface MessageWrapper {
>         ....allow to access Message payload, metadata, headers...
> }
> 
> interface FilterContext {
>        ...isReplayRead,
>        ...access acks
>        ...access ManagedCursor
> }
> 
> 
> This way the implementation of the filter will not use internal APIs that
> evolve in Pulsar sometimes even in point releases.
> 
> Enrico

Hi Enrico:
Thank you for your advice.
I got your point, it works for me. 
More detailed interface implementation, we can discuss it in PR.

Reply via email to