Class MessageConsumerOptions

java.lang.Object
io.vertx.core.eventbus.MessageConsumerOptions

public class MessageConsumerOptions extends Object
Options configuring the behavior of a event-bus message consumer.
Author:
Julien Viet
  • Field Details

    • DEFAULT_MAX_BUFFERED_MESSAGES

      public static final int DEFAULT_MAX_BUFFERED_MESSAGES
      The default number of max buffered messages = 1000
      See Also:
    • DEFAULT_LOCAL_ONLY

      public static final boolean DEFAULT_LOCAL_ONLY
      The default consumer locality = false
      See Also:
  • Constructor Details

    • MessageConsumerOptions

      public MessageConsumerOptions()
      Default constructor
    • MessageConsumerOptions

      public MessageConsumerOptions(MessageConsumerOptions other)
      Copy constructor
      Parameters:
      other - The other VertxOptions to copy when creating this
    • MessageConsumerOptions

      public MessageConsumerOptions(JsonObject json)
      Create an instance from a JsonObject
      Parameters:
      json - the JsonObject to create it from
  • Method Details

    • getAddress

      public String getAddress()
      Returns:
      the address the event-bus will register the consumer at
    • setAddress

      public MessageConsumerOptions setAddress(String address)
      Set the address the event-bus will register the consumer at.
      Parameters:
      address - the consumer address
      Returns:
      this options
    • isLocalOnly

      public boolean isLocalOnly()
      Returns:
      whether the consumer is local only
    • setLocalOnly

      public MessageConsumerOptions setLocalOnly(boolean localOnly)
      Set whether the consumer is local only.
      Parameters:
      localOnly - whether the consumer is local only
      Returns:
      this options
    • getMaxBufferedMessages

      public int getMaxBufferedMessages()
      Returns:
      the maximum number of messages that can be buffered when this stream is paused
    • setMaxBufferedMessages

      public MessageConsumerOptions setMaxBufferedMessages(int maxBufferedMessages)
      Set the number of messages this registration will buffer when this stream is paused. The default value is 1000.

      When a new value is set, buffered messages may be discarded to reach the new value. The most recent messages will be kept.

      Parameters:
      maxBufferedMessages - the maximum number of messages that can be buffered
      Returns:
      this options
    • toJson

      public JsonObject toJson()