Package io.vertx.core.eventbus
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 Summary
Fields Modifier and Type Field Description static booleanDEFAULT_LOCAL_ONLYThe default consumer locality =falsestatic intDEFAULT_MAX_BUFFERED_MESSAGESThe default number of max buffered messages =1000
-
Constructor Summary
Constructors Constructor Description MessageConsumerOptions()Default constructorMessageConsumerOptions(MessageConsumerOptions other)Copy constructorMessageConsumerOptions(JsonObject json)Create an instance from aJsonObject
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAddress()intgetMaxBufferedMessages()booleanisLocalOnly()MessageConsumerOptionssetAddress(String address)Set the address the event-bus will register the consumer at.MessageConsumerOptionssetLocalOnly(boolean localOnly)Set whether the consumer is local only.MessageConsumerOptionssetMaxBufferedMessages(int maxBufferedMessages)Set the number of messages this registration will buffer when this stream is paused.JsonObjecttoJson()
-
-
-
Field Detail
-
DEFAULT_MAX_BUFFERED_MESSAGES
public static final int DEFAULT_MAX_BUFFERED_MESSAGES
The default number of max buffered messages =1000- See Also:
- Constant Field Values
-
DEFAULT_LOCAL_ONLY
public static final boolean DEFAULT_LOCAL_ONLY
The default consumer locality =false- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MessageConsumerOptions
public MessageConsumerOptions()
Default constructor
-
MessageConsumerOptions
public MessageConsumerOptions(MessageConsumerOptions other)
Copy constructor- Parameters:
other- The otherVertxOptionsto copy when creating this
-
MessageConsumerOptions
public MessageConsumerOptions(JsonObject json)
Create an instance from aJsonObject- Parameters:
json- the JsonObject to create it from
-
-
Method Detail
-
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 is1000.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()
-
-