Skip to content

Commit f8f3b47

Browse files
authored
Batch Publish Missing Items
Addition of API items for BatchPublish
1 parent 253afa9 commit f8f3b47

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ string BasicConsume(
226226
void BasicPublish(string exchange, string routingKey, bool mandatory,
227227
IBasicProperties basicProperties, byte[] body);
228228

229+
[AmqpMethodDoNotImplement(null)]
230+
void BasicBatchPublish(string exchange, string routingKey, bool mandatory,
231+
IEnumerable<BatchMessage> messages);
232+
233+
229234
/// <summary>
230235
/// Configures QoS parameters of the Basic content-class.
231236
/// </summary>
@@ -552,4 +557,8 @@ void QueueDeclareNoWait(string queue, bool durable,
552557
/// </summary>
553558
TimeSpan ContinuationTimeout { get; set; }
554559
}
560+
public class BatchMessage{
561+
public byte[] Body { get; set; }
562+
public IBasicProperties basicProperties { get; set; }
563+
}
555564
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ public static void BasicPublish(this IModel model, string exchange, string routi
103103
{
104104
model.BasicPublish(exchange, routingKey, false, basicProperties, body);
105105
}
106+
public static void BasicBatchPublish(this IModel model, string exchange, string routingKey, IEnumerable<BatchMessage> messages)
107+
{
108+
model.BasicBatchPublish(exchange, routingKey, false, messages);
109+
}
106110

107111
/// <summary>
108112
/// (Spec method) Convenience overload of BasicPublish.

0 commit comments

Comments
 (0)