Class OnapMsgRouterBatchPublisher.Builder
java.lang.Object
io.continual.onap.services.publisher.OnapMsgRouterBatchPublisher.Builder
- Enclosing class:
OnapMsgRouterBatchPublisher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbatchAtMost(int atMost) specify how many messages to hold for a batchbatchMaxAgeMs(int maxAgeMs) specify how long to wait for messages to join a batchbuild()Build the batching publisherlogTo(org.slf4j.Logger log) Specify the log to use.retryAfterMs(int retryWaitMs) specify how long to wait before retrying when the MR call results in an errorSpecify the publisher to use for sends.withMaxPendingCount(int maxPending, OnapMsgRouterBatchPublisher.DropPolicy dropPolicy)
-
Constructor Details
-
Builder
public Builder()Construct a batch publisher builder.
-
-
Method Details
-
usingPublisher
Specify the publisher to use for sends.- Parameters:
pub- a publisher to use for batched sends- Returns:
- this
-
logTo
Specify the log to use. If never called, the default logger, named for this class, is used.- Parameters:
log- the slf4j logger to use for this library. Do not pass null.- Returns:
- this builder
-
batchAtMost
specify how many messages to hold for a batch- Parameters:
atMost- the limit on the number of messages to batch before sending- Returns:
- this
-
batchMaxAgeMs
specify how long to wait for messages to join a batch- Parameters:
maxAgeMs- the limit, in milliseconds, on how long to wait before sending a batch- Returns:
- this
-
withMaxPendingCount
public OnapMsgRouterBatchPublisher.Builder withMaxPendingCount(int maxPending, OnapMsgRouterBatchPublisher.DropPolicy dropPolicy) -
retryAfterMs
specify how long to wait before retrying when the MR call results in an error- Parameters:
retryWaitMs- the time, in millis, to wait before retrying a failed batch send- Returns:
- this
-
build
Build the batching publisher- Returns:
- a batching publisher
-