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

feat: add rabbitmq.PublishDeliveryMode, a client.PublishOption for setting message delivery mode #126

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

quexer
Copy link
Contributor

@quexer quexer commented Oct 22, 2023

Event.Publish accept client.PublishOption, so I add a new client.PublishOption to set message delivery mode.

It has the same functionality with rabbitmq.DeliveryMode(), but as a client.PublishOption

// Event is used to publish messages to a topic.
type Event interface {
  // Publish publishes a message to the event topic
  Publish(ctx context.Context, msg interface{}, opts ...client.PublishOption) error
}

usage:

...

publisher := micro.NewEvent(topic, microClient).
opt := rabbitmq.PublishDeliveryMode(2)

publisher.Publish(ctx, msg, opt)

...

@quexer
Copy link
Contributor Author

quexer commented Oct 26, 2023

@jochumdev could you pls review and merge this pr ? thanks

Copy link
Contributor

@jochumdev jochumdev left a comment

Choose a reason for hiding this comment

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

good job. thanks.

@jochumdev jochumdev merged commit 4c504d4 into micro:main Nov 24, 2023
2 of 3 checks passed
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.

2 participants