Skip to content

Commit 31acb58

Browse files
Merge pull request #297 from rabbitmq/rabbitmq-dotnet-client-255
noAck -> autoAck
2 parents 91f3682 + e5a9bf9 commit 31acb58

File tree

10 files changed

+55
-55
lines changed

10 files changed

+55
-55
lines changed

projects/client/RabbitMQ.Client/src/client/api/IModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public interface IModel : IDisposable
196196
[AmqpMethodDoNotImplement(null)]
197197
string BasicConsume(
198198
string queue,
199-
bool noAck,
199+
bool autoAck,
200200
string consumerTag,
201201
bool noLocal,
202202
bool exclusive,
@@ -209,7 +209,7 @@ string BasicConsume(
209209
/// no messages are currently available. See also <see cref="IModel.BasicAck"/>.
210210
/// </summary>
211211
[AmqpMethodDoNotImplement(null)]
212-
BasicGetResult BasicGet(string queue, bool noAck);
212+
BasicGetResult BasicGet(string queue, bool autoAck);
213213

214214
/// <summary>Reject one or more delivered message(s).</summary>
215215
void BasicNack(ulong deliveryTag, bool multiple, bool requeue);

projects/client/RabbitMQ.Client/src/client/api/IModelExtensions.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,38 +48,38 @@ public static class IModelExensions
4848
public static string BasicConsume(this IModel model,
4949
IBasicConsumer consumer,
5050
string queue,
51-
bool noAck = false,
51+
bool autoAck = false,
5252
string consumerTag = "",
5353
bool noLocal = false,
5454
bool exclusive = false,
5555
IDictionary<string, object> arguments = null)
5656
{
57-
return model.BasicConsume(queue, noAck, consumerTag, noLocal, exclusive, arguments, consumer);
57+
return model.BasicConsume(queue, autoAck, consumerTag, noLocal, exclusive, arguments, consumer);
5858
}
5959

6060
/// <summary>Start a Basic content-class consumer.</summary>
61-
public static string BasicConsume(this IModel model, string queue, bool noAck, IBasicConsumer consumer)
61+
public static string BasicConsume(this IModel model, string queue, bool autoAck, IBasicConsumer consumer)
6262
{
63-
return model.BasicConsume(queue, noAck, "", false, false, null, consumer);
63+
return model.BasicConsume(queue, autoAck, "", false, false, null, consumer);
6464
}
6565

6666
/// <summary>Start a Basic content-class consumer.</summary>
6767
public static string BasicConsume(this IModel model, string queue,
68-
bool noAck,
68+
bool autoAck,
6969
string consumerTag,
7070
IBasicConsumer consumer)
7171
{
72-
return model.BasicConsume(queue, noAck, consumerTag, false, false, null, consumer);
72+
return model.BasicConsume(queue, autoAck, consumerTag, false, false, null, consumer);
7373
}
7474

7575
/// <summary>Start a Basic content-class consumer.</summary>
7676
public static string BasicConsume(this IModel model, string queue,
77-
bool noAck,
77+
bool autoAck,
7878
string consumerTag,
7979
IDictionary<string, object> arguments,
8080
IBasicConsumer consumer)
8181
{
82-
return model.BasicConsume(queue, noAck, consumerTag, false, false, arguments, consumer);
82+
return model.BasicConsume(queue, autoAck, consumerTag, false, false, arguments, consumer);
8383
}
8484

8585
/// <summary>
@@ -214,4 +214,4 @@ public static void QueueUnbind(this IModel model, string queue, string exchange,
214214
model.QueueUnbind(queue, exchange, routingKey, arguments);
215215
}
216216
}
217-
}
217+
}

