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

Add dead letter support in RabbitMQ pubsub #883

Merged
merged 21 commits into from
Oct 11, 2021

Conversation

Taction
Copy link
Member

@Taction Taction commented May 25, 2021

Description

  1. Add dead letter support in RabbitMQ pubsub.
  2. Add maxLen and maxLenBytes option, queue can has a maximum capacity in order to prevent using too many resources

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #882

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

@yaron2
Copy link
Member

yaron2 commented Jun 4, 2021

@skyao can you please review?

skyao
skyao previously approved these changes Jun 8, 2021
Copy link
Member

@skyao skyao left a comment

Choose a reason for hiding this comment

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

LGTM

@skyao
Copy link
Member

skyao commented Jun 8, 2021

@Taction "This branch is out-of-date with the base branch", please help to update the branch.

@yaron2 I reviewed, but I don't have the write access for this repo, you can help to do the merge.

Copy link
Member

@pkedy pkedy left a comment

Choose a reason for hiding this comment

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

Curious about the format of the DLQ and DLX strings

var args amqp.Table
if r.metadata.enableDeadLetter {
// declare dead letter exchange
dlxName := fmt.Sprintf("%s-%s", defaultDeadLetterExchangeNamePrefix, queueName)
Copy link
Member

Choose a reason for hiding this comment

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

Why not let the DLX and DLQ be free form? Is this convention mandated by RabbitMQ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is not convention mandated by RabbitMQ. Prefixes(DLX and DLQ) can be customized by metadata. Is this OK? In this case, the queueName is consumerID-Topic, the dlx name will be dlxPrefixFromMetadata-consumerID-Topic, the dlq name will be dlqPrefixFromMetadata-consumerID-Topic.

Copy link
Member

Choose a reason for hiding this comment

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

@Taction sorry for the delayed response. What do you think about having the names be formats (e.g. dlq-%s -> usage: dlxName := fmt.Sprintf(defaultDeadLetterExchangeFormat, queueName)).

This would like you specify a constant or plug the queue name in anywhere you want. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Ping @Taction, we'd like to get this merged.

Copy link
Member Author

Choose a reason for hiding this comment

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

@pkedy fixed.

@yaron2 this is the last review comment needs to be fixed.

@pkedy
Copy link
Member

pkedy commented Jun 11, 2021

@Taction pls resolve conflicts

…nto feat_add_rabbitmq_dead_letter

# Conflicts:
#	pubsub/rabbitmq/metadata_test.go
@yaron2 yaron2 requested review from a team as code owners July 12, 2021 18:39
@yaron2
Copy link
Member

yaron2 commented Jul 14, 2021

@Taction have you addressed all review comments?

@daixiang0
Copy link
Member

/cc @yaron2 @skyao

@artursouza
Copy link
Member

@halspang Please, check this with Matt.

@daixiang0
Copy link
Member

daixiang0 commented Sep 22, 2021

@Taction please fix CI failure.

@pkedy
Copy link
Member

pkedy commented Sep 22, 2021

@daixiang0 The MQTT tests can be flakey at times. I re-ran the jobs. Hoping some of the integration tests efforts in 1.5 will resolve this.

@beiwei30 beiwei30 self-requested a review September 27, 2021 10:11
@cvictory
Copy link
Contributor

cvictory commented Oct 1, 2021

@Taction CI Issue.

Copy link
Member

@beiwei30 beiwei30 left a comment

Choose a reason for hiding this comment

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

@Taction I resolved conflicts today. This change looks good to me now.

@beiwei30
Copy link
Member

beiwei30 commented Oct 3, 2021

@Taction Thanks for your proposed change. Would you mind to follow up dapr/docs#1834?

@Taction
Copy link
Member Author

Taction commented Oct 6, 2021

@beiwei30 I'll complete the doc asap.

@codecov
Copy link

codecov bot commented Oct 8, 2021

Codecov Report

Merging #883 (b2aad28) into master (310b4fd) will increase coverage by 0.48%.
The diff coverage is 66.20%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #883      +/-   ##
==========================================
+ Coverage   34.34%   34.83%   +0.48%     
==========================================
  Files         140      141       +1     
  Lines       11993    12147     +154     
==========================================
+ Hits         4119     4231     +112     
- Misses       7450     7486      +36     
- Partials      424      430       +6     
Impacted Files Coverage Δ
bindings/azure/storagequeues/storagequeues.go 36.93% <0.00%> (-0.68%) ⬇️
internal/component/redis/redis.go 0.00% <0.00%> (ø)
internal/component/redis/settings.go 71.42% <ø> (ø)
pubsub/azure/servicebus/subscription.go 0.00% <0.00%> (ø)
tests/conformance/common.go 14.04% <0.00%> (-0.13%) ⬇️
pubsub/azure/servicebus/servicebus.go 30.29% <12.50%> (+0.09%) ⬆️
nameresolution/mdns/mdns.go 60.68% <53.33%> (ø)
pubsub/rabbitmq/rabbitmq.go 63.34% <55.55%> (-4.66%) ⬇️
pubsub/rabbitmq/metadata.go 92.72% <80.95%> (-7.28%) ⬇️
pubsub/azure/servicebus/message.go 85.84% <85.84%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4795f75...b2aad28. Read the comment docs.

@yaron2 yaron2 merged commit ca8cf5c into dapr:master Oct 11, 2021
@yaron2
Copy link
Member

yaron2 commented Oct 11, 2021

This is merged, thanks @Taction for your contribution, and thanks @beiwei30 @pkedy and all for reviewing.

@Taction Taction deleted the feat_add_rabbitmq_dead_letter branch October 26, 2021 14:05
amimimor pushed a commit to amimimor/components-contrib that referenced this pull request Dec 9, 2021
* Add dead letter support

* fix lint

* add maxLen and maxLenBytes support

* Let the DLX and DLQ be free form.

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>
Co-authored-by: Long Dai <long0dai@foxmail.com>
Co-authored-by: Phil Kedy <phil.kedy@gmail.com>
Co-authored-by: Long Dai <long.dai@intel.com>
Co-authored-by: Ian Luo <ian.luo@gmail.com>
Co-authored-by: cvictory <shenglicao2@gmail.com>
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.

Add dead letter support in RabbitMQ pubsub
9 participants