Class MessageBusParams

java.lang.Object
com.yahoo.messagebus.MessageBusParams

public class MessageBusParams extends Object
To facilitate several configuration parameters to the MessageBus constructor, all parameters are held by this class. This class has reasonable default values for each parameter.
Author:
Simon Thoresen Hult
  • Constructor Details

    • MessageBusParams

      public MessageBusParams()
      Constructs a new instance of this parameter object with default values for all members.
    • MessageBusParams

      public MessageBusParams(MessageBusParams params)
      Implements the copy constructor.
      Parameters:
      params - The object to copy.
  • Method Details

    • getRetryPolicy

      public RetryPolicy getRetryPolicy()
      Returns the retry policy for the resender.
      Returns:
      The policy.
    • setRetryPolicy

      public MessageBusParams setRetryPolicy(RetryPolicy retryPolicy)
      Sets the retry policy for the resender.
      Parameters:
      retryPolicy - The policy to set.
      Returns:
      This, to allow chaining.
    • addProtocol

      public MessageBusParams addProtocol(Protocol protocol)
      Adds a new protocol to this.
      Parameters:
      protocol - The protocol to add.
      Returns:
      This, to allow chaining.
    • addProtocols

      public MessageBusParams addProtocols(List<Protocol> protocols)
      Registers multiple protocols with this by calling addProtocol(Protocol) multiple times.
      Parameters:
      protocols - The protocols to register.
      Returns:
      This, to allow chaining.
    • getNumProtocols

      public int getNumProtocols()
      Returns the number of protocols that are contained in this.
      Returns:
      The number of protocols.
    • getProtocol

      public Protocol getProtocol(int i)
      Returns the protocol at the given index.
      Parameters:
      i - The index of the protocol to return.
      Returns:
      The protocol object.
    • getMaxPendingCount

      public int getMaxPendingCount()
      Returns the maximum number of pending messages.
      Returns:
      The count limit.
    • setMaxPendingCount

      public MessageBusParams setMaxPendingCount(int maxCount)
      Sets the maximum number of allowed pending messages.
      Parameters:
      maxCount - The count limit to set.
      Returns:
      This, to allow chaining.
    • getMaxPendingSize

      @Deprecated(forRemoval=true) public int getMaxPendingSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the maximum number of bytes allowed for pending messages.
      Returns:
      The size limit.
    • setMaxPendingSize

      @Deprecated(forRemoval=true) public MessageBusParams setMaxPendingSize(int maxSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the maximum number of bytes allowed for pending messages.
      Parameters:
      maxSize - The size limit to set.
      Returns:
      This, to allow chaining.
    • getMessageBusConfig

      public MessagebusConfig getMessageBusConfig()
    • setMessageBusConfig

      public MessageBusParams setMessageBusConfig(MessagebusConfig config)