-
Notifications
You must be signed in to change notification settings - Fork 705
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
[EXPERIMENTAL] Service framework #1111
Conversation
Signed-off-by: Derek Collison <[email protected]>
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.
LGTM - Minor question
service.go
Outdated
info := fmt.Sprintf("%s.INFO", subject) | ||
svc.infoSub, err = nc.QueueSubscribe(info, QG, func(m *Msg) { | ||
si := &ServiceInfo{ | ||
Name: svc.name, |
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.
Should we have the subject you can send requests to 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.
it is part of the configuration for the service - part of the Endpoint struct - the reason for the indirection is that if when we support JetStream this will be a different kind of Endpoint.
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.
But I think an info request from a NATS cli or random app should get the subject back from this call as well.
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.
Ah! - that we can easily do 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.
Fixed!
service.go
Outdated
Id string `json:"id"` | ||
Description string `json:"description"` | ||
Version string `json:"version"` | ||
Subject string `json:"subject"` |
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.
fixed!
LGTM!
…On Thu, Oct 20, 2022 at 7:12 AM Alberto Ricart ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In service.go
<#1111 (comment)>:
> + NumRequests int `json:"numRequests"`
+ NumErrors int `json:"numErrors"`
+ TotalLatency time.Duration `json:"totalLatency"`
+ Data interface{} `json:"data"`
+}
+
+// We can fix this, as versions will be on separate subjects and use account mapping to roll requests to new versions etc.
+const QG = "svc"
+
+// ServiceInfo is the basic information about a service type
+type ServiceInfo struct {
+ Name string `json:"name"`
+ Id string `json:"id"`
+ Description string `json:"description"`
+ Version string `json:"version"`
+ Subject string `json:"subject"`
fixed!
—
Reply to this email directly, view it on GitHub
<#1111 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAV74MUXYJGW2WSGEF2UHTWEFHOTANCNFSM6AAAAAARJRYOFU>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
73b1a1f
to
8f9a687
Compare
8f9a687
to
a49531e
Compare
This is just a wip for the go version - need to do another pass
The javascript one can be found here nats-io/nats.deno#383