diff --git a/projects/RabbitMQ.Client/client/api/IBasicPublishBatch.cs b/projects/RabbitMQ.Client/client/api/IBasicPublishBatch.cs index c31fb9c552..16584ab78c 100644 --- a/projects/RabbitMQ.Client/client/api/IBasicPublishBatch.cs +++ b/projects/RabbitMQ.Client/client/api/IBasicPublishBatch.cs @@ -44,8 +44,7 @@ namespace RabbitMQ.Client { public interface IBasicPublishBatch { - [Obsolete("Use Add(string exchange, string routingKey, bool mandatory, IBasicProperties properties, ReadOnlyMemory body) instead. Will be replaced in version 7.0", false)] - void Add(string exchange, string routingKey, bool mandatory, IBasicProperties properties, byte[] body); + void Add(string exchange, string routingKey, bool mandatory, IBasicProperties properties, ReadOnlyMemory body); void Publish(); } } diff --git a/projects/RabbitMQ.Client/client/impl/BasicPublishBatch.cs b/projects/RabbitMQ.Client/client/impl/BasicPublishBatch.cs index c4dbef19ab..93811fce46 100644 --- a/projects/RabbitMQ.Client/client/impl/BasicPublishBatch.cs +++ b/projects/RabbitMQ.Client/client/impl/BasicPublishBatch.cs @@ -62,12 +62,6 @@ internal BasicPublishBatch (ModelBase model, int sizeHint) _commands = new List(sizeHint); } - public void Add(string exchange, string routingKey, bool mandatory, IBasicProperties basicProperties, byte[] body) - { - ReadOnlyMemory bodyAsMemory = body; - Add(exchange, routingKey, mandatory, basicProperties, bodyAsMemory); - } - public void Add(string exchange, string routingKey, bool mandatory, IBasicProperties basicProperties, ReadOnlyMemory body) { var method = new BasicPublish diff --git a/projects/RabbitMQ.Client/client/impl/BasicPublishBatchExtensions.cs b/projects/RabbitMQ.Client/client/impl/BasicPublishBatchExtensions.cs deleted file mode 100644 index b56f53d246..0000000000 --- a/projects/RabbitMQ.Client/client/impl/BasicPublishBatchExtensions.cs +++ /dev/null @@ -1,61 +0,0 @@ -// This source code is dual-licensed under the Apache License, version -// 2.0, and the Mozilla Public License, version 1.1. -// -// The APL v2.0: -// -//--------------------------------------------------------------------------- -// Copyright (c) 2007-2020 VMware, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//--------------------------------------------------------------------------- -// -// The MPL v1.1: -// -//--------------------------------------------------------------------------- -// The contents of this file are subject to the Mozilla Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License -// at https://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -// the License for the specific language governing rights and -// limitations under the License. -// -// The Original Code is RabbitMQ. -// -// The Initial Developer of the Original Code is Pivotal Software, Inc. -// Copyright (c) 2007-2020 VMware, Inc. All rights reserved. -//--------------------------------------------------------------------------- - -using System; -using RabbitMQ.Client.Impl; - -namespace RabbitMQ.Client -{ - public static class BasicPublishBatchExtensions - { - public static void Add(this IBasicPublishBatch batch, string exchange, string routingKey, bool mandatory, IBasicProperties properties, ReadOnlyMemory body) - { - if (batch is BasicPublishBatch batchInternal) - { - batchInternal.Add(exchange, routingKey, mandatory, properties, body); - return; - } - -#pragma warning disable 618 - batch.Add(exchange, routingKey, mandatory, properties, body.ToArray()); -#pragma warning restore 618 - } - } -} diff --git a/projects/Unit/APIApproval.Approve.verified.txt b/projects/Unit/APIApproval.Approve.verified.txt index b0b6254a1a..0b67005c92 100644 --- a/projects/Unit/APIApproval.Approve.verified.txt +++ b/projects/Unit/APIApproval.Approve.verified.txt @@ -56,10 +56,6 @@ namespace RabbitMQ.Client public bool Redelivered { get; } public string RoutingKey { get; } } - public static class BasicPublishBatchExtensions - { - public static void Add(this RabbitMQ.Client.IBasicPublishBatch batch, string exchange, string routingKey, bool mandatory, RabbitMQ.Client.IBasicProperties properties, System.ReadOnlyMemory body) { } - } public class BinaryTableValue { public BinaryTableValue() { } @@ -295,9 +291,7 @@ namespace RabbitMQ.Client } public interface IBasicPublishBatch { - [System.Obsolete("Use Add(string exchange, string routingKey, bool mandatory, IBasicProperties prop" + - "erties, ReadOnlyMemory body) instead. Will be replaced in version 7.0", false)] - void Add(string exchange, string routingKey, bool mandatory, RabbitMQ.Client.IBasicProperties properties, byte[] body); + void Add(string exchange, string routingKey, bool mandatory, RabbitMQ.Client.IBasicProperties properties, System.ReadOnlyMemory body); void Publish(); } public interface IConnection : RabbitMQ.Client.INetworkConnection, System.IDisposable