projects/client/RabbitMQ.Client/src/client/impl/AutorecoveringModel.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -542,23 +542,23 @@ public void _Private_BasicCancel(string consumerTag,
542542
public void _Private_BasicConsume(string queue,
543543
string consumerTag,
544544
bool noLocal,
545-
bool noAck,
545+
bool autoAck,
546546
bool exclusive,
547547
bool nowait,
548548
IDictionary<string, object> arguments)
549549
{
550550
m_delegate._Private_BasicConsume(queue,
551551
consumerTag,
552552
noLocal,
553-
noAck,
553+
autoAck,
554554
exclusive,
555555
nowait,
556556
arguments);
557557
}
558558

559-
public void _Private_BasicGet(string queue, bool noAck)
559+
public void _Private_BasicGet(string queue, bool autoAck)
560560
{
561-
m_delegate._Private_BasicGet(queue, noAck);
561+
m_delegate._Private_BasicGet(queue, autoAck);
562562
}
563563

564564
public void _Private_BasicPublish(string exchange,
@@ -759,29 +759,29 @@ public void BasicCancel(string consumerTag)
759759

760760
public string BasicConsume(
761761
string queue,
762-
bool noAck,
762+
bool autoAck,
763763
string consumerTag,
764764
bool noLocal,
765765
bool exclusive,
766766
IDictionary<string, object> arguments,
767767
IBasicConsumer consumer)
768768
{
769-
var result = m_delegate.BasicConsume(queue, noAck, consumerTag, noLocal,
769+
var result = m_delegate.BasicConsume(queue, autoAck, consumerTag, noLocal,
770770
exclusive, arguments, consumer);
771771
RecordedConsumer rc = new RecordedConsumer(this, queue).
772772
WithConsumerTag(result).
773773
WithConsumer(consumer).
774774
WithExclusive(exclusive).
775-
WithAutoAck(noAck).
775+
WithAutoAck(autoAck).
776776
WithArguments(arguments);
777777
m_connection.RecordConsumer(result, rc);
778778
return result;
779779
}
780780

781781
public BasicGetResult BasicGet(string queue,
782-
bool noAck)
782+
bool autoAck)
783783
{
784-
return m_delegate.BasicGet(queue, noAck);
784+
return m_delegate.BasicGet(queue, autoAck);
785785
}
786786

787787
public void BasicNack(ulong deliveryTag,
@@ -1213,4 +1213,4 @@ protected void RunRecoveryEventHandlers()
12131213
}
12141214
}
12151215
}
1216-
}
1216+
}

