Skip to content

Commit f53d3c1

Browse files
Introduce IModel#ExchangeBindNowait
1 parent 5c9652f commit f53d3c1

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ void ExchangeDeclareNowait(string exchange,
203203
void ExchangeDelete(string exchange);
204204

205205
///<summary>
206-
///Like ExchangeDelete but sets nowait to true and returns void (as there
207-
///will be no response from the server).
206+
///Like ExchangeDelete but sets nowait to true.
208207
///</summary>
209208
void ExchangeDeleteNowait(string exchange, bool ifUnused);
210209

@@ -221,6 +220,14 @@ void ExchangeBind(string destination,
221220
string source,
222221
string routingKey);
223222

223+
///<summary>
224+
///Like ExchangeBind but sets nowait to true.
225+
///</summary>
226+
void ExchangeBindNowait(string destination,
227+
string source,
228+
string routingKey,
229+
IDictionary<string, object> arguments);
230+
224231
///<summary>(Extension method) Unbind an exchange from an exchange.</summary>
225232
[AmqpMethodDoNotImplement(null)]
226233
void ExchangeUnbind(string destination,

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,14 @@ public void ExchangeBind(string destination,
851851
_Private_ExchangeBind(destination, source, routingKey, false, arguments);
852852
}
853853

854+
public void ExchangeBindNowait(string destination,
855+
string source,
856+
string routingKey,
857+
IDictionary<string, object> arguments)
858+
{
859+
_Private_ExchangeBind(destination, source, routingKey, true, arguments);
860+
}
861+
854862
public abstract void _Private_ExchangeBind(string destination,
855863
string source,
856864
string routingKey,

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ public void TestExchangeDeclareNowait()
7777
}
7878
}
7979

80+
[Test]
81+
public void TestExchangeBindNowait()
82+
{
83+
string x = GenerateExchangeName();
84+
try
85+
{
86+
Model.ExchangeDeclareNowait(x, "fanout", false, true, null);
87+
Model.ExchangeBindNowait(x, "amq.fanout", "", null);
88+
} finally {
89+
Model.ExchangeDelete(x);
90+
}
91+
}
92+
8093
[Test]
8194
public void TestExchangeDeleteNowait()
8295
{

0 commit comments

Comments
 (0)