Skip to content

Commit d981802

Browse files
committed
delete publish batch
1 parent 14e8078 commit d981802

File tree

9 files changed

+1
-283
lines changed

9 files changed

+1
-283
lines changed

projects/RabbitMQ.Client/client/api/IBasicPublishBatch.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,6 @@ string BasicConsume(
229229
/// </summary>
230230
void ConfirmSelect();
231231

232-
/// <summary>
233-
/// Creates a BasicPublishBatch instance
234-
/// </summary>
235-
IBasicPublishBatch CreateBasicPublishBatch();
236-
237-
/// <summary>
238-
/// Creates a BasicPublishBatch instance
239-
/// </summary>
240-
IBasicPublishBatch CreateBasicPublishBatch(int sizeHint);
241-
242232
/// <summary>
243233
/// Construct a completely empty content header for use with the Basic content class.
244234
/// </summary>

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,6 @@ private void RecoverState()
420420
}
421421
}
422422

423-
public IBasicPublishBatch CreateBasicPublishBatch()
424-
=> InnerChannel.CreateBasicPublishBatch();
425-
426-
public IBasicPublishBatch CreateBasicPublishBatch(int sizeHint)
427-
=> InnerChannel.CreateBasicPublishBatch(sizeHint);
428-
429423
[MethodImpl(MethodImplOptions.AggressiveInlining)]
430424
private void ThrowIfDisposed()
431425
{

projects/RabbitMQ.Client/client/impl/BasicPublishBatch.cs

Lines changed: 0 additions & 78 deletions
This file was deleted.

projects/RabbitMQ.Client/client/impl/ISession.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
//---------------------------------------------------------------------------
3131

3232
using System;
33-
using System.Collections.Generic;
34-
3533
using RabbitMQ.Client.Framing.Impl;
3634

3735
namespace RabbitMQ.Client.Impl
@@ -75,6 +73,5 @@ internal interface ISession
7573
bool HandleFrame(in InboundFrame frame);
7674
void Notify();
7775
void Transmit<T>(in T cmd) where T : struct, IOutgoingCommand;
78-
void Transmit<T>(List<T> cmds) where T : struct, IOutgoingCommand;
7976
}
8077
}

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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -851,17 +851,6 @@ public BasicGetResult BasicGet(string queue, bool autoAck)
851851

852852
public abstract void BasicNack(ulong deliveryTag, bool multiple, bool requeue);
853853

854-
private void AllocatePublishSeqNos(int count)
855-
{
856-
lock (_confirmLock)
857-
{
858-
for (int i = 0; i < count; i++)
859-
{
860-
_pendingDeliveryTags.AddLast(NextPublishSeqNo++);
861-
}
862-
}
863-
}
864-
865854
public void BasicPublish(string exchange, string routingKey, bool mandatory, IBasicProperties basicProperties, ReadOnlyMemory<byte> body)
866855
{
867856
if (routingKey is null)
@@ -941,19 +930,7 @@ public void ConfirmSelect()
941930
_Private_ConfirmSelect(false);
942931
}
943932

944-
///////////////////////////////////////////////////////////////////////////
945-
946933
public abstract IBasicProperties CreateBasicProperties();
947-
public IBasicPublishBatch CreateBasicPublishBatch()
948-
{
949-
return new BasicPublishBatch(this);
950-
}
951-
952-
public IBasicPublishBatch CreateBasicPublishBatch(int sizeHint)
953-
{
954-
return new BasicPublishBatch(this, sizeHint);
955-
}
956-
957934

958935
public void ExchangeBind(string destination, string source, string routingKey, IDictionary<string, object> arguments)
959936
{
@@ -1143,16 +1120,6 @@ await CloseAsync(new ShutdownEventArgs(ShutdownInitiator.Application,
11431120
}
11441121
}
11451122

1146-
internal void SendCommands(List<OutgoingContentCommand> commands)
1147-
{
1148-
_flowControlBlock.Wait();
1149-
if (NextPublishSeqNo > 0)
1150-
{
1151-
AllocatePublishSeqNos(commands.Count);
1152-
}
1153-
Session.Transmit(commands);
1154-
}
1155-
11561123
private QueueDeclareOk QueueDeclare(string queue, bool passive, bool durable, bool exclusive, bool autoDelete, IDictionary<string, object> arguments)
11571124
{
11581125
var k = new QueueDeclareRpcContinuation();

projects/RabbitMQ.Client/client/impl/SessionBase.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
//---------------------------------------------------------------------------
3131

3232
using System;
33-
using System.Collections.Generic;
3433
using System.Threading;
3534

3635
using RabbitMQ.Client.Exceptions;
@@ -136,14 +135,5 @@ public virtual void Transmit<T>(in T cmd) where T : struct, IOutgoingCommand
136135
// of frames within a channel. But that is fixed in socket frame handler instead, so no need to lock.
137136
Connection.Write(cmd.SerializeToFrames(ChannelNumber, Connection.FrameMax));
138137
}
139-
140-
public virtual void Transmit<T>(List<T> cmds) where T : struct, IOutgoingCommand
141-
{
142-
uint frameMax = Connection.FrameMax;
143-
for (int i = 0; i < cmds.Count; i++)
144-
{
145-
Connection.Write(cmds[i].SerializeToFrames(ChannelNumber, frameMax));
146-
}
147-
}
148138
}
149139
}

projects/TestApplications/MassPublish/Program.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,13 @@ public static void Main()
4242
{
4343
while (messagesSent < BatchesToSend * ItemsPerBatch)
4444
{
45-
var batch = publisher.CreateBasicPublishBatch();
4645
for (int i = 0; i < ItemsPerBatch; i++)
4746
{
4847
var properties = publisher.CreateBasicProperties();
4948
properties.AppId = "testapp";
5049
properties.CorrelationId = Guid.NewGuid().ToString();
51-
batch.Add("test", "myawesome.routing.key", false, properties, payload);
50+
publisher.BasicPublish("test", "myawesome.routing.key", false, properties, payload);
5251
}
53-
batch.Publish();
5452
messagesSent += ItemsPerBatch;
5553
await publisher.WaitForConfirmsOrDieAsync().ConfigureAwait(false);
5654
}

projects/Unit/TestBasicPublishBatch.cs

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)