projects/client/RabbitMQ.Client/src/client/impl/IFullModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void _Private_BasicCancel(string consumerTag,
204204
void _Private_BasicConsume(string queue,
205205
string consumerTag,
206206
bool noLocal,
207-
bool noAck,
207+
[AmqpFieldMapping(null, "noAck")] bool autoAck,
208208
bool exclusive,
209209
bool nowait,
210210
IDictionary<string, object> arguments);
@@ -216,7 +216,7 @@ void _Private_BasicConsume(string queue,
216216
[AmqpForceOneWay]
217217
[AmqpMethodMapping(null, "basic", "get")]
218218
void _Private_BasicGet(string queue,
219-
bool noAck);
219+
[AmqpFieldMapping(null, "noAck")] bool autoAck);
220220

221221
///<summary>Used to send a Basic.Publish method. Called by the
222222
///public publish method after potential null-reference issues

projects/client/RabbitMQ.Client/src/client/impl/ModelBase.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,13 +1029,13 @@ public abstract void _Private_BasicCancel(string consumerTag,
10291029
public abstract void _Private_BasicConsume(string queue,
10301030
string consumerTag,
10311031
bool noLocal,
1032-
bool noAck,
1032+
bool autoAck,
10331033
bool exclusive,
10341034
bool nowait,
10351035
IDictionary<string, object> arguments);
10361036

10371037
public abstract void _Private_BasicGet(string queue,
1038-
bool noAck);
1038+
bool autoAck);
10391039

10401040
public abstract void _Private_BasicPublish(string exchange,
10411041
string routingKey,
@@ -1152,7 +1152,7 @@ public void BasicCancel(string consumerTag)
11521152
}
11531153

11541154
public string BasicConsume(string queue,
1155-
bool noAck,
1155+
bool autoAck,
11561156
string consumerTag,
11571157
bool noLocal,
11581158
bool exclusive,
@@ -1165,7 +1165,7 @@ public string BasicConsume(string queue,
11651165
Enqueue(k);
11661166
// Non-nowait. We have an unconventional means of getting
11671167
// the RPC response, but a response is still expected.
1168-
_Private_BasicConsume(queue, consumerTag, noLocal, noAck, exclusive,
1168+
_Private_BasicConsume(queue, consumerTag, noLocal, autoAck, exclusive,
11691169
/*nowait:*/ false, arguments);
11701170
k.GetReply(this.ContinuationTimeout);
11711171
string actualConsumerTag = k.m_consumerTag;
@@ -1174,11 +1174,11 @@ public string BasicConsume(string queue,
11741174
}
11751175

11761176
public BasicGetResult BasicGet(string queue,
1177-
bool noAck)
1177+
bool autoAck)
11781178
{
11791179
var k = new BasicGetRpcContinuation();
11801180
Enqueue(k);
1181-
_Private_BasicGet(queue, noAck);
1181+
_Private_BasicGet(queue, autoAck);
11821182
k.GetReply(this.ContinuationTimeout);
11831183
return k.m_result;
11841184
}

projects/client/RabbitMQ.Client/src/client/messagepatterns/ISubscription.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public interface ISubscription : IEnumerable, IEnumerator, IDisposable
6565
void Nack(bool requeue);
6666
BasicDeliverEventArgs Next();
6767
bool Next(int millisecondsTimeout, out BasicDeliverEventArgs result);
68-
bool NoAck { get; }
68+
bool AutoAck { get; }
6969
string QueueName { get; }
7070
}
7171
}

projects/client/RabbitMQ.Client/src/client/messagepatterns/Subscription.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ namespace RabbitMQ.Client.MessagePatterns
6464
/// IEnumerator in, for example, a foreach loop.
6565
///</para>
6666
///<para>
67-
/// Note that if the "noAck" option is enabled (which it is by
67+
/// Note that if the "autoAck" option is enabled (which it is by
6868
/// default), then received deliveries are automatically acked
6969
/// within the server before they are even transmitted across the
7070
/// network to us. Calling Ack() on received events will always do
71-
/// the right thing: if "noAck" is enabled, nothing is done on an
72-
/// Ack() call, and if "noAck" is disabled, IModel.BasicAck() is
71+
/// the right thing: if "autoAck" is enabled, nothing is done on an
72+
/// Ack() call, and if "autoAck" is disabled, IModel.BasicAck() is
7373
/// called with the correct parameters.
7474
///</para>
7575
///</remarks>
@@ -86,42 +86,42 @@ public class Subscription : ISubscription
8686
private ConcurrentQueue<TaskCompletionSource<BasicDeliverEventArgs>> m_waiting =
8787
new ConcurrentQueue<TaskCompletionSource<BasicDeliverEventArgs>>();
8888
#endif
89-
///<summary>Creates a new Subscription in "noAck" mode,
89+
///<summary>Creates a new Subscription in "autoAck" mode,
9090
///consuming from a named queue.</summary>
9191
public Subscription(IModel model, string queueName)
9292
: this(model, queueName, true)
9393
{
9494
}
9595

9696
///<summary>Creates a new Subscription, with full control over
97-
///both "noAck" mode and the name of the queue.</summary>
98-
public Subscription(IModel model, string queueName, bool noAck)
97+
///both "autoAck" mode and the name of the queue.</summary>
98+
public Subscription(IModel model, string queueName, bool autoAck)
9999
{
100100
Model = model;
101101
QueueName = queueName;
102-
NoAck = noAck;
102+
AutoAck = autoAck;
103103
m_consumer = new EventingBasicConsumer(Model);
104104
#if NETFX_CORE || NET4
105105
m_consumer.Received += (sender, args) => QueueAdd(args);
106106
#else
107107
m_consumer.Received += (sender, args) => m_queue.Add(args);
108108
#endif
109-
ConsumerTag = Model.BasicConsume(QueueName, NoAck, m_consumer);
109+
ConsumerTag = Model.BasicConsume(QueueName, AutoAck, m_consumer);
110110
m_consumer.ConsumerCancelled += HandleConsumerCancelled;
111111
LatestEvent = null;
112112
}
113113

114114
///<summary>Creates a new Subscription, with full control over
115-
///both "noAck" mode, the name of the queue, and the consumer tag.</summary>
116-
public Subscription(IModel model, string queueName, bool noAck, string consumerTag)
115+
///both "autoAck" mode, the name of the queue, and the consumer tag.</summary>
116+
public Subscription(IModel model, string queueName, bool autoAck, string consumerTag)
117117
{
118118
Model = model;
119119
QueueName = queueName;
120-
NoAck = noAck;
120+
AutoAck = autoAck;
121121
m_consumer = new EventingBasicConsumer(Model);
122122
m_consumer.ConsumerCancelled += HandleConsumerCancelled;
123123
m_consumer.Received += (sender, args) => m_queue.Add(args);
124-
ConsumerTag = Model.BasicConsume(QueueName, NoAck, consumerTag, m_consumer);
124+
ConsumerTag = Model.BasicConsume(QueueName, AutoAck, consumerTag, m_consumer);
125125
LatestEvent = null;
126126
}
127127

@@ -149,13 +149,13 @@ public IBasicConsumer Consumer
149149
///<summary>Retrieve the IModel our subscription is carried by.</summary>
150150
public IModel Model { get; protected set; }
151151

152-
///<summary>Returns true if we are in "noAck" mode, where
152+
///<summary>Returns true if we are in "autoAck" mode, where
153153
///calls to Ack() will be no-ops, and where the server acks
154154
///messages before they are delivered to us. Returns false if
155155
///we are in a mode where calls to Ack() are required, and
156156
///where such calls will actually send an acknowledgement
157157
///message across the network to the server.</summary>
158-
public bool NoAck { get; protected set; }
158+
public bool AutoAck { get; protected set; }
159159

160160
///<summary>Retrieve the queue name we have subscribed to.</summary>
161161
public string QueueName { get; protected set; }
@@ -193,7 +193,7 @@ public void Ack()
193193
Ack(LatestEvent);
194194
}
195195

