MQTT not supports queue if you want to implement Queue with ActiveMQ use STOMP protocol check this link
https://github.com/asantos2000/RabbitMQGozirraStompAndroid
if you want to use Topic just used QUEUE_NAME= /topic/nameof_topic and if you want to use Queue used destination QUEUE_NAME=/queue/nameof_queue
for filter message in queue add selectors
Map<String,String> header=new HashMap<String, String>();
header.put("selector","(title = 'selector_name')");
con.subscribe(QUEUE_NAME, new Listener() {
@Override
public void message(Map header, String body ) {
Log.d(TAG,"onMessage()");
Log.d(TAG,"message is " + body);
Log.d(TAG,"header is " + header.toString());
message = "\n("+ counterReceive +")<-- " + body;
myHandler.post(myRunnable);
counterReceive++;
}
},header);
you will get only those message which header contain your selector name