-
Notifications
You must be signed in to change notification settings - Fork 9
Queue Auto Scaler
jefking edited this page Dec 7, 2014
·
7 revisions
You have a queue where you need to dequeue more often than a message a second, and typical usage varies greatly. You can choose to dequeue single messages, or messages in batches. Each scale unit is governed by a number of messages, i.e. for every 10 messages in the queue run an additional dequeuer.
This is also really beneficial when you have multiple environments, where CI and QA don't generally have the load of production, they will scaled back to a single dequeuer and production will run multiple dequeuers.
public class ScalableQueue : QueueAutoScaler<Configuration>
{
public ScalableQueue()
: base(new StorageQueue("name", "connection"))
{
}
public override IEnumerable<IScalable> ScaleUnit(Configuration data)
{
var queue = new StorageQueue("name", "connection");
yield return new BackoffRunner(new CompanyDequeuer(queue));
}
}
For more information about the auto scaling capabilities: view here.