Class ConnectionConfig.Builder
- Enclosing class:
ConnectionConfig
ConnectionConfig instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionblockedTimeout(Duration blockedTimeout) How long a publish waits for a blocked broker to resume before it is refused.build()clientName(String clientName) confirmTimeout(Duration confirmTimeout) connectionTimeout(Duration connectionTimeout) credentials(@Nullable String username, @Nullable String password) maxOutstandingPublishes(int maxOutstandingPublishes) virtualHost(@Nullable String virtualHost) Turns publisher confirms off for the caller's own publishers.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
url
-
credentials
-
virtualHost
-
clientName
- Parameters:
clientName- name the broker shows for this connection, aiding operators
-
connectionTimeout
-
confirmTimeout
-
blockedTimeout
How long a publish waits for a blocked broker to resume before it is refused.Zero by default: while the broker is blocking publishes (a memory or disk alarm), a publish is refused at once with
ConnectionBlockedExceptionand nothing is written. A positive value waits up to that long for the alarm to clear first, which was the default (30 seconds) before 0.7.- Parameters:
blockedTimeout- how long a publish waits for a blocked broker to resume; zero to refuse at once- Returns:
- this builder
-
security
- Parameters:
security- how the connection is protected- Returns:
- this builder
-
withoutPublisherConfirms
Turns publisher confirms off for the caller's own publishers.Named rather than boolean-flagged, because losing messages silently should require saying so out loud: without a confirm a publish is reported as routed whether or not anything received it.
What the library publishes on the caller's behalf is still confirmed and checked for a return — a retry hop, a move to
{queue}.dlqor{queue}.parked, a replay, a pipeline hop, a scheduled delivery, an outbox record, a reply — because each acknowledges a message or marks a record done on the strength of the answer. On RabbitMQ that takes one more channel, in confirm mode, used for nothing else.- Returns:
- this builder
-
maxOutstandingPublishes
- Parameters:
maxOutstandingPublishes- how many asynchronous publishes may await a confirm before publishing blocks; must be at least 1
-
build
-