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

Uncatchable exception thrown when connecting with an invalid RMQDestination queue. #53

Closed
DerekRushton opened this issue Jul 20, 2018 · 3 comments
Assignees
Milestone

Comments

@DerekRushton
Copy link

Hi, I've ran into an issue where when I attempt to set up a message listener on an RMQDestination with an invalid destname the errors can not be caught and instead get thrown I am assuming from SLF4J. The core of the issue is that I need a way to see that an error has occurred on that connection so that I can identify when an invalid queue has been entered. Currently that error will get posted, but to our back end logging, where it will post it multiple times ( due to the persistent nature of AMQP ) and is uncatchable within the code.

I've tried forcing other errors and everything else is caught before it sets up the message listener or after, an invalid destination name seems to be the only cause of making an uncatchable error.

This is the exact error I am hitting.

https://github.com/rabbitmq/rabbitmq-jms-client/blob/master/src/main/java/com/rabbitmq/jms/client/RMQMessageConsumer.java

GetResponse getFromRabbitQueue() {
    String qN = rmqQueueName();
    try {
        return getSession().getChannel().basicGet(qN, false);
    } catch (Exception e) { // includes unchecked exceptions, e.g. ShutdownSignalException
        if (!(e instanceof ShutdownSignalException) && !(e.getCause() instanceof ShutdownSignalException)) {
            logger.error("basicGet for queue '{}' threw unexpected exception", qN, e);
        }
    }

return null;

@acogoluegnes
Copy link
Contributor

Thank you for your time.

Team RabbitMQ uses GitHub issues for specific actionable items engineers can work on. This assumes that we have a certain amount of information to work with.

Getting all the details necessary to reproduce an issue, make a conclusion or even form a hypothesis about what's happening can take a fair amount of time. Our team is multiple orders of magnitude smaller than the RabbitMQ community. Please help others help you by providing a way to reproduce the behavior you're
observing and sharing as much relevant information as possible on the list:

  • Server, client library and plugin (if applicable) versions used
  • Server logs
  • A code example or terminal transcript that can be used to reproduce
  • Full exception stack traces (not a single line message)
  • rabbitmqctl status (and, if possible, rabbitmqctl environment output)
  • Other relevant things about the environment and workload, e.g. OS/systemd logs, a traffic capture, deployment tool logs, etc

Feel free to edit out hostnames and other potentially sensitive information.

When/if we have a complete enough understanding of what's going on, a recommendation will be provided or a new issues with more context will be filed.

Thank you.

@acogoluegnes
Copy link
Contributor

acogoluegnes commented Jul 23, 2018

@AccountToAskQuestions Thanks for reporting this. We need more information, like a way to reproduce and what you'd like to do, to make this an actionable item. Please move this to the mailing list. Thanks.

@acogoluegnes
Copy link
Contributor

@acogoluegnes acogoluegnes self-assigned this Jul 30, 2018
@acogoluegnes acogoluegnes added this to the 1.10.0 milestone Jul 30, 2018
acogoluegnes added a commit that referenced this issue Sep 6, 2018
The flag can be set in the RMQConnectionFactory. An exception will be
thrown or ignored when a consumer startup fails, depending on the value
of the flag.

This flag allows to maintain backward compatibility, but the behavior in
2.0 will be to throw an exception (see #62).

[#159272755]

References #62

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

No branches or pull requests

3 participants