ActiveMQ MQTT: How can BrokerFilter return appropriate MQTT error codes after CONNECT

Solution In Progress - Updated -

Issue

We implemented a BrokerFilter to support a custom authentication and authorization policy.

We would like the MQTT connect message to return the appropriate MQTT error code to the client if, for example, the supplied credentials were wrong.

In particular, we would like to be able to specify the return MQTT error code from within the BrokerFilter.addConnection. The MQTT error codes of our interest are:

  • 0x02 Connection Refused, identifier rejected
  • 0x04 Connection Refused, bad user name or password
  • 0x05 Connection Refused, not authorized (A catch all for all otter failures)

Which exceptions can we raise in the BrokerFilter.addConnection to control the MQTT error code returned to the client?

Environment

  • JBoss A-MQ 6.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.