combining Akka Persistence with Akka Scheduling

1,109 views
Skip to first unread message

Greg Flanagan

unread,
Jul 24, 2014, 7:05:59 PM7/24/14
to akka...@googlegroups.com
I'm interested in combining Akka persistence which Akka Scheduling and wanted to know if there was an interest out there for something like this? I basically need a scheduler that doesn't loose state after a vm crash. I've used Quartz before and it's too much framework for what I want. Any requests of features people would like to see in this type of module? Has it already been done and I just haven't searched google enough?

Cheers,
Greg


Konrad Malawski

unread,
Jul 25, 2014, 4:18:47 AM7/25/14
to Akka User List
Hello Greg,
short question - do you aim to provide something as powerful as quartz using this?
I mean "on monday at 13:02" etc. Because that's not really what our scheduler is designed to do - we only work with "in X amount of time".

Instead maybe you'd simply like to integrate quartz with akka, as this extension does: https://github.com/typesafehub/akka-quartz-scheduler
And let it do it's job :-)


--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Cheers,
Konrad 'ktoso' Malawski
hAkker @ Typesafe


Greg Flanagan

unread,
Jul 25, 2014, 10:20:14 AM7/25/14
to akka...@googlegroups.com
Hey Konrad, I wasn't planning on making it as powerful as quartz but simply making what's available in the scheduler persistent, so that work that is deferred (i.e. scheduled) will not be lost on jvm shutdown. my use case doesn't require Quartz (i.e. run at 4:50 am on Tuesday), but I do need the deferred jobs to persisted through jvm restarts.

cheers,
Greg

Akka Team

unread,
Jul 25, 2014, 10:40:39 AM7/25/14
to Akka User List
Hi Greg,


On Fri, Jul 25, 2014 at 4:20 PM, Greg Flanagan <vent...@gmail.com> wrote:
Hey Konrad, I wasn't planning on making it as powerful as quartz but simply making what's available in the scheduler persistent, so that work that is deferred (i.e. scheduled) will not be lost on jvm shutdown. my use case doesn't require Quartz (i.e. run at 4:50 am on Tuesday), but I do need the deferred jobs to persisted through jvm restarts.

The Akka scheduler has been designed for high-volume low-resolution timing tasks, typically timeouts -- all with the requirement of high performance. While you can combine persistence and the Akka scheduler to achieve what you want, we will keep the scheduler simple -- since this is a highly performance sensitive module we do not want to add features there. You can definitely build something around it though.

-Endre



--
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

Greg Flanagan

unread,
Jul 25, 2014, 10:46:45 AM7/25/14
to akka...@googlegroups.com
Endre,

Seems reasonable to keep the scheduler light weight and performant. My plans were to build something around it. Thanks.

Greg

Martynas Mickevičius

unread,
Jul 31, 2014, 4:03:36 AM7/31/14
to akka...@googlegroups.com
Hi Greg,

just dropping this in case you have not seen that it is possible to use quartz through akka-camel.
Martynas Mickevičius
TypesafeReactive Apps on the JVM

Odd Möller

unread,
Aug 3, 2014, 6:04:27 AM8/3/14
to Akka User List
Hi Greg

I have a prototype implementation of an Akka extension that uses persistence to save scheduler state: https://github.com/odd/akka/tree/wip-persistence-odd/akka-contrib/src/main/scala/akka/contrib/persistence/scheduling. It is by no means finished and still very much a work-in-progress but please have a look anyway, perhaps you'll find something of value.

Greetings
Odd 

Greg Flanagan

unread,
Aug 4, 2014, 11:59:58 AM8/4/14
to akka...@googlegroups.com
Hey Odd,

This looks promising. Thanks for passing along.

Greg

Akka Team

unread,
Aug 5, 2014, 11:59:51 AM8/5/14
to Akka User List
Hi Odd!
I had a brief look at your prototype (didn't read the whole thing – that's a lot of work you've put in there! :-)).
In general I think it would benefit from living outside of Akka as a library which users could pick up if they wanted to,
then you could also pull in JodaTime (and not have regexes for dates and custom `At` types) but could re-use existing `Instant`s etc.

Keep at it, good luck! :-)

Greg Flanagan

unread,
Aug 5, 2014, 2:20:58 PM8/5/14
to akka...@googlegroups.com
Odd,

I have something similar to what you have but I haven't integrated persistence yet. It basically uses JodaTime to allow the user to schedule a task based on a datetime has the ability to repeat tasks at a cadence like, hourly, daily, weekly, etc., and repeat a finite or infinite number of times. It's used like this.

val delayTo = DateTime(2014, 10, 2, 12, 30, 0, UTC)

DateTimeScheduler.schedule(date, actorRef, message, Cadence.Daily, Repeat.Inf
)

this would schedule a message to be sent to the actorRef starting on Oct, 2, 2014 at 12:30 UTC and will be run again at Oct 3, 2014 at 12:30 UTC and will repeat forever. 

This is just a prototype I was playing around with. Your persistence work looks nice, we should join forces.

There is some code.
https://github.com/kaiserpelagic/akka-datetime-scheduler

Greg

Odd Möller

unread,
Aug 7, 2014, 10:41:54 AM8/7/14
to Akka User List
Hi Greg and Akka!

Nice to hear that you find the prototype interesting. I'll try to have a look into your scheduler code as soon as I can. I will also look into moving my existing code to a new github repo (which is not a fork of Akka repo) for any further development.

Greetings
Odd 

Ashley Aitken

unread,
Mar 23, 2015, 2:12:22 PM3/23/15
to akka...@googlegroups.com

May I please ask if there has been any progress on this by anyone?  We need durable timeouts for sagas in CQRS.

Thanks,
Ashley. 

Arkadiusz Burdach

unread,
Nov 26, 2015, 1:22:37 PM11/26/15
to Akka User List
I've just created https://github.com/TouK/pscheduler which mixes Akka scheduler with slick jdbc persistence. It was rather made for tasks scheduled rarely but might be helpful.

Cheers,
Arek
Reply all
Reply to author
Forward
0 new messages