Skip to content
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

Persistent subscriptions #38

Merged

Conversation

slashdotdash
Copy link
Contributor

@slashdotdash slashdotdash commented May 10, 2017

Event Store provides an alternate event subscription model, from version 3.2.0, known as competing consumers. Instead of the client holding the state of the subscription, the server remembers it.

This pull request adds support for creating a new persistent connection and connecting a subscriber to a persistent connection. Additional unit tests have been included to demonstrate and verify these new features.

Each persistent subscription runs as a separate GenServer process, Extreme.PersistentSubscription, and creates its own connection to the Event Store. This is due to the way that the Event Store tracks active consumers for a persistent subscription by connection. It is not possible to reuse a single connection to reconnect to a subscription if the subscriber process terminates. The connection must close to notify the Event Store that the consumer is dead. Then it will allow a new connection to the subscription.

It includes a breaking change. The module Extreme.Messages has been renamed to Extreme.Msg. This is due to the persistent connection messages in the Protocol Buffers definition creating an Elixir module name that exceeds the 100 character limit support for creating Erlang releases.

I have incremented the mix release version to 0.9.0.

@coveralls
Copy link

Coverage Status

Coverage increased (+7.8%) to 76.037% when pulling 71d71b8 on slashdotdash:feature/persistent-subscriptions into eba217c on exponentially:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+7.8%) to 76.037% when pulling 71d71b8 on slashdotdash:feature/persistent-subscriptions into eba217c on exponentially:master.

@slashdotdash
Copy link
Contributor Author

Please add any feedback for this pull request. I tried to follow the existing coding style & conventions.

@burmajam burmajam merged commit 71d71b8 into exponentially:master May 11, 2017
@burmajam
Copy link
Member

Great job @slashdotdash, we appreciate it! I don't like the fact that new Extreme connection needs to be started for persistent subscription but I understand that's up to EventStore itself.

@slashdotdash slashdotdash deleted the feature/persistent-subscriptions branch May 11, 2017 12:05
@slashdotdash
Copy link
Contributor Author

Thanks for merging this. Yes, the connection per persistent subscription is a due to how the Event Store tracks active consumers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants