@@ -72,18 +72,19 @@ public class AMQConnection extends ShutdownNotifierComponent implements Connecti
7272 /** Timeout used while waiting for a connection.close-ok (milliseconds) */
7373 public static final int CONNECTION_CLOSING_TIMEOUT = 10000 ;
7474
75- private static final Object [] DEFAULT_CLIENT_PROPERTIES = new Object [] {
76- "product" , LongStringHelper .asLongString ("RabbitMQ" ),
77- "version" , LongStringHelper .asLongString (ClientVersion .VERSION ),
78- "platform" , LongStringHelper .asLongString ("Java" ),
79- "copyright" , LongStringHelper .asLongString (
80- "Copyright (C) 2007-2008 LShift Ltd., " +
81- "Cohesive Financial Technologies LLC., " +
82- "and Rabbit Technologies Ltd." ),
83- "information" , LongStringHelper .asLongString (
84- "Licensed under the MPL. " +
85- "See http://www.rabbitmq.com/" )
86- };
75+ private static final Object [] DEFAULT_CLIENT_PROPERTIES_ARRAY =
76+ new Object [] {
77+ "product" , LongStringHelper .asLongString ("RabbitMQ" ),
78+ "version" , LongStringHelper .asLongString (ClientVersion .VERSION ),
79+ "platform" , LongStringHelper .asLongString ("Java" ),
80+ "copyright" , LongStringHelper .asLongString (
81+ "Copyright (C) 2007-2008 LShift Ltd., " +
82+ "Cohesive Financial Technologies LLC., " +
83+ "and Rabbit Technologies Ltd." ),
84+ "information" , LongStringHelper .asLongString (
85+ "Licensed under the MPL. " +
86+ "See http://www.rabbitmq.com/" )
87+ };
8788
8889 private static final Version clientVersion =
8990 new Version (AMQP .PROTOCOL .MAJOR , AMQP .PROTOCOL .MINOR );
@@ -159,6 +160,7 @@ public void ensureIsOpen()
159160
160161 private final String _username , _password , _virtualHost ;
161162 private final int _requestedChannelMax , _requestedFrameMax , _requestedHeartbeat ;
163+ private final Map <String , Object > _clientProperties ;
162164
163165 /** {@inheritDoc} */
164166 public String getHost () {
@@ -207,6 +209,8 @@ public AMQConnection(ConnectionFactory factory,
207209 _requestedChannelMax = factory .getRequestedChannelMax ();
208210 _requestedFrameMax = factory .getRequestedFrameMax ();
209211 _requestedHeartbeat = factory .getRequestedHeartbeat ();
212+ _clientProperties =
213+ buildClientPropertiesTable (factory .getClientProperties ());
210214
211215 this .factory = factory ;
212216 _frameHandler = frameHandler ;
@@ -274,10 +278,8 @@ public void start(boolean insist)
274278 LongString saslResponse = LongStringHelper .asLongString ("\0 " + _username +
275279 "\0 " + _password );
276280 AMQImpl .Connection .StartOk startOk =
277- new AMQImpl .Connection .StartOk (buildClientPropertiesTable (),
278- "PLAIN" ,
279- saslResponse ,
280- "en_US" );
281+ new AMQImpl .Connection .StartOk (_clientProperties , "PLAIN" ,
282+ saslResponse , "en_US" );
281283
282284 AMQP .Connection .Tune connTune =
283285 (AMQP .Connection .Tune ) _channel0 .exnWrappingRpc (startOk ).getMethod ();
@@ -397,9 +399,11 @@ public void writeFrame(Frame f) throws IOException {
397399 _lastActivityTime = System .nanoTime ();
398400 }
399401
400- public Map <String , Object > buildClientPropertiesTable () {
401- Map <String , Object > props = Frame .buildTable (DEFAULT_CLIENT_PROPERTIES );
402- props .putAll (_params .getClientProperties ());
402+ private static Map <String , Object > buildClientPropertiesTable (
403+ Map <String , Object > extraClientProperties ) {
404+ Map <String , Object > props =
405+ Frame .buildTable (DEFAULT_CLIENT_PROPERTIES_ARRAY );
406+ props .putAll (extraClientProperties );
403407 return props ;
404408 }
405409
0 commit comments