@@ -68,10 +68,10 @@ public static void main(String[] args) {
68
68
final String hostName = optArg (args , 0 , "localhost" );
69
69
final int portNumber = optArg (args , 1 , AMQP .PROTOCOL .PORT );
70
70
boolean writeStats = optArg (args , 2 , true );
71
- boolean noAck = optArg (args , 3 , true );
71
+ boolean autoAck = optArg (args , 3 , true );
72
72
final Connection conn = new ConnectionFactory (){{setHost (hostName ); setPort (portNumber );}}.newConnection ();
73
73
System .out .println ("Channel 0 fully open." );
74
- new ConsumerMain (conn , writeStats , noAck ).run ();
74
+ new ConsumerMain (conn , writeStats , autoAck ).run ();
75
75
} catch (Exception e ) {
76
76
System .err .println ("Main thread caught exception: " + e );
77
77
e .printStackTrace ();
@@ -91,14 +91,14 @@ public static void sleep(int ms) {
91
91
92
92
public boolean _writeStats ;
93
93
94
- public boolean _noAck ;
94
+ public boolean _autoAck ;
95
95
96
- public ConsumerMain (Connection connection , boolean writeStats , boolean noAck ) {
96
+ public ConsumerMain (Connection connection , boolean writeStats , boolean autoAck ) {
97
97
_connection = connection ;
98
98
_writeStats = writeStats ;
99
- _noAck = noAck ;
99
+ _autoAck = autoAck ;
100
100
System .out .println ((_writeStats ? "WILL" : "WON'T" ) + " write statistics." );
101
- System .out .println ((_noAck ? "WILL" : "WON'T" ) + " use server-side auto-acking." );
101
+ System .out .println ((_autoAck ? "WILL" : "WON'T" ) + " use server-side auto-acking." );
102
102
}
103
103
104
104
public void run () {
@@ -124,9 +124,9 @@ private void runIt() throws IOException {
124
124
channel .queueBind (completionQueue , exchangeName , "" );
125
125
126
126
LatencyExperimentConsumer callback = new LatencyExperimentConsumer (channel , queueName );
127
- callback ._noAck = this ._noAck ;
127
+ callback ._autoAck = this ._autoAck ;
128
128
129
- channel .basicConsume (queueName , _noAck , callback );
129
+ channel .basicConsume (queueName , _autoAck , callback );
130
130
channel .basicConsume (completionQueue , true , "completion" , callback );
131
131
callback .report (_writeStats );
132
132
@@ -165,7 +165,7 @@ public static class LatencyExperimentConsumer extends DefaultConsumer {
165
165
166
166
public long _nextSummaryTime ;
167
167
168
- public boolean _noAck = true ;
168
+ public boolean _autoAck = true ;
169
169
170
170
public LatencyExperimentConsumer (Channel ch , String queueName ) {
171
171
super (ch );
@@ -277,7 +277,7 @@ public void report(boolean writeStats) throws IOException {
277
277
if (msgStartTime != -1 ) {
278
278
_deltas [_received ++] = now - msgStartTime ;
279
279
280
- if (!_noAck && ((_received % ACK_BATCH_SIZE ) == 0 )) {
280
+ if (!_autoAck && ((_received % ACK_BATCH_SIZE ) == 0 )) {
281
281
getChannel ().basicAck (0 , true );
282
282
}
283
283
}
@@ -293,7 +293,7 @@ public void report(boolean writeStats) throws IOException {
293
293
}
294
294
295
295
public void finish () throws IOException {
296
- if (!_noAck )
296
+ if (!_autoAck )
297
297
getChannel ().basicAck (0 , true );
298
298
_blocker .setIfUnset (new Object ());
299
299
}
0 commit comments