Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
Properties
Extensions.cs
README.md
RedisClient.cs
RedisConnection.cs
RedisRequest.cs
RedisResponse.cs
RedisServer.cs
ServiceProxy.Redis.csproj
packages.config

README.md

ServiceProxy.Redis

ServiceProxy.Redis is a simple request/reply messaging framework built on Redis queues that supports service contracts using ServiceProxy.

Getting started

The quickest way to get started is to use the Nuget package.

Example from a unit test in ServiceProxy.Redis.Tests

public async void TestSendAndReceive()
{
    var resolver = new DependencyResolver();

    using (var server = new RedisServer(new RedisConnection(RedisHost, RedisPort, RedisPassword), ServerQueue, new ServiceFactory(resolver)))
    {
        server.Listen();

        using (var client = new RedisClient(new RedisConnection(RedisHost, RedisPort, RedisPassword), ClientQueue, ServerQueue))
        {
            var clientFactory = new ServiceProxy.ServiceClientFactory(client);

            var serviceClient = clientFactory.CreateServiceClient<ITestService2>();

            Assert.That(serviceClient.GetPerson(1), Is.Not.Null);

            var persons = await serviceClient.ListPersonsAsync(5);
            Assert.That(persons, Is.Not.Null);
            Assert.AreEqual(5, persons.Count());
        }
    }
}

The client and server should be created in different processes/machines, using Redis as a middleware and ServiceProxy to support service contracts.

It supports load balancing by having multiple servers listening on the same Redis queue.

Dependencies

ServiceProxy.Redis now uses the StackExchange.Redis client library, the successor of the Booksleeve Redis client library.