Adding Custom Client Connection Properties

现在,CachingConnectionFactory 允许你访问底层连接工厂以允许设置自定义客户端属性,例如。以下示例演示如何执行此操作:

The CachingConnectionFactory now lets you access the underlying connection factory to allow, for example, setting custom client properties. The following example shows how to do so:

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

查看连接时,这些属性将显示在 RabbitMQ 管理界面中。

These properties appear in the RabbitMQ Admin UI when viewing the connection.