From 1c403cc6e3953785d33bdd5d38027f71e68be62e Mon Sep 17 00:00:00 2001 From: Bertrand Renuart Date: Tue, 24 Aug 2021 23:20:31 +0200 Subject: [PATCH] Deprecate AsynDisruptorAppender#setProducerType() closes #608 --- README.md | 2 +- .../logback/appender/AsyncDisruptorAppender.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6564c7de..7c069517 100644 --- a/README.md +++ b/README.md @@ -790,7 +790,7 @@ e.g.
phasedBackoff{10,60,seconds,blocking} See [AsyncDisruptorAppender](/src/main/java/net/logstash/logback/appender/AsyncDisruptorAppender.java) -for other configuration parameters (such as `ringBufferSize`, `producerType`, `threadNamePrefix`, `daemon`, and `droppedWarnFrequency`) +for other configuration parameters (such as `ringBufferSize`, `threadNamePrefix`, `daemon`, and `droppedWarnFrequency`) ### Appender Listeners diff --git a/src/main/java/net/logstash/logback/appender/AsyncDisruptorAppender.java b/src/main/java/net/logstash/logback/appender/AsyncDisruptorAppender.java index df0358cc..b357683d 100644 --- a/src/main/java/net/logstash/logback/appender/AsyncDisruptorAppender.java +++ b/src/main/java/net/logstash/logback/appender/AsyncDisruptorAppender.java @@ -644,8 +644,17 @@ public void setRingBufferSize(int ringBufferSize) { public ProducerType getProducerType() { return producerType; } + + /** + * Set the {@link ProducerType} to use to configure the disruptor. + * + * @deprecated ProducerType will be fixed to MULTI in future release and this method removed without any replacement. + * @param producerType the type of producer + */ + @Deprecated public void setProducerType(ProducerType producerType) { - this.producerType = producerType; + this.producerType = Objects.requireNonNull(producerType); + addWarn("setProducerType() is deprecated and will be removed without replacement in future release"); } public WaitStrategy getWaitStrategy() {