-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed default behavior of CatchupSubscriptionModel to only replay f…
…rom beginning of time if explicitly specified to do so
- Loading branch information
1 parent
807db4e
commit 9d43565
Showing
6 changed files
with
375 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...iption/src/main/java/org/occurrent/subscription/blocking/durable/catchup/StartAtTime.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* | ||
* Copyright 2024 Johan Haleby | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.occurrent.subscription.blocking.durable.catchup; | ||
|
||
import java.time.OffsetDateTime; | ||
|
||
|
||
/** | ||
* Utility functions for easily specifying start position for the {@link CatchupSubscriptionModel}. | ||
* <p> | ||
* If you're using Kotlin, use the extension functions in {@code org.occurrent.subscription.blocking.durable.catchup.CatchupSubscriptionModelExtensions.kt} file instead. | ||
* </p> | ||
*/ | ||
public class StartAtTime { | ||
public static org.occurrent.subscription.StartAt beginningOfTime() { | ||
return org.occurrent.subscription.StartAt.subscriptionPosition(TimeBasedSubscriptionPosition.beginningOfTime()); | ||
} | ||
|
||
public static org.occurrent.subscription.StartAt offsetDateTime(OffsetDateTime offsetDateTime) { | ||
return org.occurrent.subscription.StartAt.subscriptionPosition(TimeBasedSubscriptionPosition.from(offsetDateTime)); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...org/occurrent/subscription/blocking/durable/catchup/CatchupSubscriptionModelExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* | ||
* Copyright 2024 Johan Haleby | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.occurrent.subscription.blocking.durable.catchup | ||
|
||
import org.occurrent.subscription.StartAt | ||
import java.time.OffsetDateTime | ||
|
||
/** | ||
* Start at beginning of time. | ||
*/ | ||
fun StartAt.beginningOfTime(): StartAt = StartAtTime.beginningOfTime() | ||
|
||
/** | ||
* Start at a specific `offsetDateTime` | ||
*/ | ||
fun StartAt.offsetDateTime(offsetDateTime: OffsetDateTime): StartAt = StartAtTime.offsetDateTime(offsetDateTime) |
Oops, something went wrong.