Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IProducer.SendAsync method behavior when there is no permission to SEND. #491

Open
yashakapkov opened this issue Jun 11, 2024 · 3 comments

Comments

@yashakapkov
Copy link

Description

We encountered a situation when a user lost his permision(or hasn't been received yet) to send to a queue.
So, if connection

  • is auto recoverable (AutomaticRecoveryEnabled=true, default value) the producer's method SendAsync just capture the current thread indefinetely,
  • is not auto recoverable the producer's method SendAsync throws an exception with "The Producer was closed." message, but without any clue of why has it happened. The reason was found in a field ((ActiveMQ.Artemis.Client.ProducerBase)producer)._senderLink.Error.Description

Expected behavior

In both cases it would be great to have an exception with clear reason why this producer cannot be used.

ArtemisNetClient nuget version is 2.15.0

@yashakapkov
Copy link
Author

One more suggestion. If something happened in sending or consuming process, if connection in default(AutomaticRecoveryEnabled=true) mode, it would be great have warnigns in logs.

@Havret
Copy link
Owner

Havret commented Jun 11, 2024

Hi @yashakapkov,

  1. Please check version 2.16.0. It was fixed as part of issue Unauthorized Producer Creation Attempts Cause Log Flooding and Unresponsiveness #477.
  2. We have some logs, but most of them use the trace log level, which is probably why you didn't see it. I think it makes sense to increase the logging level to info for events like these:
    private static class Log
    {
    private static readonly Action<ILogger, Exception> _retryingConsumeAsync = LoggerMessage.Define(
    LogLevel.Trace,
    0,
    "Retrying receive after Consumer reestablished.");
    private static readonly Action<ILogger, Exception> _consumerRecovered = LoggerMessage.Define(
    LogLevel.Trace,
    0,
    "Consumer recovered.");
    private static readonly Action<ILogger, Exception> _consumerSuspended = LoggerMessage.Define(
    LogLevel.Trace,
    0,
    "Consumer suspended.");
    private static readonly Action<ILogger, Exception> _consumerResumed = LoggerMessage.Define(
    LogLevel.Trace,
    0,
    "Consumer resumed.");

I've extended logging in 2.17.0-preview1. Please let me know if you need anything else.

Best regards,
Havret

This was referenced Jun 12, 2024
@yashakapkov
Copy link
Author

Hello, @Havret.

I should have tried with newer version before creating the issue. With 2.16.0 it works as we expect.
Sorry for taking your time and thanks.

Sincerely,
Yakov Kapkov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants