Skip to content

Commit cce341d

Browse files
author
Alvaro Videla
committed
replaces randomRKey for randomRoutingKey
1 parent af85acf commit cce341d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

test/src/com/rabbitmq/examples/PerfTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static void main(String[] args) {
4949
String exchangeName = strArg(cmd, 'e', exchangeType);
5050
String queueName = strArg(cmd, 'u', "");
5151
String routingKey = strArg(cmd, 'k', null);
52-
boolean randomRKey = cmd.hasOption('K');
52+
boolean randomRoutingKey = cmd.hasOption('K');
5353
int samplingInterval = intArg(cmd, 'i', 1);
5454
float producerRateLimit = floatArg(cmd, 'r', 0.0f);
5555
float consumerRateLimit = floatArg(cmd, 'R', 0.0f);
@@ -108,7 +108,7 @@ public static void main(String[] args) {
108108
p.setProducerTxSize( producerTxSize);
109109
p.setQueueName( queueName);
110110
p.setRoutingKey( routingKey);
111-
p.setRandomRKey( randomRKey);
111+
p.setRandomRoutingKey( randomRoutingKey);
112112
p.setProducerRateLimit(producerRateLimit);
113113
p.setTimeLimit( timeLimit);
114114

@@ -140,7 +140,7 @@ private static Options getOptions() {
140140
options.addOption(new Option("e", "exchange", true, "exchange name"));
141141
options.addOption(new Option("u", "queue", true, "queue name"));
142142
options.addOption(new Option("k", "routingKey", true, "routing key"));
143-
options.addOption(new Option("K", "randomRKey", false,"use random routing key per message"));
143+
options.addOption(new Option("K", "randomRoutingKey", false,"use random routing key per message"));
144144
options.addOption(new Option("i", "interval", true, "sampling interval"));
145145
options.addOption(new Option("r", "rate", true, "producer rate limit"));
146146
options.addOption(new Option("R", "consumerRate", true, "consumer rate limit"));

test/src/com/rabbitmq/examples/perf/MulticastParams.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class MulticastParams {
4545
private String exchangeType = "direct";
4646
private String queueName = "";
4747
private String routingKey = null;
48-
private boolean randomRKey = false;
48+
private boolean randomRoutingKey = false;
4949

5050
private List<?> flags = new ArrayList<Object>();
5151

@@ -71,8 +71,8 @@ public void setRoutingKey(String routingKey) {
7171
this.routingKey = routingKey;
7272
}
7373

74-
public void setRandomRKey(boolean randomRKey) {
75-
this.randomRKey = randomRKey;
74+
public void setRandomRoutingKey(boolean randomRoutingKey) {
75+
this.randomRoutingKey = randomRoutingKey;
7676
}
7777

7878
public void setProducerRateLimit(float producerRateLimit) {
@@ -168,8 +168,8 @@ public String getRoutingKey() {
168168
return routingKey;
169169
}
170170

171-
public boolean getRandomRKey() {
172-
return randomRKey;
171+
public boolean getRandomRoutingKey() {
172+
return randomRoutingKey;
173173
}
174174

175175
public Producer createProducer(Connection connection, Stats stats, String id) throws IOException {
@@ -180,7 +180,7 @@ public Producer createProducer(Connection connection, Stats stats, String id) th
180180
channel.exchangeDeclare(exchangeName, exchangeType);
181181
}
182182
final Producer producer = new Producer(channel, exchangeName, id,
183-
randomRKey, flags, producerTxSize,
183+
randomRoutingKey, flags, producerTxSize,
184184
producerRateLimit, producerMsgCount,
185185
minMsgSize, timeLimit,
186186
confirm, stats);

test/src/com/rabbitmq/examples/perf/Producer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class Producer extends ProducerConsumerBase implements Runnable, ReturnLi
3838
private Channel channel;
3939
private String exchangeName;
4040
private String id;
41-
private boolean randomRKey;
41+
private boolean randomRoutingKey;
4242
private boolean mandatory;
4343
private boolean immediate;
4444
private boolean persistent;
@@ -54,7 +54,7 @@ public class Producer extends ProducerConsumerBase implements Runnable, ReturnLi
5454
private volatile SortedSet<Long> unconfirmedSet =
5555
Collections.synchronizedSortedSet(new TreeSet<Long>());
5656

57-
public Producer(Channel channel, String exchangeName, String id, boolean randomRKey,
57+
public Producer(Channel channel, String exchangeName, String id, boolean randomRoutingKey,
5858
List<?> flags, int txSize,
5959
float rateLimit, int msgLimit, int minMsgSize, int timeLimit,
6060
long confirm, Stats stats)
@@ -63,7 +63,7 @@ public Producer(Channel channel, String exchangeName, String id, boolean randomR
6363
this.channel = channel;
6464
this.exchangeName = exchangeName;
6565
this.id = id;
66-
this.randomRKey = randomRKey;
66+
this.randomRoutingKey = randomRoutingKey;
6767
this.mandatory = flags.contains("mandatory");
6868
this.immediate = flags.contains("immediate");
6969
this.persistent = flags.contains("persistent");
@@ -159,7 +159,7 @@ private void publish(byte[] msg)
159159
throws IOException {
160160

161161
unconfirmedSet.add(channel.getNextPublishSeqNo());
162-
channel.basicPublish(exchangeName, randomRKey ? UUID.randomUUID().toString() : id,
162+
channel.basicPublish(exchangeName, randomRoutingKey ? UUID.randomUUID().toString() : id,
163163
mandatory, immediate,
164164
persistent ? MessageProperties.MINIMAL_PERSISTENT_BASIC : MessageProperties.MINIMAL_BASIC,
165165
msg);

0 commit comments

Comments
 (0)