lhotari commented on PR #24842:
URL: https://github.com/apache/pulsar/pull/24842#issuecomment-3407413899

   Here's the MessageMapperTableViewImpl experiment:
   
   
https://github.com/lhotari/pulsar/blob/lh-tableview-refactoring-to-support-message-values/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageMapperTableViewImpl.java
   
   for the builder, there would be these methods (instead of the 
createForMessages)
   
   ```java
   <V> TableView<V> createMapped(Function<Message<T>, V> mapper, boolean 
releasePooledMessage) throws PulsarClientException;
   <V> CompletableFuture<TableView<V>> createMappedAsync(Function<Message<T>, 
V> mapper, boolean releasePooledMessage) throws PulsarClientException;
   ```
   
   with this, you could create a `TableView<Message<T>>` by calling the 
createMapped/createMappedAsync method with parameters 
`java.util.function.Function.identity(), false`.
   
   @namest504 I think that this mapper function based approach would provide 
more flexibility for different use cases where message properties would need to 
be taken into account. Do you see any problems with this approach?


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