-
Notifications
You must be signed in to change notification settings - Fork 36
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
Publish to exchange #786
Publish to exchange #786
Conversation
@spuun @carlhoerberg any thoughts about always including "default" exchange when getting bindings for a queue heere: https://github.com/cloudamqp/lavinmq/blob/publish-to-exchange/src/lavinmq/vhost.cr#L286 |
f376f8a
to
f2e3189
Compare
Im fine with that |
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.
I ran out of stamina to suggest a few other early returns... I'm not gonna fight for early returns, but i think it's nice.
@spuun agree, early return is nicer. Fixed all now I thinkg |
f55e03a
to
c5e4c9a
Compare
Specs fails because of this: cloudamqp/amqp-client.cr#48 |
2f9392c
to
c107036
Compare
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.
has been working well in the mqtt branch!
0e7cd21
to
27f4268
Compare
27f4268
to
52e261a
Compare
src/lavinmq/exchange/exchange.cr
Outdated
when Queue | ||
queues.add(d) unless d.closed? | ||
when Exchange | ||
d.find_queues(routing_key, headers, queues, exchanges) | ||
end |
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.
when Queue | |
queues.add(d) unless d.closed? | |
when Exchange | |
d.find_queues(routing_key, headers, queues, exchanges) | |
end | |
in Queue | |
queues.add(d) unless d.closed? | |
in Exchange | |
d.find_queues(routing_key, headers, queues, exchanges) | |
end |
Co-authored-by: Carl Hörberg <carl@84codes.com>
Co-authored-by: Carl Hörberg <carl@84codes.com>
WHAT is this pull request doing?
Move the logic of publishing a message to an exchange from Vhost to the exchange.
The idea came because of the need for the exchange to handle the messages differently for MQTT support
but it has additional benefits like
@queue_bindings
and@exchange_bindings
can have different types and as you may see I've used only one "bindings" for both queue and exchange. for example for FanoutExchange it's just a@bindings : Set(Destination)
There is probably some more things that should move down to each subclass to make the code clearer and to support the different types that
@bindings
has now.HOW can this pull request be tested?
specs