Skip to content

Commit 55071c0

Browse files
committed
Rename RpcClientParams#isUseMandatory to shouldUseMandatory
[#161476914] Fixes #417 (cherry picked from commit 7f89b26)
1 parent 034a6af commit 55071c0

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

src/main/java/com/rabbitmq/client/RpcClient.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public RpcClient(RpcClientParams params) throws
107107
throw new IllegalArgumentException("Timeout argument must be NO_TIMEOUT(-1) or non-negative.");
108108
}
109109
_timeout = params.getTimeout();
110-
_useMandatory = params.isUseMandatory();
110+
_useMandatory = params.shouldUseMandatory();
111111
_replyHandler = params.getReplyHandler();
112112
_correlationId = 0;
113113

@@ -145,17 +145,11 @@ public RpcClient(RpcClientParams params) throws
145145
@Deprecated
146146
public RpcClient(Channel channel, String exchange, String routingKey, String replyTo, int timeout) throws
147147
IOException {
148-
_channel = channel;
149-
_exchange = exchange;
150-
_routingKey = routingKey;
151-
_replyTo = replyTo;
152-
if (timeout < NO_TIMEOUT) throw new IllegalArgumentException("Timeout argument must be NO_TIMEOUT(-1) or non-negative.");
153-
_timeout = timeout;
154-
_useMandatory = false;
155-
_replyHandler = DEFAULT_REPLY_HANDLER;
156-
_correlationId = 0;
157-
158-
_consumer = setupConsumer();
148+
this(new RpcClientParams()
149+
.channel(channel).exchange(exchange).routingKey(routingKey)
150+
.replyTo(replyTo).timeout(timeout)
151+
.useMandatory(false)
152+
);
159153
}
160154

161155
/**

src/main/java/com/rabbitmq/client/RpcClientParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public RpcClientParams useMandatory() {
166166
return useMandatory(true);
167167
}
168168

169-
public boolean isUseMandatory() {
169+
public boolean shouldUseMandatory() {
170170
return useMandatory;
171171
}
172172

0 commit comments

Comments
 (0)