Skip to content

Consider adding support for TableView #503

Open

Description

@onobc

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.

Activity

  1. added this to the Backlog milestone on Jan 17, 2024
  2. jonas-grgt commented on Feb 7, 2024

    @jonas-grgt
    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.

  3. onobc commented on Feb 7, 2024

    @onobc
    ContributorAuthor

    That sounds like a good approach @jonasgeiregat

  4. jonas-grgt commented on Feb 11, 2024

    @jonas-grgt
    Contributor

    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.

  5. sharanggupta commented on Oct 15, 2026

    @sharanggupta

    I have opened #1559 for this. It adds the PulsarTableViewFactory discussed above, in the shape of the PulsarReaderFactory: DefaultPulsarTableViewFactory applies the TableViewBuilderCustomizers of its default configuration, then the topic (qualified with the PulsarTopicBuilder when one is set) and the customizers of the call, and wraps a PulsarClientException in a PulsarException. I left the @PulsarTableView annotation out, since the factory is the piece the rest builds on. If it goes in, I can follow up in Spring Boot with the factory bean and spring.pulsar.table-view.* defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featureA new feature or enhacement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions