Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
NOISSUE - Create broker package for NATS #1080
NOISSUE - Create broker package for NATS #1080
Changes from 13 commits
9aad3b2
6dc7334
387635b
443e89f
04a05c5
7a07e6e
ed6ca0c
653d3c6
c37239d
b9cddf2
f0924be
14c2954
c2cf246
cf1f2d1
660eeb6
2133dcc
d15c3f8
1802904
20d551c
ad07a0d
17289ca
a746a95
00521d4
8aff074
539574e
61d5d9d
a8efe61
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
You think its better to have a separate interface for each broker that we use like
nats
kafka
etc...? Not one Interface lets sayMessenger
that needs to be satisfied by broker imply for examplenats
.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.
Agree.
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.
My first idea was to have a single interface. But it's not possible unless you create a new service for this because NATS interface will never match with Kafka one (it's doable for publish but not for subscribe). For now if we want to use this as package it's better to have different interfaces .
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.
Can you pls put named params, it's easier to understand what are params. Now I see
string string
and dunno what it means.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 think that's what we should do for all the interfaces, starting from here.
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'm not against but in most of our services we are not doing this. Let me open an issue to fix it everywhere
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Maybe it would be better to say
nats.New(cfg.natsURL)
you are making new nats conn from nats package (e.g isolated impl of nats broker) or tomorrowkafka.New(cfg.kafka)
frombroker/kafka
package. Just an ideaAlso I would prefer
messenger
ormsg
or whatever that sounds better thenpubsub.Publish()
for exampleThere 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 agree for
pubsub
, I was never convinced. I simply replaced it byb, err := broker.New(cfg.natsURL)
.I also propose that we think about to use an interface for all brokers or different ones per broker.
In my last commit I replaced
broker/nats/pubsub.go
bybroker/nats.go
. There is no nats package anymore. Eventually I could replacebroker.New
bybroker.NewNats