1

I am new to redis, and redisson but kind of up to date with what is available now.

Mostly from here: https://github.com/redisson/redisson/wiki/9.-distributed-services#91-remote-service

The case here involves a worker, on only one server out of say many. The worker gets to images which can be downloaded later on. They can be pushed to an executor to download later, however, that is not persistable and so we will loose out.

Redis offers executorservice. But I was wondering, does all redis nodes share or ship in to peform the work by default? Is there a way to control that only one gets to do the work? The stuff in the runnable / callable that is being accessed, I am guessing there has to be restrictions on what could be used since it is a closure with access to environment? No access?

Redis also offers something called distributed remote services. How are they different from an executorservice in this regard?

Another option is to push these to reddis list / queue / dequeu, and work of the "messages" albeit the executor service I think would allow me to have all that logic in the same place.

What is the best approach?

What are the rules for objects inside the closure supplied in a runnable / callable ? Fully serialiazeble everything ?

How do I manage if a worker is working, and suddenly dies (nuclear). Can I ensure that someone else gets to work?

mjs
  • 21,431
  • 31
  • 118
  • 200
  • 1
    If you're using Spring then you can consider using https://github.com/sonus21/rqueue. – sonus21 Aug 24 '20 at 17:02
  • Ok, yes, I actually started consider using a BlockingDeque. No need for Spring. Just an add and pull i guess. But I am bit hesistant regarding serializable. Does objects pushed to the queue have to be fully serializable? The stuff to the queue. Seems Redisson doesnt seem to try block it in the api, V extends Serializable for instance. – mjs Aug 24 '20 at 18:33
  • 1
    Yes, your object should be serializable, I would say you should consider machine-independent serialization mechanics like JSON, Message pack XML etc. Using JDK serialization can create problem when you're consuming tasks on other box. – sonus21 Aug 25 '20 at 17:14

0 Answers0