Skip to content

does not resend auto unsubscribe with updated value #169

Open
@matthiashanel

Description

@matthiashanel

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions