activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davidh <>
Subject BrokerFilter how to respond to client with Error Message
Date Wed, 11 Oct 2017 12:33:35 GMT

I have implemented a BrokerFilter which Authenticates a connection on
"addConnection" and Authorises on "addConsumer".

This works but my question is about error handling - "addConnection" returns
a void and throws Exception.  If I raise an exception (with a message) the
exception not only gets written to the log but also returns full stacktrace
to the client.  

Is there any way to only return the message? - returning the stacktrace
doesn't feel right for a security plugin.  At the moment I am catching
Exceptions within the function, logging them then setting
"context.setDontSendResponse(true);" so the client doesn't get any detail on
the error.

I would like my client to be able to handle the errors differently - e.g.
"Token Expired" would be different from ActiveMQ not being available to the

Sent from:

View raw message