@@ -68,10 +68,10 @@ public static void main(String[] args) {
6868 final String hostName = optArg (args , 0 , "localhost" );
6969 final int portNumber = optArg (args , 1 , AMQP .PROTOCOL .PORT );
7070 boolean writeStats = optArg (args , 2 , true );
71- boolean noAck = optArg (args , 3 , true );
71+ boolean autoAck = optArg (args , 3 , true );
7272 final Connection conn = new ConnectionFactory (){{setHost (hostName ); setPort (portNumber );}}.newConnection ();
7373 System .out .println ("Channel 0 fully open." );
74- new ConsumerMain (conn , writeStats , noAck ).run ();
74+ new ConsumerMain (conn , writeStats , autoAck ).run ();
7575 } catch (Exception e ) {
7676 System .err .println ("Main thread caught exception: " + e );
7777 e .printStackTrace ();
@@ -91,14 +91,14 @@ public static void sleep(int ms) {
9191
9292 public boolean _writeStats ;
9393
94- public boolean _noAck ;
94+ public boolean _autoAck ;
9595
96- public ConsumerMain (Connection connection , boolean writeStats , boolean noAck ) {
96+ public ConsumerMain (Connection connection , boolean writeStats , boolean autoAck ) {
9797 _connection = connection ;
9898 _writeStats = writeStats ;
99- _noAck = noAck ;
99+ _autoAck = autoAck ;
100100 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." );
102102 }
103103
104104 public void run () {
@@ -124,9 +124,9 @@ private void runIt() throws IOException {
124124 channel .queueBind (completionQueue , exchangeName , "" );
125125
126126 LatencyExperimentConsumer callback = new LatencyExperimentConsumer (channel , queueName );
127- callback ._noAck = this ._noAck ;
127+ callback ._autoAck = this ._autoAck ;
128128
129- channel .basicConsume (queueName , _noAck , callback );
129+ channel .basicConsume (queueName , _autoAck , callback );
130130 channel .basicConsume (completionQueue , true , "completion" , callback );
131131 callback .report (_writeStats );
132132
@@ -165,7 +165,7 @@ public static class LatencyExperimentConsumer extends DefaultConsumer {
165165
166166 public long _nextSummaryTime ;
167167
168- public boolean _noAck = true ;
168+ public boolean _autoAck = true ;
169169
170170 public LatencyExperimentConsumer (Channel ch , String queueName ) {
171171 super (ch );
@@ -277,7 +277,7 @@ public void report(boolean writeStats) throws IOException {
277277 if (msgStartTime != -1 ) {
278278 _deltas [_received ++] = now - msgStartTime ;
279279
280- if (!_noAck && ((_received % ACK_BATCH_SIZE ) == 0 )) {
280+ if (!_autoAck && ((_received % ACK_BATCH_SIZE ) == 0 )) {
281281 getChannel ().basicAck (0 , true );
282282 }
283283 }
@@ -293,7 +293,7 @@ public void report(boolean writeStats) throws IOException {
293293 }
294294
295295 public void finish () throws IOException {
296- if (!_noAck )
296+ if (!_autoAck )
297297 getChannel ().basicAck (0 , true );
298298 _blocker .setIfUnset (new Object ());
299299 }
0 commit comments