Re: [akka-user] Re: When using akka-persistence-dynamodb, akka is not finding the proper avro serialzer
Is it still needed if the serialization is not using Java Serialization?? I also tried extending MyPayload with Serializable, but the error is the same. I am going to create a simple example with the issue so that maybe someone can try himself. On Wednesday, February 22, 2017 at 9:34:34 AM UTC+1, Richard Ney wrote: > > Quick question on your definition for "core.eventpersistence.MyPayload" > did you remember to extend Serializable? > > Your serialization bindings look good, this is what mine look like for a > single group of records since BuilderRecord is a trait that I extend. > > trait BuilderRecord extends Serializable { > val recordTimestamp: Instant > } > > akka { > actor { > serializers { > builder-records = > "report.compute.serialization.BuilderRecordsSerializer" > } > serialization-bindings { > "report.compute.model.br.BuilderRecord" = builder-records > } > } > } > > > On Wed, Feb 22, 2017 at 12:23 AM, Asif Fayyaz > wrote: > >> Hi Richard, Thankyou for answering the question. I enabled the debug >> level logging and saw that the custom serializer is loaded properly. So, it >> should be used for serialisation of the payload via akka persistence. >> However, looking into this error, it seems as akka is using default >> JavaSerializer rather than my custom serializer for avro. Unfortunately, >> via akka debugging, i am not yet able to see if my custom serializer was >> even tried by akka. Here are the settings I have for akka debugging: >> >>> akka.persistence.journal.plugin = "xxx-dynamodb-journal" >>> akka { >>> loglevel=DEBUG >>> receive = on >>> autoreceive = on >>> lifecycle = on >>> log-config-on-start = on >>> } >>> akka.actor { >>> serialize-messages = on >>> serialize-creators = on >>> serializers { >>> avro = "core.serializer.avro.MyPayloadSerializer" >>> } >>> serialization-bindings { >>> "core.eventpersistence.MyPayload" = avro >>> } >>> } >> >> >> >> >> >> On Tuesday, February 21, 2017 at 7:06:30 PM UTC+1, Richard Ney wrote: >>> >>> I've had no issues using my custom protocol buffer serializers in my >>> DynamoDB journal tests. I'm using all the same versions you are. Have you >>> enabled Akka debug level logging to see which serializer the framework is >>> trying to use? >>> >>> On Tuesday, February 21, 2017 at 6:07:39 AM UTC-8, Asif Fayyaz wrote: >>>> >>>> We are using akka-persistence-dynamodb plugin for akka persistance and >>>> using avro for our data serialization. We loaded the serializer along with >>>> serializer bindings via configuration and we can see that configuration >>>> does load the proper serializer for the required object. However, When >>>> calling "Persist" with the given object, akka is still trying to use >>>> JavaSerializer. >>>> >>>> Here is the error that we are getting. >>>> >>>> [error] a.p.d.j.DynamoDBJournal - swallowing exception during message >>>> send >>>> >>>> java.io.NotSerializableException: >>>> akka.persistence.dynamodb.journal.DynamoDBJournal >>>> >>>> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) >>>> >>>> at >>>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) >>>> >>>> at >>>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) >>>> >>>> at >>>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) >>>> >>>> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) >>>> >>>> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) >>>> >>>> at >>>> akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply$mcV$sp(Serializer.scala:297) >>>> >>>> at >>>> akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:297) >>>> >>>> at >>>> akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:297) >>>> >>>> at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58) >>>> >>>> Is any custom serializer supp
[akka-user] Re: When using akka-persistence-dynamodb, akka is not finding the proper avro serialzer
Hi Richard, Thankyou for answering the question. I enabled the debug level logging and saw that the custom serializer is loaded properly. So, it should be used for serialisation of the payload via akka persistence. However, looking into this error, it seems as akka is using default JavaSerializer rather than my custom serializer for avro. Unfortunately, via akka debugging, i am not yet able to see if my custom serializer was even tried by akka. Here are the settings I have for akka debugging: > akka.persistence.journal.plugin = "xxx-dynamodb-journal" > akka { > loglevel=DEBUG > receive = on > autoreceive = on > lifecycle = on > log-config-on-start = on > } > akka.actor { > serialize-messages = on > serialize-creators = on > serializers { > avro = "core.serializer.avro.MyPayloadSerializer" > } > serialization-bindings { > "core.eventpersistence.MyPayload" = avro > } > } On Tuesday, February 21, 2017 at 7:06:30 PM UTC+1, Richard Ney wrote: > > I've had no issues using my custom protocol buffer serializers in my > DynamoDB journal tests. I'm using all the same versions you are. Have you > enabled Akka debug level logging to see which serializer the framework is > trying to use? > > On Tuesday, February 21, 2017 at 6:07:39 AM UTC-8, Asif Fayyaz wrote: >> >> We are using akka-persistence-dynamodb plugin for akka persistance and >> using avro for our data serialization. We loaded the serializer along with >> serializer bindings via configuration and we can see that configuration >> does load the proper serializer for the required object. However, When >> calling "Persist" with the given object, akka is still trying to use >> JavaSerializer. >> >> Here is the error that we are getting. >> >> [error] a.p.d.j.DynamoDBJournal - swallowing exception during message >> send >> >> java.io.NotSerializableException: >> akka.persistence.dynamodb.journal.DynamoDBJournal >> >> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) >> >> at >> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) >> >> at >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) >> >> at >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) >> >> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) >> >> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) >> >> at >> akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply$mcV$sp(Serializer.scala:297) >> >> at >> akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:297) >> >> at >> akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:297) >> >> at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58) >> >> Is any custom serializer supported by "akka-persistence-dynamodb" >> plugin?? >> >> Our environment detail: >> scala version: 2.11.8 >> akka version: 2.4.12 >> akka-persistence-dynamodb version: 1.0.1 >> play version: 2.5.10 >> >> -- >>>>>>>>>> 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+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
[akka-user] When using akka-persistence-dynamodb, akka is not finding the proper avro serialzer
We are using akka-persistence-dynamodb plugin for akka persistance and using avro for our data serialization. We loaded the serializer along with serializer bindings via configuration and we can see that configuration does load the proper serializer for the required object. However, When calling "Persist" with the given object, akka is still trying to use JavaSerializer. Here is the error that we are getting. [error] a.p.d.j.DynamoDBJournal - swallowing exception during message send java.io.NotSerializableException: akka.persistence.dynamodb.journal.DynamoDBJournal at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply$mcV$sp(Serializer.scala:297) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:297) at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply(Serializer.scala:297) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58) Is any custom serializer supported by "akka-persistence-dynamodb" plugin?? Our environment detail: scala version: 2.11.8 akka version: 2.4.12 akka-persistence-dynamodb version: 1.0.1 play version: 2.5.10 -- >> 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+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.