generated from telekom/reuse-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from telekom/feature/control-stream-termination
Feature/control stream termination
- Loading branch information
Showing
14 changed files
with
360 additions
and
45 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
11 changes: 11 additions & 0 deletions
11
src/main/java/de/telekom/horizon/pulsar/exception/StreamLimitExceededException.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,11 @@ | ||
// Copyright 2024 Deutsche Telekom IT GmbH | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package de.telekom.horizon.pulsar.exception; | ||
|
||
public class StreamLimitExceededException extends HorizonPulsarException { | ||
public StreamLimitExceededException() { | ||
super(); | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
src/main/java/de/telekom/horizon/pulsar/helper/StreamLimit.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,33 @@ | ||
// Copyright 2024 Deutsche Telekom IT GmbH | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package de.telekom.horizon.pulsar.helper; | ||
|
||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
/** | ||
* Class that contains any streaming limits provided by the customer. | ||
* | ||
* This class encapsulates all possible streaming limits that have been provided by the customer when | ||
* requesting a new stream. The streaming limits will ensure that a active stream terminates early on when exceeded. | ||
* Currently, a customer can specify that the stream should terminate when a specific number of events have been consumed | ||
* or after a certain time (in minutes) or after exceeding a certain number of bytes which have been consumed. | ||
*/ | ||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class StreamLimit { | ||
private int maxNumber; | ||
private int maxMinutes; | ||
private long maxBytes; | ||
|
||
public static StreamLimit of(int maxNumber, int maxMinutes, int maxBytes) { | ||
return new StreamLimit(maxNumber, maxMinutes, maxBytes); | ||
} | ||
} |
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
Oops, something went wrong.