此版本仍在开发中,目前尚不稳定。如需最新稳定版本,请使用 Spring AMQP 4.0.2spring-doc.cadn.net.cn

添加自定义客户端连接属性

现在,CachingConnectionFactory 允许您访问底层的连接工厂,从而可以设置自定义客户端属性。
以下示例展示了如何实现此操作:spring-doc.cadn.net.cn

connectionFactory.getRabbitConnectionFactory().getClientProperties().put("thing1", "thing2");

这些属性在查看连接时显示在 RabbitMQ 管理用户界面中。spring-doc.cadn.net.cn