Skip to content

Commit 1eca6ca

Browse files
committed
Following the java client, make the default properties visible to applications
1 parent 4acebd1 commit 1eca6ca

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ public class ConnectionFactory
144144
/// <summary>Heartbeat setting to request (in seconds)</summary>
145145
public ushort RequestedHeartbeat = DefaultHeartbeat;
146146

147-
/// <summary>Dictionary of extra client properties to be sent to the
147+
/// <summary>Dictionary of client properties to be sent to the
148148
/// server</summary>
149-
public IDictionary ClientProperties = DefaultClientProperties;
149+
public IDictionary ClientProperties = ConnectionBase.DefaultClientProperties();
150150

151151
///<summary>Ssl options setting</summary>
152152
public SslOption Ssl = new SslOption();
@@ -161,16 +161,6 @@ public class ConnectionFactory
161161
///<summary>The AMQP protocol to be used</summary>
162162
public IProtocol Protocol = Protocols.FromEnvironment();
163163

164-
/// <summary>Default value for extra client properties to be sent to
165-
/// the server (value: empty Hashtable)</summary>
166-
public static IDictionary DefaultClientProperties
167-
{
168-
get
169-
{
170-
return new Hashtable(); // PLEASE KEEP THIS MATCHING THE DOC ABOVE
171-
}
172-
}
173-
174164
public AmqpTcpEndpoint Endpoint
175165
{
176166
get

projects/client/RabbitMQ.Client/src/client/impl/ConnectionBase.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -922,8 +922,7 @@ public void OnCallbackException(CallbackExceptionEventArgs args)
922922
}
923923
}
924924

925-
private static IDictionary BuildClientPropertiesTable(
926-
IDictionary extraClientProperties)
925+
public static IDictionary DefaultClientProperties()
927926
{
928927
System.Reflection.Assembly assembly =
929928
System.Reflection.Assembly.GetAssembly(typeof(ConnectionBase));
@@ -938,10 +937,6 @@ private static IDictionary BuildClientPropertiesTable(
938937
"and Rabbit Technologies Ltd.");
939938
table["information"] = Encoding.UTF8.GetBytes("Licensed under the MPL. " +
940939
"See http://www.rabbitmq.com/");
941-
942-
foreach(DictionaryEntry de in extraClientProperties)
943-
table[de.Key] = de.Value;
944-
945940
return table;
946941
}
947942

@@ -988,7 +983,7 @@ public void Open(bool insist)
988983
serverVersion.Minor);
989984
}
990985

991-
m_clientProperties = BuildClientPropertiesTable(m_factory.ClientProperties);
986+
m_clientProperties = new Hashtable(m_factory.ClientProperties);
992987

993988
// FIXME: check that PLAIN is supported.
994989
// FIXME: parse out locales properly!

0 commit comments

Comments
 (0)