Skip to content

Conversation

onobc
Copy link
Collaborator

@onobc onobc commented Jul 11, 2022

This proposal does the following (reason in sub-bullets):

  • Introduces a PulsarOperations interface
    • matches spring-kafka and defines contract
    • provides default delegation methods to avoid cookie cutter code in impl
  • Removes producer caching from PulsarTemplate (will add this back in on follow commit but probably in producer factory)
    • Current caching is danger of OOME (no cleaning of cache)
  • Producer factory no longer holds onto a single producer instance
    • we hand out N of these, if anything we should hold reference to all and close etc..
  • Removes defaultClientName from PulsarTemplate
    • not thread-safe (topic set on producer config in producer factory)
    • misleading API and it mutates the config props (I never liked this about KafkaTemplate)

Fun facts

  • PulsarClient holds onto all Producers it spits out
  • PulsarClient closes all producers on its close
  • PulsarClient removes producer from list when producer is closed directly
  • Pulsar producers are bound to a single topic at creation time

@onobc onobc requested a review from sobychacko July 11, 2022 20:07
@onobc onobc merged commit 03425c5 into spring-projects:main Jul 12, 2022
@onobc onobc deleted the cbono-refactor-producer branch July 12, 2022 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant