Clock – A Super Simple Carrier Extension
December 16, 2009
Let’s set aside TwitterAgent for a bit and create the simplest extension to Dovetail Carrier possible, a timepiece, a clock, a chronometer of sorts. The intent of this post is to document in one place all the pieces required to create a Carrier Extension.The MarkerFor now we need to mark the assembly with an attribute announcing it as a Carrier extension. [assembly: CarrierExtension]You just need to put this code somewhere but it usually goes in your AssemblyInfo.cs file.The MessageWe first need to create the message we’ll be publishing and consuming. public class ClockMessage { public string Announcement { get; set; } }The PublisherNext up we need to create a service which will publish these messages. public class ClockMessageService : IMessagePublishingService<ClockMessage> { private readonly MessageBusSettings _messageBusSettings; private readonly IEndpointFactory _endpointFactory; private readonly ILogger _logger; private Timer _timer; public ClockMessageService(MessageBusSettings messageBusSettings, IEndpointFactory…