Skip to content

Commit

Permalink
Add additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
preardon committed Jan 7, 2025
1 parent b9ab92c commit 651ee16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ public void Purge()
/// </summary>
public void Dispose()
{
s_logger.LogInformation("Disposing the consumer...");
s_logger.LogInformation("Disposing the consumer for Channel {ChannelName}", _topicName);
_serviceBusReceiver?.Close();
s_logger.LogInformation("Consumer disposed.");
s_logger.LogInformation("Consumer disposed for Channel {ChannelName}", _topicName);
}

private void GetMessageReceiverProvider()
Expand Down
4 changes: 3 additions & 1 deletion src/Paramore.Brighter.ServiceActivator/MessagePump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ public void Run()
if (message == null)
{
Channel.Dispose();
throw new Exception("Could not receive message. Note that should return an MT_NONE from an empty queue on timeout");
var exception = new Exception("Could not receive message. Note that should return an MT_NONE from an empty queue on timeout");
s_logger.LogCritical(exception, "MessagePump: Could not receive message");
throw exception;
}

// empty queue
Expand Down

0 comments on commit 651ee16

Please sign in to comment.