[rabbitmq-discuss] memory flow control
tim at rabbitmq.com
Wed Sep 26 09:03:47 BST 2012
On 25 Sep 2012, at 22:47, Dmitriy Stolyarov wrote:
> Is there a way to have the producer throw an exception instead of just being blocked when high memory water mark is reached on the server? (Using java client)_______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
That isn't possible with the current incarnation of the java client, and I'm not entirely sure how one would expect that to work in practice either. But anyway the short answer is no, that's not possible. There are probably things you could do to work around it, such as having a separate worker thread on which you poll the management API to check and see if you've reached the high watermark, but it doesn't feel like a very satisfying solution overall.
What are you trying to achieve here - why do you want an exception when the high water mark is reached, how will your application respond to that?
More information about the rabbitmq-discuss