Unordered Messages do not arrive on a different Thread

classic Classic list List threaded Threaded
3 messages Options
Oru Oru
Reply | Threaded
Open this post in threaded view
|

Unordered Messages do not arrive on a different Thread

Hi There!
While experimenting with Topic Based Messaging I found that the Listener cannot receive unordered messages if the listener is on another Java Thread.
This limitation does not hold true for ordered messaging.
I am attaching the Java Project as a Zip file.
Please let me know what's wrong.
IgniteMaven.zip
Thanks,
Debasish
vdpyatkov vdpyatkov
Reply | Threaded
Open this post in threaded view
|

Re: Unordered Messages do not arrive on a different Thread

Hello,

I can't see any  synchronization in your example.
How about use CountDownLatch for waiting subscription.
For example:
In MainTest
CountDownLatch latch = new CountDownLatch(1);
executorService.submit(new Subscribe(latch));

latch.await();
And append in Subscribe (after subscription):
latch.countDown();


On Wed, May 25, 2016 at 9:35 AM, Oru <[hidden email]> wrote:
Hi There!
While experimenting with Topic Based Messaging I found that the Listener
cannot receive unordered messages if the listener is on another Java Thread.
This limitation does not hold true for ordered messaging.
I am attaching the Java Project as a Zip file.
Please let me know what's wrong.
IgniteMaven.zip
<http://apache-ignite-users.70518.x6.nabble.com/file/n5160/IgniteMaven.zip>
Thanks,
Debasish



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Unordered-Messages-do-not-arrive-on-a-different-Thread-tp5160.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.



--
Vladislav Pyatkov
Oru Oru
Reply | Threaded
Open this post in threaded view
|

Re: Unordered Messages do not arrive on a different Thread

Hi,
Thank you for the response.
It works now.
Regards,
Debasish