Is it possible to use RedisMqServer as simple task scheduler? For example to publish a message and execute it in feature (at specific time)?
Asked
Active
Viewed 45 times
1 Answers
0
RedisMQ doesn't provide any explicit support for delayed messages itself, but you could use simulate it with a Timer, e.g:
var sendInMs = 30 * 1000;
new System.Threading.Timer(msg => mqClient.Publish(msg),
msg,
sendInMs,
Timeout.Infinite);

mythz
- 141,670
- 29
- 246
- 390
-
hmm, there is some risk if code is executed on asp.net and for example application pool is recycled or iis restarted. I was planning publishing (scheduling) message to durable store (redis). I will probably use simpler approach using task scheduler and wget64.exe ... Anyway thanks for answer – marcinn Jan 08 '15 at 21:59