Class MessageBusParams


  • public class MessageBusParams
    extends java.lang.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 Detail

      • 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 Detail

      • 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​(java.util.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

        public int getMaxPendingSize()
        Returns the maximum number of bytes allowed for pending messages.
        Returns:
        The size limit.
      • setMaxPendingSize

        public MessageBusParams setMaxPendingSize​(int maxSize)
        Sets the maximum number of bytes allowed for pending messages.
        Parameters:
        maxSize - The size limit to set.
        Returns:
        This, to allow chaining.