Skip to content

Commit 0eab784

Browse files
author
Marek Majkowski
committed
bug24149 merged into default
2 parents 5b20c3f + 0239d90 commit 0eab784

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

projects/wcf/RabbitMQ.ServiceModel/src/serviceModel/RabbitMQBinding.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public sealed class RabbitMQBinding : Binding
6767
private bool m_transactionsEnabled;
6868
private RabbitMQTransportBindingElement m_transport;
6969

70+
public static readonly long DefaultMaxMessageSize = 8192L;
71+
7072
/// <summary>
7173
/// Creates a new instance of the RabbitMQBinding class initialized
7274
/// to use the Protocols.DefaultProtocol. The broker must be set
@@ -143,7 +145,10 @@ public override BindingElementCollection CreateBindingElements()
143145
m_transport.HostName = this.HostName;
144146
m_transport.Port = this.Port;
145147
m_transport.BrokerProtocol = this.BrokerProtocol;
146-
m_transport.MaxReceivedMessageSize = this.MaxMessageSize;
148+
if (MaxMessageSize != DefaultMaxMessageSize)
149+
{
150+
m_transport.MaxReceivedMessageSize = MaxMessageSize;
151+
}
147152
BindingElementCollection elements = new BindingElementCollection();
148153

149154
if (m_transactionsEnabled)
@@ -172,7 +177,7 @@ private void Initialize()
172177
m_session = new ReliableSessionBindingElement();
173178
m_compositeDuplex = new CompositeDuplexBindingElement();
174179
m_transactionFlow = new TransactionFlowBindingElement();
175-
m_maxMessageSize = 8192L;
180+
m_maxMessageSize = DefaultMaxMessageSize;
176181
m_isInitialized = true;
177182
}
178183
}

0 commit comments

Comments
 (0)