Closed agourlay closed 9 years ago
how about using Play with akka?
As I am using spray, I have an eye on https://github.com/wandoulabs/spray-websocket.
yeah,by wandoujia China.in fact I want to do something just like what you have done.but seems you just keep the last state of the topic but I may want to keep all the message. what you have done will be nice to server something like weather service or something that.
Actually I keep all messages within akka-persistence journal. I can then replay those messages when the client asks for it.
I have asked this question on akka-user,then said do not using akka-persistence as database,and here seems you are using it like this. for the replay,are you sending a Recover message to the EventProcessor?
I once want to replay and cache all the message in an actor's inner map,but finally seems not that good path.
there is noway to read the message from the journal right,for now.
BTW,could you please show me the line when you replay the message when the client ask for it?thanks.
I am not using akka-persistence as a classical database, so this is not a problem. My current concern is that I am using akka-persistence to implement a durable queue which is not recommended by the author itself.
https://groups.google.com/forum/#!searchin/akka-user/queue/akka-user/5fRv72GFE4E/54TFEttucX8J
I am still trying to find another design to implement durable queues properly.
Omnibus is still a side project that I did for learning purpose, so please don't take my design for granted.
When a client ask to replay a segments of message (from-> to), I just instantiate a view that will replay events. I just filter the one that interest the client and forward them.
Once again this is far from being optimal. Hope it helps you.
when I was making push and for now ,I am using redis for the durable queue,and akka persistence for the event replay,just state no message.
yeah ,just as what you said,that not recommended and seems like the Persistence Channel and View are removing too.
Thanks for the information.
I do not know the latest decisions in terms of deprecation but that is the risk when using experimental APIs ;)
Nice pointers. It looks like the durable message queue will eventually come back, good for Omnibus.
so could you show me where your code line,replay the message?I am not clear with your code now~:P thanks
I already gave you the link above. https://github.com/agourlay/omnibus/blob/master/src/main/scala/omnibus/domain/subscriber/Subscription.scala#L15
This class is an akka-persistence View for a topic processor. That means it will replay automatically the message from the processor when created. Then I just filter them and forward them to the actor who is interested in those, in my case the parent.
thanks ,I was Enlightened.
so how about the replay speed?
I did not benchmark this part.
I just change my application level pull to to using the view. thanks for you code. I think the view could be used as a fetcher ,to fetcher the data,and then publish message to the eventstream. I think you project could use this too.
SubchannelClassification
Thx, I will have a look at this.
I am using akka and cluster persistence to implement an push server,Hard to make every message delivered,I have switch from the redis way to the EeventProcessor - View way.This may make my life a litter easier.
Would be awesome to pub/sub via websocket. Wait for websocket to be implemented in akka-http