This package will contain common modules that extend Shuttle.Esb functionality.
The module will attach the PurgeInboxObserver
to the OnAfterInitializeQueueFactories
event of the StartupPipeline
and purges the inbox work queue if the relevant queue implementation has implemented the IPurgeQueue
interface. If it hasn't a warning is logged.
var bus = ServiceBus
.Create(c => c.AddModule(new PurgeInboxModule())
.Start();
The module will attach the PurgeQueuesObserver
to the OnAfterInitializeQueueFactories
event of the StartupPipeline
and purges the configured queues if the relevant queue implementation has implemented the IPurgeQueue
interface. If it hasn't a warning is logged.
<configuration>
<configSections>
<section name="purgeQueues" type="Shuttle.Esb.Modules.PurgeQueuesSection, Shuttle.Esb.Modules"/>
</configSections>
<purgeQueues>
<queues>
<queue uri="msmq://./inbox" />
<queue uri="sql://./inbox" />
</queues>
</purgeQueues>
</configuration>
var bus = ServiceBus
.Create(c => c.AddModule(new PurgeQueuesModule())
.Start();
The module will attach the MessageForwardingObserver
to the OnAfterHandleMessage
and then send the handled message on to any defined endpoints.
<configuration>
<configSections>
<section name="messageForwarding" type="Shuttle.Esb.Modules.MessageForwardingSection, Shuttle.Esb.Modules"/>
</configSections>
<messageForwarding>
<forwardingRoutes>
<messageRoute uri="msmq://./inbox">
<add specification="StartsWith" value="Shuttle.Messages1" />
<add specification="StartsWith" value="Shuttle.Messages2" />
</messageRoute>
<messageRoute uri="sql://./inbox">
<add specification="TypeList" value="DoSomethingCommand" />
</messageRoute>
</forwardingRoutes>
</messageForwarding>
</configuration>
var bus = ServiceBus
.Create(c => c.AddModule(new MessageForwardingModule())
.Start();
The module will attach the ActiveTimeRangeObserver
to the OnPipelineStarting
event of all pipelines except the StartupPipeline
and abort the pipeline if the current time is not within the active time range.
<appSettings>
<add key="ActiveFromTime" value="*"/>
<add key="ActiveToTime" value="*"/>
</appSettings>
The default value of *
indicates the whole day and your pipelines will never be stopped.
var bus = ServiceBus
.Create(c => c.AddModule(new ActiveTimeRangeModule())
.Start();
It will log any transport messages that fail deserailization via the ServiceBus..Events.TransportMessageDeserializationException
event to a folder as specified in the application configuration appSettings
key with name CorruptTransportMessageFolder
:
<appSettings>
<add key="CorruptTransportMessageFolder" value="d:\shuttle-corrupt-messages"/>
</appSettings>
var bus = ServiceBus
.Create(c => c.AddModule(new CorruptTransportMessageModule())
.Start();