diff --git a/src/main/java/com/rabbitmq/stream/ChannelCustomizer.java b/src/main/java/com/rabbitmq/stream/ChannelCustomizer.java deleted file mode 100644 index b53593e6b4..0000000000 --- a/src/main/java/com/rabbitmq/stream/ChannelCustomizer.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2020-2023 VMware, Inc. or its affiliates. All rights reserved. -// -// This software, the RabbitMQ Stream Java client library, is dual-licensed under the -// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). -// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, -// please see LICENSE-APACHE2. -// -// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, -// either express or implied. See the LICENSE file for specific language governing -// rights and limitations of this software. -// -// If you have any questions regarding licensing, please contact us at -// info@rabbitmq.com. -package com.rabbitmq.stream; - -import com.rabbitmq.stream.EnvironmentBuilder.NettyConfiguration; -import io.netty.channel.Channel; -import java.util.Objects; -import java.util.function.Consumer; - -/** - * An extension point to customize Netty's {@link io.netty.channel.Channel}s used for connection. - * - * @deprecated use {@link NettyConfiguration#channelCustomizer(Consumer)} from {@link - * EnvironmentBuilder#netty()} instead - * @see NettyConfiguration#netty() - */ -public interface ChannelCustomizer { - - void customize(Channel channel); - - default ChannelCustomizer andThen(ChannelCustomizer after) { - Objects.requireNonNull(after); - return ch -> { - customize(ch); - after.customize(ch); - }; - } -} diff --git a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java index a46e3e8e4c..b6845ca73c 100644 --- a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java @@ -187,39 +187,6 @@ public interface EnvironmentBuilder { */ EnvironmentBuilder requestedMaxFrameSize(int requestedMaxFrameSize); - /** - * The Netty {@link EventLoopGroup} instance to use. - * - *

The environment uses its own instance by default. It is the developer's responsibility to - * close the {@link EventLoopGroup} they provide. - * - * @param eventLoopGroup - * @return this builder instance - * @deprecated use {@link NettyConfiguration#eventLoopGroup(EventLoopGroup)} from {@link #netty()} - * instead - */ - EnvironmentBuilder eventLoopGroup(EventLoopGroup eventLoopGroup); - - /** - * Netty's {@link io.netty.buffer.ByteBuf} allocator. - * - * @param byteBufAllocator - * @return this builder instance - * @deprecated use {@link NettyConfiguration#byteBufAllocator(ByteBufAllocator)} from {@link - * #netty()} instead - */ - EnvironmentBuilder byteBufAllocator(ByteBufAllocator byteBufAllocator); - - /** - * An extension point to customize Netty's {@link io.netty.channel.Channel}s used for connection. - * - * @param channelCustomizer - * @return this builder instance - * @deprecated use {@link NettyConfiguration#channelCustomizer(Consumer)} from {@link #netty()} - * instead - */ - EnvironmentBuilder channelCustomizer(ChannelCustomizer channelCustomizer); - /** * The checksum strategy used for chunk checksum. * diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java index 70914bb91c..e087ebc64b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java @@ -134,26 +134,12 @@ public EnvironmentBuilder compressionCodecFactory( return this; } - @SuppressWarnings("deprecation") - @Override - public EnvironmentBuilder eventLoopGroup(EventLoopGroup eventLoopGroup) { - this.netty().eventLoopGroup(eventLoopGroup); - return this; - } - @Override public EnvironmentBuilder id(String id) { this.id = id; return this; } - @SuppressWarnings("deprecation") - @Override - public EnvironmentBuilder byteBufAllocator(ByteBufAllocator byteBufAllocator) { - this.netty().byteBufAllocator(byteBufAllocator); - return this; - } - @Override public EnvironmentBuilder rpcTimeout(Duration timeout) { this.clientParameters.rpcTimeout(timeout); @@ -195,13 +181,6 @@ public StreamEnvironmentBuilder requestedMaxFrameSize(int requestedMaxFrameSize) return this; } - @SuppressWarnings("deprecation") - public StreamEnvironmentBuilder channelCustomizer( - com.rabbitmq.stream.ChannelCustomizer channelCustomizer) { - this.netty().channelCustomizer(ch -> channelCustomizer.customize(ch)); - return this; - } - public StreamEnvironmentBuilder chunkChecksum(ChunkChecksum chunkChecksum) { this.clientParameters.chunkChecksum(chunkChecksum); return this;