hazelcast version: 3.6.4
I am using client server topology in myproject and trying to execute some operations on my hazelcast server.
I am putting the serialized bean on my hazelcast queue from client as below
IQueue<SerializedBean> queue = HzUtil.getInstance().getQueue("myqueue");
boolean status = queue.offer(serializedBean,<timeoutvalue>,TimeUnit.MILLISECONDS );
on my hazelcast server I have registered listener and I am running hazelcast in cluster mode.
<hz:queue name="myqueue">
<hz:item-listeners>
<hz:item-listener implementation="myqueueImpl" include-value="true"/>
</hz:item-listeners>
</hz:queue>
public class MyqueueImpl implements ItemListener<SerializedBean> {
public void itemAdded(ItemEvent<SerializedBean> inputMessage) {
System.out.println("Item added to the queue ");
//sometask
}
public void itemRemoved(ItemEvent<SerializedBean> removedItem) {
System.out.println("Item removed from the queue ");
}
}
Issue:
what I have observed that the queue item is received and picked up and executed on both the members of the cluster. I want the item to be picked up only once once on any of the cluster member. Please let me know what exactly I am missing
You have to add 'local' listener, otherwise all members will receive the event.
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+unsubscribe@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/98dcd968-c6d6-493a-851f-377dc459da78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You have to add 'local' listener, otherwise all members will receive the event.
On Sep 24, 2016 01:30, "Dummy" <nitin...@gmail.com> wrote:
--hazelcast version: 3.6.4
I am using client server topology in myproject and trying to execute some operations on my hazelcast server.
I am putting the serialized bean on my hazelcast queue from client as below
IQueue<SerializedBean> queue = HzUtil.getInstance().getQueue("myqueue"); boolean status = queue.offer(serializedBean,<timeoutvalue>,TimeUnit.MILLISECONDS );
on my hazelcast server I have registered listener and I am running hazelcast in cluster mode.
<hz:queue name="myqueue"> <hz:item-listeners> <hz:item-listener implementation="myqueueImpl" include-value="true"/> </hz:item-listeners> </hz:queue> public class MyqueueImpl implements ItemListener<SerializedBean> { public void itemAdded(ItemEvent<SerializedBean> inputMessage) { System.out.println("Item added to the queue "); //sometask } public void itemRemoved(ItemEvent<SerializedBean> removedItem) { System.out.println("Item removed from the queue "); } }
Issue:
what I have observed that the queue item is received and picked up and executed on both the members of the cluster. I want the item to be picked up only once once on any of the cluster member. Please let me know what exactly I am missing
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
I am using client server topology in myproject and trying to execute some operations on my hazelcast server.
I am putting the serialized bean on my hazelcast queue from client as below
IQueue<SerializedBean> queue = HzUtil.getInstance().getQueue("myqueue");
boolean status = queue.offer(serializedBean,<timeoutvalue>,TimeUnit.MILLISECONDS );
on my hazelcast server I have registered listener and I am running hazelcast in cluster mode.
<hz:queue name="myqueue">
<hz:item-listeners>
<hz:item-listener implementation="myqueueImpl" include-value="true"/>
</hz:item-listeners>
</hz:queue>
public class MyqueueImpl implements ItemListener<SerializedBean> {
public void itemAdded(ItemEvent<SerializedBean> inputMessage) {
System.out.println("Item added to the queue ");
//sometask
}
public void itemRemoved(ItemEvent<SerializedBean> removedItem) {
System.out.println("Item removed from the queue ");
}
}
Issue:
what I have observed that the queue item is received and picked up on both the members of the cluster. I want the item to be picked up only once once on any of the cluster member.
Please let me know what exactly I am missing.
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/9d63dee0-6a1c-4c70-aa1c-59f833a0313d%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+unsubscribe@googlegroups.com.
Are you confusing queue *listeners* with actual push/pop/offer/take operations on the queue ?
On Fri, Sep 23, 2016 at 5:20 PM, <nitin...@gmail.com> wrote:
I am using client server topology in myproject and trying to execute some operations on my hazelcast server.
I am putting the serialized bean on my hazelcast queue from client as below
IQueue<SerializedBean> queue = HzUtil.getInstance().getQueue("myqueue"); boolean status = queue.offer(serializedBean,<timeoutvalue>,TimeUnit.MILLISECONDS );
on my hazelcast server I have registered listener and I am running hazelcast in cluster mode.
<hz:queue name="myqueue"> <hz:item-listeners> <hz:item-listener implementation="myqueueImpl" include-value="true"/> </hz:item-listeners> </hz:queue> public class MyqueueImpl implements ItemListener<SerializedBean> { public void itemAdded(ItemEvent<SerializedBean> inputMessage) { System.out.println("Item added to the queue "); //sometask } public void itemRemoved(ItemEvent<SerializedBean> removedItem) { System.out.println("Item removed from the queue "); } }
Issue:
what I have observed that the queue item is received and picked up on both the members of the cluster. I want the item to be picked up only once once on any of the cluster member.
Please let me know what exactly I am missing.
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/4b51ff61-ee74-4698-9444-68c01b925153%40googlegroups.com.