Qpid JMS’s Netty transport can obtain a fresh proxy handler through a connection extension:

Supplier<ProxyHandler> handlers = () ->
    new Socks5ProxyHandler(
        new InetSocketAddress("proxy.example", 1080));

JmsConnectionFactory factory = new JmsConnectionFactory(
    "amqps://broker.example:5671");
factory.setExtension(
    JmsConnectionExtensions.PROXY_HANDLER_SUPPLIER.toString(),
    (connection, remote) -> handlers);

Supplier and InetSocketAddress are JDK types. The proxy handlers belong to Netty, and the factory and extension enum to org.apache.qpid.jms.

For a publicly reachable broker on a permitted public-proxy route, the SOCKS5 proxy list offers host and port candidates; confirm that the chosen node allows the broker’s actual host and port. The extension returns a supplier; each supplier call creates a new handler. Returning one captured mutable handler for several connections would violate that ownership arrangement.

For SOCKS5 authentication, use the handler overload accepting username and password. Keep broker credentials on the JMS connection and retain the real AMQPS broker URI and TLS name.

The extension supports Netty’s HTTP, SOCKS4 and SOCKS5 proxy handlers. For HTTP CONNECT, the intermediary must allow the broker’s target port.

Mikanda mikatakata