On 13 November 2013 14:20, defy <[email protected]> wrote: > Hello James, > > I am using Activemq - I know purging the queue via jmx is an option but I > am > looking for a way to create temporary blackhole queue. Of course I could > use > jmx purging or fake consumer that would just drop the messages but this > solution just seemed clearer to me as messages will not pile up between > purge cycles. >
So you don't want to delete the messages on the queue; you just want to consume some of them (and discard them)? If so your original approach sounds good. Use big transaction batches to speed things up. But consuming thousands of messages is always going to be massively more inefficient than just deleting the messages (as the broker has to marshal them all from disk, over a socket and ensure you're consumer acks the consumption). > This should be used for short time when developers use composite queues and > only have listeners on one queue. In this case producers can be rolled out > and when consumers will be ready only "blackhole" functionality will be > disabled. > So hang on; you're chucking away messages while there's no consumers - but you don't want to chuck message away when there are? Why not just use a timeout on your messages so the message broker discards any message not consumed in a reasonable time? I confess to not totally grokking what you're trying to do :). Maybe step back and give us the bigger picture of the problem you've got? Is this dealing with bad distribution of producers/consumers across queues; or dealing with occasionally disconnected clients and you want to avoid running out of disk? -- James ------- Red Hat Email: [email protected] Web: http://fusesource.com Twitter: jstrachan, fusenews Blog: http://macstrac.blogspot.com/ Open Source Integration
