-
Notifications
You must be signed in to change notification settings - Fork 336
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
Support retry letter topic #359
Conversation
…LQ RECEIPT handler to blocking connection's event loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wuYin work for this, the change LGTM, just one comment, PTAL.
} | ||
} | ||
}() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wuYin Why do we need to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Background:
- Retry topic producer, User topic consumer, they two use same connection instance to interact with broker.
- Request channel, Response channel, they two are listened in a single
select{}
loop by a connection.
When message need to be redelivery:
- Retry topic producer called
SendAsync()
, wrapped User topic consumer AckID logic as callback into message handler. - connection send cmd
SEND
to broker. - Broker send cmd
SEND_RECEIPT
to connection. - connection received and call callback
- callback called
AckID()
, then connection want to send cmdACK
to broker.
in the meantime,select{}
was stucked in step 3 and executingSEND_RECEIPT
handler,incomingRequestsCh
never be chosen, when it fulled with 10 Ack requests, finnally lead to dead block.
Asynchronized reuquest & response channels in connection, this block will be resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, LGTM +1
Fixes #353
Motivation
Follow pulsar#6449 to support retry letter topic in go client
Modifications
Add
retryRouter
for sending reconsume messages to retry letter topicAdd
ReconsumeLater(msg Message, delay time.Duration)
to Consumer interfaceAdd configureable retry letter topic name in
DLQPolicy
enable it explicitly while creating consumer, default unenable
Add 2
TestRLQ*
test casesVerifying this change
Documentation
pulsar doc: retry-letter-topic