You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by pitabwire <bw...@caricah.com> on 2015/10/03 19:52:45 UTC

Ignite executor does not working with RxJava as a scheduler

While developing an  MQTT broker <https://github.com/caricah/iotracah>  
based on apache Ignite. I would really like to leverage ignite's compute
grid via the ExecutorService api however the challenge currently is
observables are not getting executed if I use Ignite's ExecutorService,
however if I switch to RxJava's Schedulers.io() or any defaults things just
work.

Any pointers in the right direction are highly appreciated, or if there is
already a known/particular way to use ignite with RxJava, that would go a
long way too.  



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-executor-does-not-working-with-RxJava-as-a-scheduler-tp1543.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite executor does not working with RxJava as a scheduler

Posted by pitabwire <bw...@caricah.com>.
Officially thank you sir for sparing your time, It almost always is a user
problem. Now I can confidently work knowing I can handle 1b tps. 

That was the problem, I assumed by assigning the node a name during startup
it automatically assumes the role.

@Setrakyan thanks again.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-executor-does-not-working-with-RxJava-as-a-scheduler-tp1543p1550.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite executor does not working with RxJava as a scheduler

Posted by Dmitriy Setrakyan <ds...@apache.org>.
Which Ignite configuration are you using? I am seeing this line:

------
getIgnite().cluster().forAttribute("ROLE", getExcecutorServerName());
------

Can you show where are you assigning the "ROLE" attribute to Ignite node?

D.

On Sun, Oct 4, 2015 at 1:07 PM, pitabwire <bw...@caricah.com> wrote:

> Well If I run the example it actually works. I haven't moved to testing in
> a
> multi node environment but my problem is with regards to integration with
> RxJava <https://github.com/ReactiveX/RxJava>   library which I am using to
> leverage its reactive features.
>
> Within the  broker <https://github.com/caricah/iotracah>   during
> initialization at the  class
> <
> https://github.com/caricah/iotracah/blob/master/core/src/main/java/com/caricah/iotracah/core/init/ServersInitializer.java
> >
> on line 379, if I use the created ignite executor the application is not
> processing the requests however if i substitute with java's default
> executor
> on line 380 it works, same thing happens for the default RxJava's io
> schedular on line 381 as it also works.
>
> In isolation the ignite executor service actually works the way its
> expected
> however when used within RxJava's schedular it seems not to respond
> appropriately. And that is the source of my problems.
>
> You can actually test the application by running "./gradlew clean install
> assemble run" and using mosquitto client to subscribe using the command
> "mosquitto_sub -t /life/# -q 2 -i total-subscriber -u bwire -P power -d" on
> another terminal.
>
> Then just comment out the above lines appropriately to verify. e.g. to test
> ignite executor enable line 379 to test the default executor enable line
> 380.
>
>
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-executor-does-not-working-with-RxJava-as-a-scheduler-tp1543p1545.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: Ignite executor does not working with RxJava as a scheduler

Posted by pitabwire <bw...@caricah.com>.
Well If I run the example it actually works. I haven't moved to testing in a
multi node environment but my problem is with regards to integration with 
RxJava <https://github.com/ReactiveX/RxJava>   library which I am using to
leverage its reactive features. 

Within the  broker <https://github.com/caricah/iotracah>   during
initialization at the  class
<https://github.com/caricah/iotracah/blob/master/core/src/main/java/com/caricah/iotracah/core/init/ServersInitializer.java>  
on line 379, if I use the created ignite executor the application is not
processing the requests however if i substitute with java's default executor
on line 380 it works, same thing happens for the default RxJava's io
schedular on line 381 as it also works. 

In isolation the ignite executor service actually works the way its expected
however when used within RxJava's schedular it seems not to respond
appropriately. And that is the source of my problems.   

You can actually test the application by running "./gradlew clean install
assemble run" and using mosquitto client to subscribe using the command
"mosquitto_sub -t /life/# -q 2 -i total-subscriber -u bwire -P power -d" on
another terminal.

Then just comment out the above lines appropriately to verify. e.g. to test
ignite executor enable line 379 to test the default executor enable line
380.





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-executor-does-not-working-with-RxJava-as-a-scheduler-tp1543p1545.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite executor does not working with RxJava as a scheduler

Posted by Dmitriy Setrakyan <ds...@apache.org>.
On Sat, Oct 3, 2015 at 7:52 PM, pitabwire <bw...@caricah.com> wrote:

> While developing an  MQTT broker <https://github.com/caricah/iotracah>
> based on apache Ignite. I would really like to leverage ignite's compute
> grid via the ExecutorService api however the challenge currently is
> observables are not getting executed if I use Ignite's ExecutorService,
> however if I switch to RxJava's Schedulers.io() or any defaults things just
> work.
>

Are you using the latest version of Ignite (1.4)?

Ignite ExecutorService should work with all defaults. Does this example,
which comes with Ignite, work for you?

https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteExecutorServiceExample.java

The only reason I can see for this example not working is if the nodes do
not discover each other. Can you confirm that discovery happens (look for
topology snapshot print out in the log)? Are there any other errors in the
log?

D.


>
> Any pointers in the right direction are highly appreciated, or if there is
> already a known/particular way to use ignite with RxJava, that would go a
> long way too.
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-executor-does-not-working-with-RxJava-as-a-scheduler-tp1543.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>