Consider adding support for TableView
Explore the TableView API and consider adding support for it.
It may be that it is simple enough as it is and there is not much to add/enhance.
One could expose a TableView as a bean as such:
@Bean
TableView<User> userTableView(PulsarClient pulsarClient) {
try {
return pulsarClient
.newTableView(Schema.AVRO(User.class))
.topic("persistent://public/default/user")
.autoUpdatePartitionsInterval(10, TimeUnit.SECONDS)
.create();
}
catch (PulsarClientException e) {
throw new RuntimeException(e);
}
}
A TableViewFactory like Consumer-and-Producer-Factory could be provided to facilitate in creating TableViews:
pulsarTableViewFactory.createTableView("persistent://public/default/user", Schema.AVRO(User.class));
The TableViewFactory could internally rely on Customizers and let them be overridden if specific Customizers are passed in the createTableView method.
That sounds like a good approach @jonasgeiregat
Contemplated on this a bit more and came up with another design in the line of @PulsarMessage
@PulsarTableView(topic = "${topic.name}", ...)
class CustomType {
}
This would expose a pulsar TableView<CustomType> as a bean.