3030//---------------------------------------------------------------------------
3131
3232using System ;
33+ using System . Buffers ;
3334using System . Collections . Generic ;
3435using System . Threading ;
3536using System . Threading . Tasks ;
@@ -88,6 +89,23 @@ public static ValueTask BasicPublishAsync<T>(this IChannel channel,
8889 mandatory : false , basicProperties : basicProperties , body : body ,
8990 cancellationToken ) ;
9091
92+ /// <summary>
93+ /// (Extension method) Convenience overload of <see cref="IChannel.BasicPublishAsync{TProperties}(string, string, bool, TProperties, ReadOnlyMemory{byte}, CancellationToken)"/>
94+ /// </summary>
95+ /// <remarks>
96+ /// The publication occurs with mandatory=false.
97+ /// </remarks>
98+ public static ValueTask BasicPublishAsync < T > ( this IChannel channel ,
99+ PublicationAddress addr ,
100+ T basicProperties ,
101+ IMemoryOwner < byte > body ,
102+ int bodyLength ,
103+ CancellationToken cancellationToken = default )
104+ where T : IReadOnlyBasicProperties , IAmqpHeader =>
105+ channel . BasicPublishAsync ( exchange : addr . ExchangeName , routingKey : addr . RoutingKey ,
106+ mandatory : false , basicProperties : basicProperties , body : body , bodyLength : bodyLength ,
107+ cancellationToken ) ;
108+
91109 /// <summary>
92110 /// (Extension method) Convenience overload of <see cref="IChannel.BasicPublishAsync{TProperties}(string, string, bool, TProperties, ReadOnlyMemory{byte}, CancellationToken)"/>
93111 /// </summary>
@@ -103,6 +121,22 @@ public static ValueTask BasicPublishAsync(this IChannel channel,
103121 mandatory : false , basicProperties : EmptyBasicProperty . Empty , body : body ,
104122 cancellationToken ) ;
105123
124+ /// <summary>
125+ /// (Extension method) Convenience overload of <see cref="IChannel.BasicPublishAsync{TProperties}(string, string, bool, TProperties, ReadOnlyMemory{byte}, CancellationToken)"/>
126+ /// </summary>
127+ /// <remarks>
128+ /// The publication occurs with mandatory=false and empty BasicProperties
129+ /// </remarks>
130+ public static ValueTask BasicPublishAsync ( this IChannel channel ,
131+ string exchange ,
132+ string routingKey ,
133+ IMemoryOwner < byte > body ,
134+ int bodyLength ,
135+ CancellationToken cancellationToken = default ) =>
136+ channel . BasicPublishAsync ( exchange : exchange , routingKey : routingKey ,
137+ mandatory : false , basicProperties : EmptyBasicProperty . Empty , body : body , bodyLength : bodyLength ,
138+ cancellationToken ) ;
139+
106140 /// <summary>
107141 /// (Extension method) Convenience overload of <see cref="IChannel.BasicPublishAsync{TProperties}(CachedString, CachedString, bool, TProperties, ReadOnlyMemory{byte}, CancellationToken)" />
108142 /// </summary>
@@ -118,6 +152,22 @@ public static ValueTask BasicPublishAsync(this IChannel channel,
118152 mandatory : false , basicProperties : EmptyBasicProperty . Empty , body : body ,
119153 cancellationToken ) ;
120154
155+ /// <summary>
156+ /// (Extension method) Convenience overload of <see cref="IChannel.BasicPublishAsync{TProperties}(CachedString, CachedString, bool, TProperties, ReadOnlyMemory{byte}, CancellationToken)" />
157+ /// </summary>
158+ /// <remarks>
159+ /// The publication occurs with mandatory=false and empty BasicProperties
160+ /// </remarks>
161+ public static ValueTask BasicPublishAsync ( this IChannel channel ,
162+ CachedString exchange ,
163+ CachedString routingKey ,
164+ IMemoryOwner < byte > body ,
165+ int bodyLength ,
166+ CancellationToken cancellationToken = default ) =>
167+ channel . BasicPublishAsync ( exchange : exchange , routingKey : routingKey ,
168+ mandatory : false , basicProperties : EmptyBasicProperty . Empty , body : body , bodyLength : bodyLength ,
169+ cancellationToken ) ;
170+
121171 /// <summary>
122172 /// (Extension method) Convenience overload of <see cref="IChannel.BasicPublishAsync{TProperties}(string, string, bool, TProperties, ReadOnlyMemory{byte}, CancellationToken)"/>
123173 /// </summary>
@@ -134,6 +184,23 @@ public static ValueTask BasicPublishAsync(this IChannel channel,
134184 mandatory : mandatory , basicProperties : EmptyBasicProperty . Empty , body : body ,
135185 cancellationToken ) ;
136186
187+ /// <summary>
188+ /// (Extension method) Convenience overload of <see cref="IChannel.BasicPublishAsync{TProperties}(string, string, bool, TProperties, ReadOnlyMemory{byte}, CancellationToken)"/>
189+ /// </summary>
190+ /// <remarks>
191+ /// The publication occurs with empty BasicProperties
192+ /// </remarks>
193+ public static ValueTask BasicPublishAsync ( this IChannel channel ,
194+ string exchange ,
195+ string routingKey ,
196+ bool mandatory ,
197+ IMemoryOwner < byte > body ,
198+ int bodyLength ,
199+ CancellationToken cancellationToken = default ) =>
200+ channel . BasicPublishAsync ( exchange : exchange , routingKey : routingKey ,
201+ mandatory : mandatory , basicProperties : EmptyBasicProperty . Empty , body : body , bodyLength : bodyLength ,
202+ cancellationToken ) ;
203+
137204 /// <summary>
138205 /// (Extension method) Convenience overload of <see cref="IChannel.BasicPublishAsync{TProperties}(CachedString, CachedString, bool, TProperties, ReadOnlyMemory{byte}, CancellationToken)" />
139206 /// </summary>
@@ -150,6 +217,23 @@ public static ValueTask BasicPublishAsync(this IChannel channel,
150217 mandatory : mandatory , basicProperties : EmptyBasicProperty . Empty , body : body ,
151218 cancellationToken ) ;
152219
220+ /// <summary>
221+ /// (Extension method) Convenience overload of <see cref="IChannel.BasicPublishAsync{TProperties}(CachedString, CachedString, bool, TProperties, ReadOnlyMemory{byte}, CancellationToken)" />
222+ /// </summary>
223+ /// <remarks>
224+ /// The publication occurs with empty BasicProperties
225+ /// </remarks>
226+ public static ValueTask BasicPublishAsync ( this IChannel channel ,
227+ CachedString exchange ,
228+ CachedString routingKey ,
229+ bool mandatory ,
230+ IMemoryOwner < byte > body ,
231+ int bodyLength ,
232+ CancellationToken cancellationToken = default ) =>
233+ channel . BasicPublishAsync ( exchange : exchange , routingKey : routingKey ,
234+ mandatory : mandatory , basicProperties : EmptyBasicProperty . Empty , body : body , bodyLength : bodyLength ,
235+ cancellationToken ) ;
236+
153237 /// <summary>
154238 /// Asynchronously declare a queue.
155239 /// </summary>
0 commit comments