Comments (6)
@piotrpio I commented on the PR as well, but for our purpose, sometimes we hand messages around multiple services or handlers before responding to a client, and need to be able to pass the reply subject to the down-line code. Easy to do with nats.Msg
, but not micro
.
from nats.go.
@mcosta74, @themartorana Sorry it took so long and thank you for the patience. We discussed it internally and agreed that we will not consider adding public methods to interfaces a breaking change for the client. We have done it in the past with JetStreamContext
so we can do the same for micro
. I've created a PR adding a note about that to readme to make it official.
I'll review your PR in a moment, on first glance it looks simple and straightforward enough 😉
from nats.go.
Hey @mcosta74. It's a good idea to add the ability to check reply subject, but I'm not sure about introducing a new interface... That would force us to also add v2 of Handler
interface, along with Handle
method and HandlerFunc
.
Another idea would be to add a RespondOpt
which would allow skipping sending the response if reply
is empty, but that's not ideal as well since you'd not know whether the response was sent or not.
from nats.go.
Hi @piotrpio , my need is to know if I need to prepare/Marshall the response or I can skip it because there isn't a Reply.
So your 2nd option doesn't fit what I'm looking for.
from nats.go.
That would force us to also add v2 of Handler interface, along with Handle method and HandlerFunc.
As I said, I'll be happy to implement the change of the proposal is accepted
from nats.go.
@piotrpio Can I just add a Reply()
method to the Request
interface? Is adding a new method the the interface considered a breaking change ?
from nats.go.
Related Issues (20)
- [BUG] If the subject is very long, the connection will be broken
- undefined: errors.Join HOT 2
- SubscribeSync should return error on permissions violation HOT 3
- jetstream.Consumer.Consume() does not respect ConsumerConfig HOT 1
- Fetch in the JetStream Simplified Client should behave similar to the old API. HOT 5
- jetstream.CreateOrUpdateKeyValue doesn't handle the Domain property of jetstream.ExternalStream correctly when mirroring HOT 1
- jetStreamContext.PublishMsg memory consumption grow over time if nats server fail or restart HOT 1
- Jetstream "context deadline exceeded" HOT 3
- `KeyValue.Watch()` blocks forever for certain values of the `keys` parameter HOT 5
- Listing an Object Store after deleting all objects inside it hangs HOT 3
- JetStream: the value for max pending async messages can be exceeded
- Cannot unsubscribe after panic, alloc lots of memory when startup HOT 8
- kv is created with OLD discard policy using jetstream pkg while with nats pkg it gets NEW HOT 1
- How to retrieve the status of a consumer. HOT 6
- I often get the error `nats: no heartbeat received`
- I often get the error nats: no heartbeat received HOT 19
- Request Reply for JetStream for autoscaling and scaling to zero (similar to Knative) HOT 1
- Panic when creating jet stream consumer on wildcard stream HOT 8
- Add checks for empty response in JetStream API calls HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nats.go.