summaryrefslogtreecommitdiff
path: root/dotnet/Qpid.Messaging
diff options
context:
space:
mode:
authorSteven Shaw <steshaw@apache.org>2006-11-30 18:54:48 +0000
committerSteven Shaw <steshaw@apache.org>2006-11-30 18:54:48 +0000
commit33c04c7e619a65e2d92ac231805e8ad27f4a29c2 (patch)
tree1fdc64001d5e0bf1f34883927d7901b456b7bd3b /dotnet/Qpid.Messaging
parent8f21f5d6cacd35e6fe04a0b4a5567fc4929f997e (diff)
downloadqpid-python-33c04c7e619a65e2d92ac231805e8ad27f4a29c2.tar.gz
QPID-136 Ported Prefetch with PrefetchHigh and PrefetchLow
QPID-137 Ported AcknowledgeModes git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@481035 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dotnet/Qpid.Messaging')
-rw-r--r--dotnet/Qpid.Messaging/IChannel.cs3
-rw-r--r--dotnet/Qpid.Messaging/MessageConsumerBuilder.cs25
-rw-r--r--dotnet/Qpid.Messaging/MessagePublisherBuilder.cs12
3 files changed, 25 insertions, 15 deletions
diff --git a/dotnet/Qpid.Messaging/IChannel.cs b/dotnet/Qpid.Messaging/IChannel.cs
index 247d164ae7..7fceb1a532 100644
--- a/dotnet/Qpid.Messaging/IChannel.cs
+++ b/dotnet/Qpid.Messaging/IChannel.cs
@@ -60,7 +60,8 @@ namespace Qpid.Messaging
MessageConsumerBuilder CreateConsumerBuilder(string queueName);
IMessageConsumer CreateConsumer(string queueName,
- int prefetch,
+ int prefetchLow,
+ int prefetchHigh,
bool noLocal,
bool exclusive,
bool durable,
diff --git a/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs b/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs
index 6699d63a79..4166dd0137 100644
--- a/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs
+++ b/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs
@@ -22,13 +22,16 @@ namespace Qpid.Messaging
{
public class MessageConsumerBuilder
{
- private int _prefetch = 0;
+ public const int DEFAULT_PREFETCH_HIGH = 5000;
+
private bool _noLocal = false;
private bool _exclusive = false;
private bool _durable = false;
private string _subscriptionName = null;
private IChannel _channel;
private readonly string _queueName;
+ private int _prefetchLow = 2500;
+ private int _prefetchHigh = DEFAULT_PREFETCH_HIGH;
public MessageConsumerBuilder(IChannel channel, string queueName)
{
@@ -36,31 +39,37 @@ namespace Qpid.Messaging
_queueName = queueName;
}
- public MessageConsumerBuilder withPrefetch(int prefetch)
+ public MessageConsumerBuilder WithPrefetchLow(int prefetchLow)
+ {
+ _prefetchLow = prefetchLow;
+ return this;
+ }
+
+ public MessageConsumerBuilder WithPrefetchHigh(int prefetchHigh)
{
- _prefetch = prefetch;
+ _prefetchHigh = prefetchHigh;
return this;
}
- public MessageConsumerBuilder withNoLocal(bool noLocal)
+ public MessageConsumerBuilder WithNoLocal(bool noLocal)
{
_noLocal = noLocal;
return this;
}
- public MessageConsumerBuilder withExclusive(bool exclusive)
+ public MessageConsumerBuilder WithExclusive(bool exclusive)
{
_exclusive = exclusive;
return this;
}
- public MessageConsumerBuilder withDurable(bool durable)
+ public MessageConsumerBuilder WithDurable(bool durable)
{
_durable = durable;
return this;
}
- public MessageConsumerBuilder withSubscriptionName(string subscriptionName)
+ public MessageConsumerBuilder WithSubscriptionName(string subscriptionName)
{
_subscriptionName = subscriptionName;
return this;
@@ -68,7 +77,7 @@ namespace Qpid.Messaging
public IMessageConsumer Create()
{
- return _channel.CreateConsumer(_queueName, _prefetch, _noLocal, _exclusive, _durable, _subscriptionName);
+ return _channel.CreateConsumer(_queueName, _prefetchLow, _prefetchHigh, _noLocal, _exclusive, _durable, _subscriptionName);
}
}
}
diff --git a/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs b/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs
index ecee1b5c57..ba843049ef 100644
--- a/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs
+++ b/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs
@@ -47,37 +47,37 @@ namespace Qpid.Messaging
_channel = channel;
}
- public MessagePublisherBuilder withRoutingKey(string routingKey)
+ public MessagePublisherBuilder WithRoutingKey(string routingKey)
{
_routingKey = routingKey;
return this;
}
- public MessagePublisherBuilder withExchangeName(string exchangeName)
+ public MessagePublisherBuilder WithExchangeName(string exchangeName)
{
_exchangeName = exchangeName;
return this;
}
- public MessagePublisherBuilder withDeliveryMode(DeliveryMode deliveryMode)
+ public MessagePublisherBuilder WithDeliveryMode(DeliveryMode deliveryMode)
{
_deliveryMode = deliveryMode;
return this;
}
- public MessagePublisherBuilder withTimeToLive(long timeToLive)
+ public MessagePublisherBuilder WithTimeToLive(long timeToLive)
{
_timeToLive = timeToLive;
return this;
}
- public MessagePublisherBuilder withImmediate(bool immediate)
+ public MessagePublisherBuilder WithImmediate(bool immediate)
{
_immediate = immediate;
return this;
}
- public MessagePublisherBuilder withMandatory(bool mandatory)
+ public MessagePublisherBuilder WithMandatory(bool mandatory)
{
_mandatory = mandatory;
return this;