根据经典 API 的 JMS 规范
The Connection, Session, MessageProducer, MessageConsumer and
QueueBrowser interfaces have been modified to extend the
java.lang.Autocloseable interface. This means that applications can
create these objects using a Java SE 7 try-with-resources statement which
removes the need for applications to explicitly call close() when these
objects are no longer required.
在经典 API 的 JMS2 之后
The new JMSContext and JMSConsumer interfaces also extend the
java.lang.Autocloseable interface.
问题是为什么 JMSProducer 不扩展 AutoCloseable?