-
Notifications
You must be signed in to change notification settings - Fork 481
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
Add ability to bind to NATS JetStream by stream name. #2161
Comments
Could you give an example of what the Dapr service code might look like? Eg, would the Dapr @app.subscribe(pubsub_name='order-pub-sub', topic='orders')
def mytopic(event: v1.Event) -> None:
data = json.loads(event.Data())
logging.info('Subscriber received: ' + str(data)) Or do you mean the handlers would still discriminate on topic name, but the Edit: I went back and looked at a comment you left me in #2145. So the topic name would be empty in the handler/subscriber code. This might cause some confusion if it must be empty. It could still be handy allowing additional filtering. Sorry if this is off topic here, just brainstorming: So, for example, imagine a And you have a Durable Consumer with Queue Group (so you don't miss messages when the app is down, and only one replica processes each message). This consumer will be used by multiple handlers, each doing their own bit of work. You also might still want some sort of order (eg: user has to be added before changing the profile picture or something). So it could look something like: @app.subscribe(pubsub_name='users-pub-sub', topic='users.new')
def new_customer(event: v1.Event) -> None:
data = json.loads(event.Data())
logging.info('New user: ' + str(data))
@app.subscribe(pubsub_name='users-pub-sub', topic='customers.profile.image')
def new_customer(event: v1.Event) -> None:
data = json.loads(event.Data())
logging.info('Customer set or updated their profile picture: ' + str(data)) Would that still work? Two different topics (or filters?) from one stream, via one consumer? Or would it still need two separate consumers? |
I was rather thinking of adding a new option to the |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions. |
@Jarema will you be working on this? |
So that was solved in #2244 right? |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions. |
Describe the feature
Currently, users of DAPR binding can subscribe to a stream only by looking up stream by matching subject.
I would like to add a config option to lookup stream by its name and then using it when calling
Subscribe
.This is often simpler and more explicit and will additionaly allow fixing #2145 when user do not pass additional filter subject to the Consumer.
Let me know if you're ok with such approach, then I'll proceed with implementation.
Release Note
RELEASE NOTE:
The text was updated successfully, but these errors were encountered: