BrokerFilter how to respond to client with Error Message

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

BrokerFilter how to respond to client with Error Message

davidh
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