Repository: netty/netty
Issue: Mark transport-rxtx as `@deprecated`
Labels: discussion

https://github.com/netty/netty/pull/7198 just reminded me that I wanted to bring up the topic of mark transport-rxtx as `@deprecated` for some time. 

This is mainly driven because I think there is really no-one that maintain this one and there is no easy way for us to even test it. I think we should better concentrate and spend our time on the "real" core transports that are part of netty.

@Scottmitch @ejona86 @trustin @carl-mastrangelo WDYT ?

Issue comments:
I don't believe Google is using it.  No concerns here.
Sounds fine to me. Searching around it seems like there may be some small projects using it on the Raspberry Pi or to talk to a wireless modem. They probably wouldn't be served fine using RXTX directly (says the person who hasn't looked at RXTX at all).
Fixed by https://github.com/netty/netty/pull/7200
Hi,

I'm part of the Apache PLC4X (incubating) (http://plc4x.apache.org) project and we're currently implementing more and more industrial protocols (mainly ip based, but not exclusively). The Modbus protocol is now the first protocol we are implementing where the TCP version is just another layer on top of the old serial protocol. My first idea was to simply use Netty RxTxChannel and now read that's deprecated. Which path should I follow in order to implement the serial version of the driver?

Chris 
@chrisdutz I guess the answer would be to implement your own `Channel` or fork what we have and maintain it. We just have not the expertise and time to maintain it anymore.

Pull request review comments:
Compiler in IntelliJ IDEA still is not allow `@Deprecated` in package-info's:
> Error:(23, 1) java: modifier deprecated not allowed here
Fixed it... ff592c8d5c54d6a81b17050f980c5d57299a5148

Patch that resolved the issue:
diff --git a/transport-rxtx/src/main/java/io/netty/channel/rxtx/DefaultRxtxChannelConfig.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/DefaultRxtxChannelConfig.java
index 0fbf37e5140..c5a15e36ff7 100644
--- a/transport-rxtx/src/main/java/io/netty/channel/rxtx/DefaultRxtxChannelConfig.java
+++ b/transport-rxtx/src/main/java/io/netty/channel/rxtx/DefaultRxtxChannelConfig.java
@@ -36,7 +36,10 @@
 
 /**
  * Default configuration class for RXTX device connections.
+ *
+ * @deprecated this transport will be removed in the next major version.
  */
+@Deprecated
 final class DefaultRxtxChannelConfig extends DefaultChannelConfig implements RxtxChannelConfig {
 
     private volatile int baudrate = 115200;
diff --git a/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannel.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannel.java
index d5751ce3963..314af9b92b3 100644
--- a/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannel.java
+++ b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannel.java
@@ -36,7 +36,10 @@
 
 /**
  * A channel to a serial device using the RXTX library.
+ *
+ * @deprecated this transport will be removed in the next major version.
  */
+@Deprecated
 public class RxtxChannel extends OioByteStreamChannel {
 
     private static final RxtxDeviceAddress LOCAL_ADDRESS = new RxtxDeviceAddress("localhost");
diff --git a/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelConfig.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelConfig.java
index dcd2ce1628b..788f7ebf8e7 100644
--- a/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelConfig.java
+++ b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelConfig.java
@@ -49,7 +49,10 @@
  * <td>{@link RxtxChannelOption#WAIT_TIME}</td><td>{@link #setWaitTimeMillis(int)}</td>
  * </tr>
  * </table>
+ *
+ * @deprecated this transport will be removed in the next major version.
  */
+@Deprecated
 public interface RxtxChannelConfig extends ChannelConfig {
     enum Stopbits {
         /**
diff --git a/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelOption.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelOption.java
index ee0be2736f3..22a737a86e7 100644
--- a/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelOption.java
+++ b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelOption.java
@@ -22,7 +22,10 @@
 
 /**
  * Option for configuring a serial port connection
+ *
+ * @deprecated this transport will be removed in the next major version.
  */
+@Deprecated
 public final class RxtxChannelOption<T> extends ChannelOption<T> {
 
     public static final ChannelOption<Integer> BAUD_RATE = valueOf(RxtxChannelOption.class, "BAUD_RATE");
diff --git a/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxDeviceAddress.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxDeviceAddress.java
index 806c2f17975..e03e18dc0de 100644
--- a/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxDeviceAddress.java
+++ b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxDeviceAddress.java
@@ -20,7 +20,10 @@
 /**
  * A {@link SocketAddress} subclass to wrap the serial port address of a RXTX
  * device (e.g. COM1, /dev/ttyUSB0).
+ *
+ * @deprecated this transport will be removed in the next major version.
  */
+@Deprecated
 public class RxtxDeviceAddress extends SocketAddress {
 
     private static final long serialVersionUID = -2907820090993709523L;
diff --git a/transport-rxtx/src/main/java/io/netty/channel/rxtx/package-info.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/package-info.java
index 31a0e090bf2..04beb30d6af 100644
--- a/transport-rxtx/src/main/java/io/netty/channel/rxtx/package-info.java
+++ b/transport-rxtx/src/main/java/io/netty/channel/rxtx/package-info.java
@@ -16,5 +16,8 @@
 
 /**
  * A serial and parallel port communication transport based on <a href="http://rxtx.qbang.org/">RXTX</a>.
+ *
+ * @deprecated this transport will be removed in the next major version.
  */
+@Deprecated
 package io.netty.channel.rxtx;


Test patch: