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

Renamed "PositionAwareSubscriptionModel" to NonDurableSubscriptionModel? #105

Open
johanhaleby opened this issue Oct 5, 2021 · 0 comments

Comments

@johanhaleby
Copy link
Owner

johanhaleby commented Oct 5, 2021

Maybe that would be more intuitive than PositionAwareSubscriptionModel? So instead of:

// Create the non-durable subscription instance 
PositionAwareSubscriptionModel nonDurableSubscriptionModel = ...
// Create the storage
SubscriptionPositionStorage storage = ...

// Now combine the non-durable subscription and the subscription position storage
SubscriptionModel durableSubscriptionModel = 
                  new DurableSubscriptionModel(nonDurableSubscriptionModel, storage);

// Start a subscription
durableSubscriptionModel.subscribe(
                         "mySubscriptionId", 
                         cloudEvent -> doSomethingWithTheCloudEvent(cloudEvent)
); 

we would have:

// Create the non-durable subscription instance 
NonDurableSubscriptionModel nonDurableSubscriptionModel = ...
// Create the storage
SubscriptionPositionStorage storage = ...

// Now combine the non-durable subscription and the subscription position storage
SubscriptionModel durableSubscriptionModel = 
                  new DurableSubscriptionModel(nonDurableSubscriptionModel, storage);

// Start a subscription
durableSubscriptionModel.subscribe(
                         "mySubscriptionId", 
                         cloudEvent -> doSomethingWithTheCloudEvent(cloudEvent)
); 

Alternatlivey: TransientSubscriptionModel.

Think about how we would support some DB that holds the checkpoint as a part of the user? Then it is a DurableSubscriptionModel, but it can't use the same class (but we could create an interface though) since it takes an instead of SubscriptionPositionStorage.

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

No branches or pull requests

1 participant