Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding support for TableView #503

Open
onobc opened this issue Nov 23, 2023 · 3 comments
Open

Consider adding support for TableView #503

onobc opened this issue Nov 23, 2023 · 3 comments
Labels
type: feature A new feature or enhacement
Milestone

Comments

@onobc
Copy link
Collaborator

onobc commented Nov 23, 2023

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.

@onobc onobc added the type: feature A new feature or enhacement label Nov 23, 2023
@onobc onobc added this to the Backlog milestone Jan 17, 2024
@jonas-grgt
Copy link
Contributor

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.

@onobc
Copy link
Collaborator Author

onobc commented Feb 7, 2024

That sounds like a good approach @jonasgeiregat

@jonas-grgt
Copy link
Contributor

jonas-grgt commented Feb 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature or enhacement
Projects
None yet
Development

No branches or pull requests

2 participants