You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by kmandalas <Ky...@IRIworldwide.com> on 2017/03/16 08:59:38 UTC

Cache Queues and Load Balancing

Hello fellow igniters,
<br/><br/>
At https://apacheignite.readme.io/docs/queue-and-set, section: "Cache Queues
and Load Balancing" is mentioned that: "we can have threads on remote nodes
call IgniteQueue.take()". Could you please elaborate on that? Is there
somewhere an example?
<br/><br/>
Thank you.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cache-Queues-and-Load-Balancing-tp11223.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Cache Queues and Load Balancing

Posted by Alexander Fedotov <al...@gmail.com>.
Hello,

Yes, it's guaranteed that only one node will take each distinct value from
the IgniteQueue.
https://apacheignite.readme.io/docs/queue-and-set#section-cache-queues-and-load-balancing

On Tue, Mar 21, 2017 at 10:00 PM, kmandalas <
Kyriakos.Mandalas@iriworldwide.com> wrote:

> Hello Alex and thanks for the reply.
>
> i am checking the links you sent. If I do follow the IgniteQueue approach
> to
> put tasks in a distributed queue and have nodes take them for execution, am
> I absolutely covered that only one grid node will take an item-task from
> the
> queue? From the example I see, we use broadcast() passing data and
> callables
> to notify all nodes that an item has been placed in the queue. Then each
> node, upon receiving the broadcast message, the callable it will run will
> attempt to take an item from the queue and do some work on it. I suppose
> that since IgniteQueue is thread-safe and all, then there won't be any
> issue.
>
> Please for your opinion.
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Cache-Queues-and-Load-Balancing-tp11223p11345.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Kind regards,
Alex.

Re: Cache Queues and Load Balancing

Posted by kmandalas <Ky...@IRIworldwide.com>.
Hello Alex and thanks for the reply.

i am checking the links you sent. If I do follow the IgniteQueue approach to
put tasks in a distributed queue and have nodes take them for execution, am
I absolutely covered that only one grid node will take an item-task from the
queue? From the example I see, we use broadcast() passing data and callables
to notify all nodes that an item has been placed in the queue. Then each
node, upon receiving the broadcast message, the callable it will run will
attempt to take an item from the queue and do some work on it. I suppose
that since IgniteQueue is thread-safe and all, then there won't be any
issue.

Please for your opinion.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cache-Queues-and-Load-Balancing-tp11223p11345.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Cache Queues and Load Balancing

Posted by afedotov <al...@gmail.com>.
HI,

For examples, take a look at
https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteQueueExample.java
and
https://github.com/apache/ignite/blob/master/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeAbstractSelfTest.java
Also, you can investigate other *CacheQueue*Test for additional details.

On Thu, Mar 16, 2017 at 11:59 AM, kmandalas [via Apache Ignite Users] <
ml-node+s70518n11223h47@n6.nabble.com> wrote:

> Hello fellow igniters,
> <br/><br/>
> At https://apacheignite.readme.io/docs/queue-and-set, section: "Cache
> Queues and Load Balancing" is mentioned that: "we can have threads on
> remote nodes call IgniteQueue.take()". Could you please elaborate on that?
> Is there somewhere an example?
> <br/><br/>
> Thank you.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Cache-
> Queues-and-Load-Balancing-tp11223.html
> To start a new topic under Apache Ignite Users, email
> ml-node+s70518n1h65@n6.nabble.com
> To unsubscribe from Apache Ignite Users, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Kind regards,
Alex.




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cache-Queues-and-Load-Balancing-tp11223p11273.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.