Skip to content

Commit 67a4856

Browse files
net0wellclaude
andcommitted
fix(rabbitmq): registra topologia inválida quando um consumidor para (spec 005)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 88ee999 commit 67a4856

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎src/PythonScriptRunner.RabbitMQ/Diagnostics.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ internal static partial class Log
4444
[LoggerMessage(101, LogLevel.Warning, "RabbitMQ is unreachable ({Reason}); queued runs stay in the outbox until it comes back")]
4545
public static partial void BrokerUnreachable(ILogger logger, string reason);
4646

47-
[LoggerMessage(102, LogLevel.Critical, "The RabbitMQ topology is invalid; stopping the application")]
48-
public static partial void TopologyInvalid(ILogger logger, Exception exception);
47+
[LoggerMessage(102, LogLevel.Critical, "The RabbitMQ topology is invalid; the consumer of {Queue} stopped")]
48+
public static partial void TopologyInvalid(ILogger logger, string queue, Exception exception);
4949

5050
[LoggerMessage(103, LogLevel.Warning, "Outbox message {MessageId} ({MessageType}) was not published: {Error}")]
5151
public static partial void PublishFailed(ILogger logger, Guid messageId, string messageType, string error);

‎src/PythonScriptRunner.RabbitMQ/QueueConsumer.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ public async Task RunAsync(CancellationToken stoppingToken)
136136
{
137137
return;
138138
}
139-
catch (PsrConfigurationException)
139+
catch (PsrConfigurationException ex)
140140
{
141+
Log.TopologyInvalid(_logger, _settings.Queue, ex);
141142
throw;
142143
}
143144
catch (Exception ex) when (ex is BrokerUnreachableException or OperationInterruptedException or AlreadyClosedException or IOException

0 commit comments

Comments
 (0)