Class MessageConsumerOptions
java.lang.Object
io.vertx.core.eventbus.MessageConsumerOptions
Options configuring the behavior of a event-bus message consumer.
- Author:
- Julien Viet
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default consumer locality =falsestatic final intThe default number of max buffered messages =1000static final TracingPolicyThe default consumer locality =false -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleansetAddress(String address) Set the address the event-bus will register the consumer at.setLocalOnly(boolean localOnly) Set whether the consumer is local only.setMaxBufferedMessages(int maxBufferedMessages) Set the number of messages this registration will buffer when this stream is paused.setTracingPolicy(TracingPolicy tracingPolicy) Set the tracing policy for the consumer behavior when Vert.x has tracing enabled.toJson()
-
Field Details
-
DEFAULT_MAX_BUFFERED_MESSAGES
public static final int DEFAULT_MAX_BUFFERED_MESSAGESThe default number of max buffered messages =1000- See Also:
-
DEFAULT_LOCAL_ONLY
public static final boolean DEFAULT_LOCAL_ONLYThe default consumer locality =false- See Also:
-
DEFAULT_TRACING_POLICY
The default consumer locality =false
-
-
Constructor Details
-
MessageConsumerOptions
public MessageConsumerOptions()Default constructor -
MessageConsumerOptions
Copy constructor- Parameters:
other- The otherVertxOptionsto copy when creating this
-
MessageConsumerOptions
Create an instance from aJsonObject- Parameters:
json- the JsonObject to create it from
-
-
Method Details
-
getAddress
- Returns:
- the address the event-bus will register the consumer at
-
setAddress
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
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
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
-
getTracingPolicy
- Returns:
- the tracing policy
-
setTracingPolicy
Set the tracing policy for the consumer behavior when Vert.x has tracing enabled.- Parameters:
tracingPolicy- the tracing policy- Returns:
- a reference to this, so the API can be used fluently
-
toJson
-