These are chat archives for atomix/atomix

17th
May 2018
Ronnie
@rroller
May 17 2018 01:44
You mean without needing to state the localmember?
That does sound nice. Is the membership issue we talked about still on your radar btw?
(i'm trying to pay attention to this code so I can learn it and hopefully help out)
Johno Crawford
@johnou
May 17 2018 06:41
Bit more than that ;)
Alexander Richter
@alex-richter
May 17 2018 12:23

Hello guys, I am currently working on a project that I'd like to use the event functions of primitives for. With the latest 2.1.0-beta3 release, I am trying to execute the following code:

AtomicValue<Integer> value = atomix.getAtomicValue("test");

value.addListener(event -> System.out.println("Event fired."));

value.getAndSet(1);

From my understanding, this should print "Event fired." to the console as soon as the AtomicValueService applied the change. However, I do not see any output beeing printed at all, not my String and no error messages. Am I missing something?

Ronnie
@rroller
May 17 2018 16:23
I can't see the rest of your code Alexander, does it exit immediately after?
Alexander Richter
@alex-richter
May 17 2018 17:29
No, I placed some sleep statements behind that snipped to make sure that atomix has actually time to fire the event. But what I've noticed is: when I set the logging level to debug, the following line appears in the logs:
DEBUG NettyMessagingService - localhost:5000 - No handler for message type data-partition-2-publish-11 from localhost:5000
Does this have something to do with the problem?
When i delete the data directory with all the logs, and then run the code, it does not produce any interesting output at all. If I then quit the program and run it again, I see the above message.
The more often I run it, the more often the message appears.
rbondar
@rbondar
May 17 2018 18:05
morning, could you please clarify whether atomix.primitivesService().lockBuilder("foo-distributed-lock").build() invoked on each node creates the same lock . Can i remain an object returned from the builder and use it or should i get lock from atomix each time i want to get it ?
Ronnie
@rroller
May 17 2018 18:16
yeah it's the same lock. You can create it once on each host.
That's how I use it anyways and haven't had an issue