[ 
https://issues.apache.org/jira/browse/FLINK-31428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17700359#comment-17700359
 ] 

Alpha Diallo commented on FLINK-31428:
--------------------------------------

Ok I see. Yes, the reason we added the factory is in case the callback isn't 
serializable. But we would also want the callback/interceptor to implement 
`AutoCloseable` so we can safely dispose of unmanaged resources during app 
shutdown.

I assume going with extending the `*Interceptor` types would be a bit more work 
and require some change to the Pulsar client libraries as well?

> Add user callbacks to  PulsarSource and PulsarSink
> --------------------------------------------------
>
>                 Key: FLINK-31428
>                 URL: https://issues.apache.org/jira/browse/FLINK-31428
>             Project: Flink
>          Issue Type: New Feature
>          Components: Connectors / Pulsar
>            Reporter: Alpha Diallo
>            Priority: Major
>
> We'd like to add support for user callbacks in {{PulsarSource}} and 
> {{{}PulsarSink{}}}. This enables specific use cases such as event tracing 
> which requires access to low level message properties such as message IDs 
> after an event is produced, topic partitions, etc...
> The functionality required is similar to {{ConsumerInterceptor}} and 
> {{ProducerInterceptor}} in the Pulsar Client. However, there is a case to be 
> made for adding new APIs that would help avoid the extra cost of ser/deser 
> when getting the message body through the {{Message}} interface in the 
> interceptors.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to