hazelcast分布式队列删除无效

时间:2014-07-31 15:27:42

标签: hazelcast

我正在尝试在处理消息后从IQueue中删除队列。但它没有从队列中删除。我已经调用了删除方法,如下所示,

class HazelcastSample implements ItemListener<testMessage>{

void replicateMessage(){
TestHazelcast.getInstance().getHazelcastInstance().getQueue("testQueue").put(testMessage);
}


public void itemAdded(ItemEvent<testMessage> event) {

testMessage sampleMessage = (testMessage) event.getItem();

IQueue<Object> sampleQueue= TestHazelcast.getInstance().getHazelcastInstance().getQueue("testQueue");

boolean removed = false;
removed = sampleQueue.remove(sampleMessage);
}
}

can you please help what is wrong? why remove method is not working?

Thank you,
chandra

0 个答案:

没有答案