Skip to content

Conversation

@pzajaczkowski
Copy link
Contributor

@pzajaczkowski pzajaczkowski commented Jan 15, 2025

Resolves #23

I had two ideas for approaching this issue:

  • Make WritableServerInfo property and add setter, that will check if LDM has changed to true
  • Add a trigger method that writes the event to a channel in NatsConnection and invoke it directly from NatsReadProtocolProcessor after recieving INFO from server with LDM.

I decided to go with first option.

There is one thing i am not sure of: should anything be passed as argument to the LameDuckModeActivated event? Currently, it is an empty string.

@mtmk
Copy link
Member

mtmk commented Jan 16, 2025

@pzajaczkowski thanks for the PR. long overdue that issue ;)

  • Make WritableServerInfo property and add setter, that will check if LDM has changed to true
  • Add a trigger method that writes the event to a channel in NatsConnection and invoke it directly from NatsReadProtocolProcessor after recieving INFO from server with LDM.

I decided to go with first option.

I think that's fine.

There is one thing i am not sure of: should anything be passed as argument to the LameDuckModeActivated event? Currently, it is an empty string.

Potentially passing the host might be a interesting. Or a copy of the server info?

EDIT: What do you think about passing Uri of the host similar to the proposal in PR #712

pzajaczkowski and others added 2 commits January 21, 2025 15:45
The LDM request feature test uses added to server version 2.10.
Copy link
Member

@mtmk mtmk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @pzajaczkowski

@mtmk mtmk merged commit b254e4c into nats-io:main Jan 21, 2025
10 checks passed
@pzajaczkowski pzajaczkowski deleted the ldm-event-handler branch January 22, 2025 13:24
mtmk added a commit that referenced this pull request Jan 27, 2025
* Fix telemetry header readonly error (#719)
* Add NatsClient to DI (#689)
* Add callback to NatsAuthOpts that allows refreshing a Token (#712)
* Implement Lame Duck Mode Event Handler (#716)
* Add CreateOrUpdateStoreAsync (#707)
@mtmk mtmk mentioned this pull request Jan 27, 2025
mtmk added a commit that referenced this pull request Jan 27, 2025
* Fix telemetry header readonly error (#719)
* Add NatsClient to DI (#689)
* Add callback to NatsAuthOpts that allows refreshing a Token (#712)
* Implement Lame Duck Mode Event Handler (#716)
* Add CreateOrUpdateStoreAsync (#707)
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.

Implement Lame Duck Mode Event Handler

4 participants