--
>>>>>>>>>> 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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
Patrik Nordwall
Typesafe - Reactive apps on the JVM
Twitter: @patriknw
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/437oIzqVhTk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
package com.optrak.vrp.ddd
import akka.actor.{ActorLogging, PoisonPill, Props}
import akka.persistence.PersistentActor
import com.optrak.opkakka.test.TestSupport.AkkaTestkitContext
import com.optrak.vrp.ddd.SimplePersistor.PersistMe
import org.specs2.mutable.Specification
/**
* Created by tim on 21/02/16.
*/
object SimplePersistor {
case class PersistMe(k: AnyRef)
case class GotBack(kOpt: Option[AnyRef])
case object Request
def props[K] = Props(new SimplePersistor)
}
import SimplePersistor._
class SimplePersistor extends PersistentActor with ActorLogging {
var local: Option[AnyRef] = None
def handler(msg: PersistMe) = {
local = Some(msg.k)
}
override def receiveRecover: Receive = {
case pm: PersistMe =>
local = Some(pm.k)
}
override def receiveCommand: Receive = {
case pm: PersistMe =>
persist(pm)(handler)
case Request =>
sender ! GotBack(local)
}
override def persistenceId: String = "simplePeristor"
}
class TestAkkaSerializability extends Specification {
sequential //our set always has the same persistence id, so have to
trait Checkit extends AkkaTestkitContext {
def checkItOut(k: AnyRef) = {
val persy1 = system.actorOf(SimplePersistor.props)
persy1 ! Request
expectMsg(GotBack(None))
persy1 ! PersistMe(k)
persy1 ! Request
expectMsg(GotBack(Some(k)))
persy1 ! PoisonPill
Thread.sleep(200)
val persy2 = system.actorOf(SimplePersistor.props)
persy2 ! Request
expectMsg(GotBack(Some(k)))
}
}
"persistent set" should {
"work with String" in new Checkit() {
checkItOut("ho")
}
"fails with unserializable" in new Checkit() {
val x = 1
case class Thing(y: Int)
val tricky = new Thing(2) {
def xMe = x
}
checkItOut(tricky)
}
}
}
2016-02-21 12:08:42,871 - INFO - from akka.event.slf4j.Slf4jLogger Slf4jLogger started
2016-02-21 12:08:43,160 - WARN - from akka.serialization.Serialization(akka://default) Using the default Java serializer for class [com.optrak.vrp.ddd.SimplePersistor$PersistMe] which is not recommended because of performance implications. Use another serializer or disable this warning using the setting 'akka.actor.warn-about-java-serializer-usage'
2016-02-21 12:08:43,572 - INFO - from akka.event.slf4j.Slf4jLogger Slf4jLogger started
2016-02-21 12:08:43,604 - WARN - from akka.serialization.Serialization(akka://default) Using the default Java serializer for class [com.optrak.vrp.ddd.SimplePersistor$PersistMe] which is not recommended because of performance implications. Use another serializer or disable this warning using the setting 'akka.actor.warn-about-java-serializer-usage'
relevant bit of config
akka {
loglevel = DEBUG
logger-startup-timeout = 30s
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
actor.debug.fsm = true
loggers = ["akka.event.slf4j.Slf4jLogger"]
extensions = ["com.romix.akka.serialization.kryo.KryoSerializationExtension$"]
persistence {
// journal.plugin = "akka-persistence-sql-async.journal"
// snapshot-store.plugin = "akka-persistence-sql-async.snapshot-store"
journal.plugin = "inmemory-journal"
snapshot-store.plugin = "inmemory-snapshot-store"
journal-plugin-fallback {
replay-filter {
mode = fail
}
}
}
//----------------- Kryo config ----------------------
actor {
serialize-messages = off
serializers {
java = "akka.serialization.JavaSerializer"
# Define kryo serializer
kryo = "com.romix.akka.serialization.kryo.KryoSerializer"
}
serialization-bindings {
"java.io.Serializable" = java
}
kryo {
type = "nograph"
idstrategy = "default"
kyro-trace = true
}
}
}
Ok, light at the end of the tunnel, this is what fails.I'd call that silently swallows.Essentially the only indication of anything wrong is that the persistence stores nothing.
I think this is a plugin bug in the in-memory plugin and a thus by implication TCK issue. Should I raise the TCK issue?
--
>>>>>>>>>> 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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/437oIzqVhTk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
Hi - it's not your in-mem it's a third party one and I've logged an issue with them.The point about the TCK is that it's there to ensure that we can trust the plugin providers to do a good job. So if there's an error in a plug-in that has an clearly identifiable cause then I would think that the error case ought to be added to the TCK so that you can help them make their solutions more robust.
Well in this case they evidently do care about serialization - since the behaviour changes when serialization doesn't work - it's just the reporting that's wrong.I will add the issue (it's a nice simple test case - once I figured out the problem)