Book Image

Mastering ServiceStack

By : Andreas Niedermair
Book Image

Mastering ServiceStack

By: Andreas Niedermair

Overview of this book

Table of Contents (13 chapters)


A very basic yet powerful and fully working Message Queue within ServiceStack is RedisMQ, which uses Redis and its features under the hood to implement a persistent queue. The factory and the server are located in the ServiceStack.Server NuGet package (ServiceStack.Messaging.Redis) and depend on ServiceStack.Redis and ServiceStack.Client for underlying communication and connection management (ServiceStack.Redis).

The components connected to Redis are not generally services or clients but producers and consumers of messages, where a consumer of a message can produce a subsequent message that is consumed by another component, as shown in the following figure:

As the underlying technology used is Redis, a certain persistence of the messages is guaranteed (as persistence in Redis can be).

This scenario is easily implemented with the following code (where Message A is Hello and Message B is HelloResponse):

using System;
using ServiceStack;
using ServiceStack.Messaging.Redis;
using ServiceStack...