Permalink
Browse files

Configure MassTransit to request a heartbeat

  • Loading branch information...
1 parent 7399b4b commit dc523cffd6205a142e70f45c735f87a1eb40a712 @jrusbatch committed Aug 7, 2013
Showing with 7 additions and 2 deletions.
  1. +4 −1 Web/App_Start/MessagingConfig.cs
  2. +3 −1 Worker/Program.cs
@@ -41,16 +41,19 @@ public static void ConfigureServiceBus()
{
sbc.UseRabbitMq(x => x.ConfigureHost(new Uri(queueUri), y =>
{
+ y.SetRequestedHeartbeat(30);
+
if (!string.IsNullOrEmpty(username))
{
y.SetUsername(username);
}
-
+
if (!string.IsNullOrEmpty(password))
{
y.SetPassword(password);
}
}));
+ sbc.SetCreateMissingQueues(true);
sbc.ReceiveFrom(endpointAddress);
});
View
@@ -65,14 +65,15 @@ private static void ConfigureServiceBus()
password = credentials[1];
}
-
var endpointAddress = string.Format("{0}/{1}", connectionString, queueName);
Bus.Initialize(
sbc =>
{
sbc.UseRabbitMq(x => x.ConfigureHost(new Uri(queueUri), y =>
{
+ y.SetRequestedHeartbeat(30);
+
if (!string.IsNullOrEmpty(username))
{
y.SetUsername(username);
@@ -83,6 +84,7 @@ private static void ConfigureServiceBus()
y.SetPassword(password);
}
}));
+ sbc.SetCreateMissingQueues(true);
sbc.ReceiveFrom(endpointAddress);
sbc.Subscribe(subs => subs.Handler<EvaluateCodeCommand>(ProcessCommand));
});

0 comments on commit dc523cf

Please sign in to comment.