How to use Rebus’ timeout service #1

First way of using Rebus’ timeout service is to use the default choice, which is the external timeout service. The external timeout service is a Windows service, that you can install – preferably one on each server in your environment – and leave there, running forever.

The timeout service will receive your TimeoutRequests, store them somewhere (preferably in a database of some kind), and then send them back as a TimeoutReply when the timeout has expired.

To get up and running, you can do this:

Get the Rebus source code and build the timeout service

and then go to /Rebus/deploy/NET40/Timeout where you’ll find the binaries.

Configure the timeout service

Currently, the timeout service can store its timeouts in memory, in SQL server, and in MongoDB. The timeout service can be configured by opening up Rebus.Timeout.exe.config and editing the timeout element – e.g. you might write something like this:

or this

depending on your preferences.

Install the service

In an administrator command prompt:

and then, since rebus.timeout is the default queue name for the timeout service, all other local Rebus services can now bus.Defer(toTheFuture, theirMessages).

In the next post, I’ll explain how to configure Rebus to use the internal timeout service.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.