mmmries / nats.ex_streaming

A NATS Streaming client for Elixir
3 stars 4 forks source link

Durable Subscriptions #2

Open mmmries opened 5 years ago

mmmries commented 5 years ago

@namxam asked in https://github.com/nats-io/nats.ex/issues/91 how to open a durable subscription. I'm not very familiar with nats streaming, so I'm not sure how to answer.

So maybe let's start with what does durability mean here? Do we expect it to survive connection failures and recoveries? Should it survive a restart of the VM?

mmmries commented 5 years ago

Guessing that this refers to the durableName in a subscription request (see docs here). It looks like this isn't available yet in our API, but supporting it would just mean adding a field to the Subscription struct and sending it along with our subscription request.

namxam commented 5 years ago

Yeah, I checked the source code and it should be a quick and easy change. I will have a few more experiments tomorrow and probably submit a pull request if I am going to add the necessary changes. I will have to check how to test it properly though.

mmmries commented 5 years ago

@namxam not sure if it's helpful for the work you're doing, but I just pushed up some additional documentation to the README about the structure of this project.

namxam commented 5 years ago

That sounds awesome. Sorry, I had other issues which were quite pressing. But I will continue with testing your lib. I have added a few features locally but haven't had time to add tests or create PRs

mmmries commented 5 years ago

:+1: sounds good. I'm planning on adding the async publisher stuff during this month. Let me know what you find and I'll do my best to address things as they come up