Skip to content

Commit a2c23b9

Browse files
merge bug26208 into default
2 parents 303025b + 1e9997e commit a2c23b9

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,16 @@ void ExchangeDeclare(string exchange,
181181
[AmqpMethodDoNotImplement(null)]
182182
void ExchangeDeclarePassive(string exchange);
183183

184+
/// <summary>
185+
/// Same as ExchangeDeclare but sets nowait to true and returns void (as there
186+
/// will be no response from the server).
187+
/// </summary>
188+
void ExchangeDeclareNowait(string exchange,
189+
string type,
190+
bool durable,
191+
bool autoDelete,
192+
IDictionary<string, object> arguments);
193+
184194
///<summary>(Spec method) Delete an exchange.</summary>
185195
[AmqpMethodDoNotImplement(null)]
186196
void ExchangeDelete(string exchange, bool ifUnused);
@@ -242,6 +252,13 @@ void ExchangeUnbind(string destination,
242252
QueueDeclareOk QueueDeclare(string queue, bool durable, bool exclusive,
243253
bool autoDelete, IDictionary<string, object> arguments);
244254

255+
/// <summary>
256+
/// Same as QueueDeclare but sets nowait to true and returns void (as there
257+
/// will be no response from the server).
258+
/// </summary>
259+
void QueueDeclareNowait(string queue, bool durable, bool exclusive,
260+
bool autoDelete, IDictionary<string, object> arguments);
261+
245262
///<summary>(Spec method) Bind a queue to an exchange.</summary>
246263
[AmqpMethodDoNotImplement(null)]
247264
void QueueBind(string queue,

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,15 @@ public void ExchangeDeclarePassive(string exchange)
797797
_Private_ExchangeDeclare(exchange, "", true, false, false, false, false, null);
798798
}
799799

800+
public void ExchangeDeclareNowait(string exchange,
801+
string type,
802+
bool durable,
803+
bool autoDelete,
804+
IDictionary<string, object> arguments)
805+
{
806+
_Private_ExchangeDeclare(exchange, type, false, durable, autoDelete, false, true, arguments);
807+
}
808+
800809
public abstract void _Private_ExchangeDeclare(string exchange,
801810
string type,
802811
bool passive,
@@ -875,6 +884,12 @@ public QueueDeclareOk QueueDeclarePassive(string queue)
875884
return QueueDeclare(queue, true, false, false, false, null);
876885
}
877886

887+
public void QueueDeclareNowait(string queue, bool durable, bool exclusive,
888+
bool autoDelete, IDictionary<string, object> arguments)
889+
{
890+
_Private_QueueDeclare(queue, false, durable, exclusive, autoDelete, true, arguments);
891+
}
892+
878893
public QueueDeclareOk QueueDeclare(string queue, bool durable, bool exclusive,
879894
bool autoDelete, IDictionary<string, object> arguments)
880895
{

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,18 @@ public void TestConcurrentQueueDeclare()
8585
Assert.IsNotNull(nse);
8686
Model.ExchangeDelete(x);
8787
}
88+
89+
[Test]
90+
public void TestExchangeDeclareNowait()
91+
{
92+
string x = GenerateExchangeName ();
93+
try
94+
{
95+
Model.ExchangeDeclareNowait(x, "fanout", false, true, null);
96+
Model.ExchangeDeclarePassive(x);
97+
} finally {
98+
Model.ExchangeDelete(x);
99+
}
100+
}
88101
}
89102
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,13 @@ public void TestConcurrentQueueDeclare()
8585
Assert.IsNotNull(nse);
8686
Model.QueueDelete(q);
8787
}
88+
89+
[Test]
90+
public void TestQueueDeclareNowait()
91+
{
92+
string q = GenerateQueueName ();
93+
Model.QueueDeclareNowait(q, false, true, false, null);
94+
Model.QueueDeclarePassive(q);
95+
}
8896
}
8997
}

0 commit comments

Comments
 (0)