mqServer Does not Start

I am using the worker-redismq sample .Net Core app. (ServiceStack 5.9)

I have not changed any code within it, however, when running it the mqServer.Start() call never returns. I have tested redis at the command line level and that is working fine, also the tests contained in the repo, successfully connect and publish messages to the queue.

Any thoughts on what is preventing the Start from returning ?

    protected override async Task ExecuteAsync(CancellationToken stoppingToken)
    {
        this.mqServer.Start();

        while (!stoppingToken.IsCancellationRequested)
        {
            logger.LogInformation("MQ Worker running at: {stats}", this.mqServer.GetStatsDescription());
            await Task.Delay(MqStatsDescriptionDurationMs, stoppingToken);
        }

It appears to be buried in:

            serverTimeAtStart = IsSentinelSubscription
                ? DateTime.UtcNow
                : redis.GetServerTime();

redis.GetServerTime is raising an exception, but is suppressing it.

I’ve just created a new worker-redismq project and tested to see it’s still working as expected.

Can you try seeing if you can connect Redis and set/get a key.

ConfigureAppHost = host =>
{
    host.Register<IRedisClientsManager>(
        new RedisManagerPool(hostContext.Configuration.GetConnectionString("RedisMq")));

    using (var redis = host.Resolve<IRedisClientsManager>().GetClient())
    {
        redis.SetValue("test","A");
        var test = redis.GetValue("test");
    }
//....

Do you have the Exception StackTrace?

Hi Mythz, thanks for the response, I’m going to try to replace my redis version first, I read another thread on the forums from someone who reporting something similar and he had an older version of redis. I will report back soon

Hi Mythz,

    private void Init()
    {
        using (var redis = ClientsManager.GetReadOnlyClient())
        {
            startedAt = Stopwatch.StartNew();
            serverTimeAtStart = IsSentinelSubscription
                ? DateTime.UtcNow
                : redis.GetServerTime();
        }

the error is caused by the GetServerTIme function in RedisPubSubServer when a low version of REDIS that does not support the time function is running.

I have resolved the issue by upgrading my Redis version.

But how can I control this IsSentinelSubscription setting ?