Skip to content

Commit

Permalink
OffSet storage need the eventProcessorId (#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheleb authored and Tim Moore committed Oct 25, 2017
1 parent 209ce47 commit 74ee2f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/manual/java/guide/cluster/ReadSide.md
Expand Up @@ -68,7 +68,7 @@ Now we need to implement the `buildHandler` method. Let's assume that you have

The `createTables` method will create the tables used by the read side processor if they don't already exist - this is completely optional, but may be useful in development and test environments as it alleviates the need for developers to manually set up their environments.

The `loadOffset` method reads the last [`Offset`](api/index.html?com/lightbend/lagom/javadsl/persistence/Offset.html) that was processed by this read side processor for the particular tag. Typically this will be stored in a table that has the tag name as a primary key. Offsets come in two varieties, a [`Sequence`](api/index.html?com/lightbend/lagom/javadsl/persistence/Offset.Sequence.html) offset represented using a `long`, and a [`TimeBasedUUID`](api/index.html?com/lightbend/lagom/javadsl/persistence/Offset.TimeBasedUUID.html) offset represented using a `UUID`. Your database will need to be able to persist both of these types. If there is no offset stored for a particular tag, such as when the processor runs for the very first time, then you can return [`Offset.NONE`](api/index.html?com/lightbend/lagom/javadsl/persistence/Offset.html#NONE).
The `loadOffset` method reads the last [`Offset`](api/index.html?com/lightbend/lagom/javadsl/persistence/Offset.html) that was processed by this read side processor for the particular tag. Typically this will be stored in a table that has the tag name and the eventProcessorId as a compound primary key. Offsets come in two varieties, a [`Sequence`](api/index.html?com/lightbend/lagom/javadsl/persistence/Offset.Sequence.html) offset represented using a `long`, and a [`TimeBasedUUID`](api/index.html?com/lightbend/lagom/javadsl/persistence/Offset.TimeBasedUUID.html) offset represented using a `UUID`. Your database will need to be able to persist both of these types. If there is no offset stored for a particular tag, such as when the processor runs for the very first time, then you can return [`Offset.NONE`](api/index.html?com/lightbend/lagom/javadsl/persistence/Offset.html#NONE).

Finally, the `handleEvent` method is responsible for handling the actual events. It gets passed both the event and the offset, and should persist the offset once the event handling is successful.

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/scala/guide/cluster/ReadSide.md
Expand Up @@ -68,7 +68,7 @@ Now we need to implement the `buildHandler` method. Let's assume that you have

The `createTables` method will create the tables used by the read side processor if they don't already exist - this is completely optional, but may be useful in development and test environments as it alleviates the need for developers to manually set up their environments.

The `loadOffset` method reads the last `Offset` that was processed by this read side processor for the particular tag. Typically this will be stored in a table that has the tag name as a primary key. Offsets come in two varieties, a `akka.persistence.query.Sequence` offset represented using a `long`, and a `akka.persistence.query.TimeBasedUUID` offset represented using a `UUID`. Your database will need to be able to persist both of these types. If there is no offset stored for a particular tag, such as when the processor runs for the very first time, then you can return `akka.persistence.query.NoOffset`.
The `loadOffset` method reads the last `Offset` that was processed by this read side processor for the particular tag. Typically this will be stored in a table that has the tag name and the eventProcessorId as a compound primary key. Offsets come in two varieties, a `akka.persistence.query.Sequence` offset represented using a `long`, and a `akka.persistence.query.TimeBasedUUID` offset represented using a `UUID`. Your database will need to be able to persist both of these types. If there is no offset stored for a particular tag, such as when the processor runs for the very first time, then you can return `akka.persistence.query.NoOffset`.

Finally, the `handleEvent` method is responsible for handling the actual events. It gets passed both the event and the offset, and should persist the offset once the event handling is successful.

Expand Down

0 comments on commit 74ee2f0

Please sign in to comment.