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

does not resend auto unsubscribe with updated value #169

Open
matthiashanel opened this issue Feb 5, 2020 · 0 comments
Open

does not resend auto unsubscribe with updated value #169

matthiashanel opened this issue Feb 5, 2020 · 0 comments
Assignees

Comments

@matthiashanel
Copy link
Contributor

in go, on reconnect, a subscription with a limit is followed up by unsubscribe(max-received)
This can cause unnecessary traffic and unnecessarily dropped messages in queue subscribers.

nats.rb/lib/nats/client.rb

Lines 1072 to 1090 in 801f456

def process_connect #:nodoc:
# Reset reconnect attempts since TCP connection has been successful at this point.
current = server_pool.first
current[:was_connected] = true
current[:reconnect_attempts] ||= 0
cancel_reconnect_timer if reconnecting?
# Whip through any pending SUB commands since we replay
# all subscriptions already done anyway.
@pending.delete_if { |sub| sub[0..2] == SUB_OP } if @pending
@subs.each_pair { |k, v| send_command("SUB #{v[:subject]} #{v[:queue]} #{k}#{CR_LF}") }
unless user_err_cb? or reconnecting?
@err_cb = proc { |e| raise e }
end
# We have validated the connection at this point so send CONNECT
# and any other pending commands which we need to the server.
flush_pending

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

No branches or pull requests

3 participants