title: ActiveMQ prevent consumer handling specific message
body: <p>We have a design challenge where the situation is as follow:</p>
  
  <p>There are multiple producers and multiple consumers (on same queue).</p>
  
  <p>Each message represent a task with parameters that consumer needs to handle.</p>
  
  <p>The problem is that there are certain tasks that take lots of memory (and cpu power) which we know the consumer have no capacity to handle this. the good thing is that we know how much memory (and cpu power) it approximately can take in advance, so we could prevent a consumer taking that task and giving a change to other consumer with enough memory to handle.</p>
  
  <p>There is the prefetch setting but i can't see how it can configure to meet this requirement</p>
  
  <p>Finally I found an option to <em>rollback</em> a transaction, so the consumer can basically check if it has enough hardware resources to handle the task and if not rollback which retrieves the message back to queue allowing next consumer take it and so forth. </p>
  
  <p>Not sure if that's the right approach or there is a better way?</p>