On 9/22/06, James Strachan <[EMAIL PROTECTED]> wrote:
On 9/22/06, colincrist <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I'm looking for a way to configure/implement a throttle on the number of
> messages a client (over any transport) can send or receive messages,
> initially just by a rate (e.g. 10 per second) but possibly in the future by
> bandwidth (e.g. 1G per day) based on users or remote IP addresses/ranges.
>
> I would also be nice to be able to collect these statistics in reports.
>
> I'm considering placing an broker on a publicly accesible server as a
> default Hermes provider for new users to experiment with and would rather it
> was not swamped :-) It could also be a good example of using SSL etc.
Ah I understand :)
> Any pointers to where in the codebase this could be implemented would be
> very welcome.
It should be relatively easy to add an interceptor to the broker to do
this kinda thing...
http://incubator.apache.org/activemq/interceptors.html
where you could overload the send() method and keep around counts for
the messages/message sizes per connection/session/producer whatever
Agreed.. The coupled with user security so that users need a valid
userid/password would also allow you to track usage to a specific
user. If there were any limits exceeded your custom broker plugin
could (1) disconnect the user and (2) send a message to queue that
disabled the user account.
you want. The only real question is what to do if a user exceeds their
quota - close them?
Yeah. and disable the account. So that subsequent connect fails too :)
--
James
-------
http://radio.weblogs.com/0112098/
--
Regards,
Hiram
Blog: http://hiramchirino.com