Skip to content

Commit 49945c4

Browse files
committed
[Host.Redis] Error logged every time while processing redi pub/sub topic #140
Signed-off-by: Tomasz Maruszak <[email protected]>
1 parent dd2338b commit 49945c4

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/Host.Transport.Properties.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<Import Project="Common.Properties.xml" />
55

66
<PropertyGroup>
7-
<Version>1.22.0</Version>
7+
<Version>1.22.1</Version>
88
</PropertyGroup>
99
</Project>

src/SlimMessageBus.Host.Redis/Consumers/RedisListCheckerConsumer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public async Task Start()
4949
_cancellationTokenSource?.Cancel();
5050
_cancellationTokenSource = new CancellationTokenSource();
5151
}
52-
_task = await Task.Factory.StartNew(() => Run(), _cancellationTokenSource.Token, TaskCreationOptions.LongRunning, TaskScheduler.Current).ConfigureAwait(false);
52+
_task = await Task.Factory.StartNew(Run, _cancellationTokenSource.Token, TaskCreationOptions.LongRunning, TaskScheduler.Current).ConfigureAwait(false);
5353
}
5454

5555
public async Task Stop()

src/SlimMessageBus.Host.Redis/Consumers/RedisTopicConsumer.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ private async Task OnMessage(ChannelMessage m)
6565
{
6666
exception = e;
6767
}
68-
_logger.LogError(exception, "Error occured while processing the redis pub/sub topic {Topic}", _topic);
68+
if (exception != null)
69+
{
70+
// In the future offer better error handling support - retries + option to put failed messages on a DLQ.
71+
_logger.LogError(exception, "Error occured while processing the redis channel {Topic}", _topic);
72+
}
6973
}
7074

7175
#region IAsyncDisposable

0 commit comments

Comments
 (0)