Skip to content

feat: support configuring the client keep-alive interval - #316

Open
M-Schwab wants to merge 1 commit into
apache:mainfrom
M-Schwab:keep-alive-interval
Open

M-Schwab wants to merge 1 commit into
apache:mainfrom
M-Schwab:keep-alive-interval

Conversation

@M-Schwab

Copy link
Copy Markdown

Motivation

Exposes the C++ ClientConfiguration::setKeepAliveIntervalInSeconds to python. On a slow or conogested link, a live connection can be quite for longer than that - so allows users to configure this option.

Modifications

  • Bind ClientConfiguration::getKeepAliveIntervalInSeconds / setKeepAliveIntervalInSeconds in src/config.cc as keep_alive_interval_in_seconds.
  • Add keep_alive_interval_seconds: int = 30 to pulsar.Client, documented and validated (an int greater than 0), and pass it to the configuration.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • test_client_argument_errors covers a non-int and a non-positive keep_alive_interval_seconds.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API: a new optional keep_alive_interval_seconds argument to pulsar.Client (and so pulsar.asyncio.Client); the default keeps the current behavior
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Expose the C++ client's ClientConfiguration keep-alive interval as
Client(keep_alive_interval_seconds=30).

Generated-by: Claude Code 2.1.312 (Claude Opus 5.5)
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