Class OnapMsgRouterBatchPublisher.Builder
- java.lang.Object
-
- io.continual.onap.services.publisher.OnapMsgRouterBatchPublisher.Builder
-
- Enclosing class:
- OnapMsgRouterBatchPublisher
public static class OnapMsgRouterBatchPublisher.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()Construct a batch publisher builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OnapMsgRouterBatchPublisher.BuilderbatchAtMost(int atMost)specify how many messages to hold for a batchOnapMsgRouterBatchPublisher.BuilderbatchMaxAgeMs(int maxAgeMs)specify how long to wait for messages to join a batchOnapMsgRouterBatchPublisherbuild()Build the batching publisherOnapMsgRouterBatchPublisher.BuilderlogTo(org.slf4j.Logger log)Specify the log to use.OnapMsgRouterBatchPublisher.BuilderretryAfterMs(int retryWaitMs)specify how long to wait before retrying when the MR call results in an errorOnapMsgRouterBatchPublisher.BuilderusingPublisher(OnapMsgRouterPublisher pub)Specify the publisher to use for sends.OnapMsgRouterBatchPublisher.BuilderwithMaxPendingCount(int maxPending, OnapMsgRouterBatchPublisher.DropPolicy dropPolicy)
-
-
-
Method Detail
-
usingPublisher
public OnapMsgRouterBatchPublisher.Builder usingPublisher(OnapMsgRouterPublisher pub)
Specify the publisher to use for sends.- Parameters:
pub- a publisher to use for batched sends- Returns:
- this
-
logTo
public OnapMsgRouterBatchPublisher.Builder logTo(org.slf4j.Logger log)
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
public OnapMsgRouterBatchPublisher.Builder batchAtMost(int atMost)
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
public OnapMsgRouterBatchPublisher.Builder batchMaxAgeMs(int maxAgeMs)
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
public OnapMsgRouterBatchPublisher.Builder retryAfterMs(int retryWaitMs)
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
public OnapMsgRouterBatchPublisher build()
Build the batching publisher- Returns:
- a batching publisher
-
-