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
merged 15 commits into from May 11, 2017

Conversation

Projects
None yet
3 participants
@slashdotdash
Contributor

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

This comment has been minimized.

coveralls commented May 10, 2017

Coverage Status

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

@coveralls

This comment has been minimized.

coveralls commented May 10, 2017

Coverage Status

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

@slashdotdash

This comment has been minimized.

Contributor

slashdotdash commented May 10, 2017

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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+7.8%) to 76.037%
Details
@burmajam

This comment has been minimized.

Member

burmajam commented May 11, 2017

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 slashdotdash:feature/persistent-subscriptions branch May 11, 2017

@slashdotdash

This comment has been minimized.

Contributor

slashdotdash commented May 11, 2017

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