In my project , I've created a simple pub/sub topic with radisson (https://github.com/redisson/redisson) . Publisher will publish some message and there will be multiple subscribers running on different machines . When I publish , all the subscribers are getting message . But I want anyone of the subscriber to process the message , ie if one process the message , others should simply ignore it . Is it possible with Radisson ?
LISTENER:
RTopic topic = redisson.getTopic("topic2");
topic.addListener(Person.class, new MessageListener<Person>() {
@Override
public void onMessage(CharSequence charSequence, Person person) {
System.out.println("PERSON : "+person.toString());
}
});
PUBLISHER :
Person person = new Person("anyName","female");
RedissonClient redisson = Redisson.create();
RTopic topic = redisson.getTopic("topic2");
topic.publish(person);
Is it possible to put lock or something , so that only one subscriber listens it. Will any other tools support this behavior.