Comments (14)
At least we do not have any errors at this time..
I was not aware of the SerializationTestKit
, that's very good to know. I'm going to use it and update that issue accordingly.
I learnt about the plugin from Twitter: https://twitter.com/VirtusLab/status/1570312428218466306
from akka-serialization-helper.
@gervaisb actually... work in progress ;) #304
from akka-serialization-helper.
Just upgraded to 0.7.0
everything is okay with the new parameter.
from akka-serialization-helper.
Hmmm I'm not sure if these are truly false positives... do Either[_,_]
and subclasses of scalapb.GeneratedMessage
actually serialize successfully with Akka?
Btw out of curiosity, how did you learn of our plugin? ;)
from akka-serialization-helper.
Ok! lmk how it goes and we'll think if/how to address
from akka-serialization-helper.
Hi there. Back with my "issue".
I do have this test that pass for a message with an Either
.
// testKit: akka.actor.testkit.typed.scaladsl.ActorTestKit = ...
val probe = testKit.createTestProbe[Either[SampleError, SampleEvent]]()
val replyTo: ActorRef[Either[SampleError, SampleEvent]] = probe.ref
val subject = MessageWithEither(
"Hello", replyTo
)
new SerializationTestKit(system)
.verifySerialization(subject)
The system is configured with:
akka {
actor {
serializers {
// ...
jackson-cbor = "akka.serialization.jackson.JacksonCborSerializer"
}
serialization-bindings {
// ...
"scala.util.Either" = jackson-cbor
}
}
}
However, ASH report an error:
Either[org.acme.SampleError, org.acme.SampleEvent] is used as Akka message but does not extend a trait annotated with org.virtuslab.ash.annotation.SerializabilityTrait.
[error] Passing an object of a class that does NOT extend a trait annotated with org.virtuslab.ash.annotation.SerializabilityTrait as a message
[error] may cause Akka to fall back to Java serialization during runtime.
[error]
[error] replyTo: ActorRef[Either[SampleError, SampleEvent]]
You are right, Either[_,_]
is not "natively serializable" with Akka. However, if I'm not mistaken, it should be in this case.
from akka-serialization-helper.
Wow good to know
from akka-serialization-helper.
Okay, thanks.
We use Either
on commands only. But we do have some snapshots that are not serializable. Is there any way to "exclude" our commands from your plugin, but keep all classes related to the states?
from akka-serialization-helper.
Is there any way to "exclude" our commands from your plugin, but keep all classes related to the states?
Unfortunately, there's currently some configurability (https://github.com/VirtusLab/akka-serialization-helper/blob/main/docs/GUIDE.md#serializability-checker-compiler-plugin)... but that probably doesn't cover your case in any useful manner.
Just out of curiosity... would you be interested in providing a contribution to this repo? Ofc with review & all needed support on our side. We'll eventually be able to implement it ourselves as well (esp. given that there's an external interest in the project)... but it might take a longer while (as we're busy in unrelated projects that don't even use ASH) :///
from akka-serialization-helper.
Just out of curiosity... would you be interested in providing a contribution to this repo?
I'd love to. Unfortunately, I do not see much time on the coming months.
Thanks for the effort in #304 ! Awesome.
from akka-serialization-helper.
Okay I've merged #304 and got a snapshot release ready... if @gervaisb you could:
- set up access to snapshots as in the docs: https://github.com/VirtusLab/akka-serialization-helper/blob/main/CONTRIBUTING.md#snapshots
- use the snapshot version
0.6.2+59-f4224184-SNAPSHOT
(see Sonatype repo) instead of0.6.2
you've got now (I suppose) - use the newly-added
--types-explicitly-marked-as-serializable=...
flag as in https://github.com/VirtusLab/akka-serialization-helper/blob/main/docs/GUIDE.md#serializability-checker-compiler-plugin
Once I get a good-to-go from you, I'm gonna release this version as v0.7.0
from akka-serialization-helper.
Awesome ! Thanks a lot.
Will try that ASAP.
from akka-serialization-helper.
Hello again. I just tested the last snapshot, and it seems to do the Job.
I have configured scala.util.Either
and I am not bothered by this type any more but get "true" errors now.
from akka-serialization-helper.
Hello again. I just tested the last snapshot, and it seems to do the Job.
Gr8!
However, we do have errors for generic types
Hmm this error is probably expected, as there's no guarantee that E
will serialize in runtime indeed... would it make sense to provide a lower bound for these types, like abstract class Projection[Event <: MySerializable]
?
Otherwise, you can take a look at --disable-detection-generics
compiler plugin option (https://github.com/VirtusLab/akka-serialization-helper/blob/main/docs/GUIDE.md#serializability-checker-compiler-plugin)
from akka-serialization-helper.
Related Issues (20)
- Set up Markdown link checks in CI HOT 1
- Provide cache directory as a named flag (and not as a loose argument) to compiler plugins HOT 1
- Add real dumping of persistence-schema to `examples/`
- Laguna compilation fails with ASH versions greater than 0.4.3 HOT 2
- Add `verbose` logs to Codec Registration Checker Compiler Plugin
- Set sbt keys for all `ashSerializabilityCheckerCompilerPlugin` flags
- Update `AkkaCodecs` usage in `examples/`
- Add support for Scala 3 HOT 1
- Enable security reports from `Dependabot`
- Fix critical Log4J vulnerabilities HOT 1
- Support for `Laguna` - add persistence schema checks to CI
- Support for `Laguna` - tidy up the mess with multiple ASH cache directories
- Updata scala versions to `2.12.17` and `2.13.9`
- In README document jackson ScalaObjectDeserializerModule HOT 2
- Support for `Laguna` - fix persistence schema check in CI HOT 1
- Question, adding many options HOT 3
- `OverlappingFileLockException` from `SerializerCheckCompilerPluginComponent$$anon$1.interactWithTheCacheFile` HOT 15
- `spray.json.JsonParser$ParsingException: Unexpected end-of-input` at `PersistenceSchemaWriter`
- Untangle file access in codec-registration-checker-compiler-plugin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from akka-serialization-helper.