Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Support consumer state that isn't an integer #32

Open
stanlemon opened this issue Oct 24, 2017 · 1 comment
Open

Support consumer state that isn't an integer #32

stanlemon opened this issue Oct 24, 2017 · 1 comment
Milestone

Comments

@stanlemon
Copy link
Contributor

Right now the PersistenceAdapter interface declares these two methods for interacting with offsets:

    void persistConsumerState(final String consumerId, final int partitionId, final long offset);

    Long retrieveConsumerState(final String consumerId, final int partitionId);

We made the assumption that an offset, or rather the state of the consumer, is always an integer, but as we're finding in other projects this doesn't always hold true.

To support more complex state tracking we need to make a shift here.

State is still going to need an offset for offset tracking, but I'm not starting to wonder if we need to create our own offset for the purposes of things like the PartitionOffsetManager. Basically, we could increment things coming off of the spout instance and track that as an ordered offset, but persist more complex data. Or maybe we leave this up to the specific consumer to implement if they're using a non-numeric piece of state.

I'm spit-balling here, but fundamentally we need to at least support a string for consumer state - probably should just consider a bag of bytes or something.

Let's come up with a design and figure out how to refactor the necessary parts of the framework for 0.10 milestone.

@stanlemon stanlemon added this to the 0.10.0 milestone Oct 24, 2017
@Crim
Copy link
Contributor

Crim commented Oct 24, 2017

sounds like a solid idea.

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

No branches or pull requests

2 participants