|
18 | 18 | package com.rabbitmq.client.amqp.impl; |
19 | 19 |
|
20 | 20 | import static com.rabbitmq.client.amqp.Resource.State.*; |
| 21 | +import static com.rabbitmq.client.amqp.impl.Utils.supportFilterExpressions; |
| 22 | +import static com.rabbitmq.client.amqp.impl.Utils.supportSetToken; |
21 | 23 |
|
22 | 24 | import com.rabbitmq.client.amqp.*; |
23 | 25 | import com.rabbitmq.client.amqp.ObservationCollector; |
@@ -72,7 +74,7 @@ final class AmqpConnection extends ResourceBase implements Connection { |
72 | 74 | private final ConnectionSettings.AffinityStrategy affinityStrategy; |
73 | 75 | private final String name; |
74 | 76 | private final Lock instanceLock = new ReentrantLock(); |
75 | | - private final boolean filterExpressionsSupported; |
| 77 | + private final boolean filterExpressionsSupported, setTokenSupported; |
76 | 78 | private volatile ExecutorService dispatchingExecutorService; |
77 | 79 |
|
78 | 80 | AmqpConnection(AmqpConnectionBuilder builder) { |
@@ -128,8 +130,9 @@ final class AmqpConnection extends ResourceBase implements Connection { |
128 | 130 | ConnectionUtils.NO_RETRY_STRATEGY, |
129 | 131 | this.name()); |
130 | 132 | this.sync(ncw); |
131 | | - this.filterExpressionsSupported = |
132 | | - Utils.supportFilterExpressions(brokerVersion(this.nativeConnection)); |
| 133 | + String brokerVesion = brokerVersion(this.nativeConnection); |
| 134 | + this.filterExpressionsSupported = supportFilterExpressions(brokerVesion); |
| 135 | + this.setTokenSupported = supportSetToken(brokerVesion); |
133 | 136 | LOGGER.debug("Opened connection '{}' on node '{}'.", this.name(), this.connectionNodename()); |
134 | 137 | this.state(OPEN); |
135 | 138 | this.environment.metricsCollector().openConnection(); |
@@ -708,6 +711,10 @@ boolean filterExpressionsSupported() { |
708 | 711 | return this.filterExpressionsSupported; |
709 | 712 | } |
710 | 713 |
|
| 714 | + boolean setTokenSupported() { |
| 715 | + return this.setTokenSupported; |
| 716 | + } |
| 717 | + |
711 | 718 | long id() { |
712 | 719 | return this.id; |
713 | 720 | } |
|
0 commit comments