You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by davidh <da...@agenor.co.uk> on 2017/10/11 12:33:35 UTC

BrokerFilter how to respond to client with Error Message

hi

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
client.  



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html