26
26
import com .swiftmq .amqp .v100 .generated .security .sasl .*;
27
27
import com .swiftmq .amqp .v100 .generated .transport .definitions .ConnectionError ;
28
28
import com .swiftmq .amqp .v100 .generated .transport .definitions .ErrorConditionFactory ;
29
+ import com .swiftmq .amqp .v100 .generated .transport .definitions .Fields ;
29
30
import com .swiftmq .amqp .v100 .generated .transport .definitions .Milliseconds ;
30
31
import com .swiftmq .amqp .v100 .generated .transport .performatives .*;
31
32
import com .swiftmq .amqp .v100 .transport .AMQPFrame ;
@@ -76,7 +77,7 @@ public class ConnectionDispatcher
76
77
POProtocolRequest protPO = null ;
77
78
POAuthenticate authPO = null ;
78
79
POOpen openPO = null ;
79
- OpenFrame remoteOpen = null ;
80
+ volatile OpenFrame remoteOpen = null ;
80
81
POSendClose closePO = null ;
81
82
CloseFrame remoteClose = null ;
82
83
SaslMechanismsFrame saslMechanisms = null ;
@@ -89,6 +90,7 @@ public class ConnectionDispatcher
89
90
long idleTimeoutDelay = 0 ;
90
91
SaslClient saslClient = null ;
91
92
volatile boolean connectionDisabled = false ;
93
+ Fields properties = null ;
92
94
93
95
int maxLocalFrameSize = Integer .MAX_VALUE ;
94
96
int maxRemoteFrameSize = Integer .MAX_VALUE ;
@@ -133,6 +135,16 @@ public int getMaxFrameSize() {
133
135
return Math .max (512 , Math .min (maxLocalFrameSize , maxRemoteFrameSize ));
134
136
}
135
137
138
+ public void setProperties (Fields properties ) {
139
+ this .properties = properties ;
140
+ }
141
+
142
+ public Fields getRemoteProperties () {
143
+ if (remoteOpen != null )
144
+ return remoteOpen .getProperties ();
145
+ return null ;
146
+ }
147
+
136
148
public void setSaslActive (boolean saslActive ) {
137
149
this .saslActive = saslActive ;
138
150
}
@@ -317,6 +329,8 @@ public void visit(POOpen po) {
317
329
OpenFrame openFrame = new OpenFrame (0 );
318
330
openFrame .setContainerId (new AMQPString (po .getContainerId ()));
319
331
openFrame .setChannelMax (new AMQPUnsignedShort (po .getMaxChannel ()));
332
+ if (properties != null )
333
+ openFrame .setProperties (properties );
320
334
if (myConnection .getOpenHostname () == null )
321
335
openFrame .setHostname (new AMQPString (remoteHostname ));
322
336
else
0 commit comments