196-
///<summary>If we are not in "noAck" mode, calls
196+
///<summary>If we are not in "autoAck" mode, calls
197197
///IModel.BasicAck with the delivery-tag from <paramref name="evt"/>;
198198
///otherwise, sends nothing to the server. if <paramref name="evt"/> is the same as LatestEvent
199199
///by pointer comparison, sets LatestEvent to null.
@@ -209,7 +209,7 @@ public void Ack(BasicDeliverEventArgs evt)
209209
return;
210210
}
211211

212-
if (!NoAck && Model.IsOpen)
212+
if (!AutoAck && Model.IsOpen)
213213
{
214214
Model.BasicAck(evt.DeliveryTag, false);
215215
}
@@ -279,7 +279,7 @@ public void Nack(bool multiple, bool requeue)
279279
Nack(LatestEvent, multiple, requeue);
280280
}
281281

282-
///<summary>If we are not in "noAck" mode, calls
282+
///<summary>If we are not in "autoAck" mode, calls
283283
///IModel.BasicNack with the delivery-tag from <paramref name="evt"/>;
284284
///otherwise, sends nothing to the server. if <paramref name="evt"/> is the same as LatestEvent
285285
///by pointer comparison, sets LatestEvent to null.
@@ -295,7 +295,7 @@ public void Nack(BasicDeliverEventArgs evt, bool multiple, bool requeue)
295295
return;
296296
}
297297

298-
if (!NoAck && Model.IsOpen)
298+
if (!AutoAck && Model.IsOpen)
299299
{
300300
Model.BasicNack(evt.DeliveryTag, multiple, requeue);
301301
}
@@ -319,7 +319,7 @@ public void Nack(BasicDeliverEventArgs evt, bool multiple, bool requeue)
319319
/// Updates LatestEvent to the value returned.
320320
///</para>
321321
///<para>
322-
/// Does not acknowledge any deliveries at all (but in "noAck"
322+
/// Does not acknowledge any deliveries at all (but in "autoAck"
323323
/// mode, the server will have auto-acknowledged each event
324324
/// before it is even sent across the wire to us).
325325
///</para>
@@ -427,7 +427,7 @@ public Task<BasicDeliverEventArgs> NextAsync()
427427
///</para>
428428
///<para>
429429
/// This method does not acknowledge any deliveries at all
430-
/// (but in "noAck" mode, the server will have
430+
/// (but in "autoAck" mode, the server will have
431431
/// auto-acknowledged each event before it is even sent across
432432
/// the wire to us).
433433
///</para>

projects/client/Unit/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"dependencies": {
44
"NUnit": "3.4.1",
55
"RabbitMQ.Client": "*",
6-
"dotnet-test-nunit": "3.4.0-beta-2"
6+
"dotnet-test-nunit": "3.4.0-beta-3"
77
},
88
"testRunner": "nunit",
99
"frameworks": {

projects/client/Unit/src/unit/TestConsumerOperationDispatch.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void TestDeliveryOrderingWithSingleChannel()
123123
queues.Add(q);
124124
var cons = new CollectingConsumer(ch);
125125
consumers.Add(cons);
126-
ch.BasicConsume(queue: q, noAck: false, consumer: cons);
126+
ch.BasicConsume(queue: q, autoAck: false, consumer: cons);
127127
}
128128

129129
for (int i = 0; i < n; i++)
@@ -207,7 +207,7 @@ public void TestModelShutdownHandler()
207207
var q = this.Model.QueueDeclare().QueueName;
208208
var c = new ShutdownLatchConsumer(latch, duplicateLatch);
209209

210-
this.Model.BasicConsume(queue: q, noAck: true, consumer: c);
210+
this.Model.BasicConsume(queue: q, autoAck: true, consumer: c);
211211
this.Model.Close();
212212
Wait(latch, TimeSpan.FromSeconds(5));
213213
Assert.IsFalse(duplicateLatch.WaitOne(TimeSpan.FromSeconds(5)),

projects/client/Unit/src/unit/TestSsl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public void SendReceive(ConnectionFactory cf)
6464
byte[] msgBytes = System.Text.Encoding.UTF8.GetBytes(message);
6565
ch.BasicPublish("Exchange_TestSslEndPoint", "Key_TestSslEndpoint", null, msgBytes);
6666

67-
bool noAck = false;
68-
BasicGetResult result = ch.BasicGet(qName, noAck);
67+
bool autoAck = false;
68+
BasicGetResult result = ch.BasicGet(qName, autoAck);
6969
byte[] body = result.Body;
7070
string resultMessage = System.Text.Encoding.UTF8.GetString(body);
7171

0 commit comments

Comments
 (0)