Class OnapMsgRouterBatchPublisher.Builder

java.lang.Object
io.continual.onap.services.publisher.OnapMsgRouterBatchPublisher.Builder
Enclosing class:
OnapMsgRouterBatchPublisher

public static class OnapMsgRouterBatchPublisher.Builder extends Object
  • 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

      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

      Build the batching publisher
      Returns:
      a batching publisher