Commit graph

45 commits

Author SHA1 Message Date
PJ Fanning
a8ee7c4239
remove mima checks (#13)
* remove mima checks

* Update binary-compatibility-checks.yml
2022-11-05 10:19:44 +01:00
Renato Cavalcanti
7abc41cf4e
update copyright year to 2022 (#31057) 2022-02-04 12:36:44 +01:00
Arnout Engelen
4640338e73
jackson: don't fail serializing empty beans (#31033)
Notably, case objects.

It's not entirely clear to me why this started failing on Scala 3,
`AccountExampleSpec` picks `JacksonCborSerializer` both for Scala 2
and Scala 3, but only on 3 seems to require this option.
2022-01-06 15:21:09 +01:00
Arnout Engelen
9f252696ec
Test customizing the Jackson object mapper (#30670)
Starting with https://github.com/FasterXML/jackson-databind/issues/2683
Jackson will no longer use the generic bean serialization when serializing a
`java.time.Instant`, but throw an error (since the bean serialization
doesn't make sense for those types anyway).

Our test relied on the bean serialization to test using custom object
mappers. This PR improves the test to use a 'real' custom mapper instead
of just relying on the bean fallback.
2021-09-10 12:49:05 +02:00
Arnout Engelen
fc1a375f51
Compile akka-serialization-jackson with Scala 3 (#30408)
Tests compile but one test fails - possibly because of the mixed Jackson
versions. Took inspiration from #30361

Refs #30243
2021-07-20 19:14:23 +02:00
Johan Andrén
c5655a9ce6
Upgrade to Scala 2.13.5 (#30072) 2021-03-30 20:57:23 +02:00
Andrea Peruffo
da70e0ccd4
Scala 3 cross compatible akka-actor / akka-testkit / akka-actor-tests (#29956)
* Remove @switch when it doesn't take effect
* Use ActorRef.noSender
* Minor tweaks to SchedulerSpec
* Disambiguate TypedActor for Scala 3
* Bump ScalaTest to a version compatible with Scala 3
* Bump ScalaCheck
* Disambiguate Event in SupervisorHierarchySpec
* Scala 3 compatible EventBusSpec
* Prevent private unused variables to be erased by Scala 3
* Bump mockito
* Explicit actorRef2Scala import
* restore original .scalafix.conf
* Scala 3 compatible tailrec
* Reminder to re add switch annotation in case
* Move to nowarn instead of silencer
* Bump to Scala 2.12.13
* Cross compatible annotations
* fix docs generation
* adapt the build for Scala 3
* fix errors but bus
* remove more SerialVersion from trait
* scalacheck only from scalatest
* cross-compile akka-actor-tests
* restore cross-compilation
* early initializers workaround
* scalacheck switch
* cross compatible FSM.State class
* cross compatible LARS spec
* Change results to pass LineNumberSpec
* fix stackoverflow in AsyncDnsResolverIntegrationSpec
* FSM.State unapply
* fix Scala 2.13 mima
* SerialVersionRemover compiler plugin
* removed unused nowarns
2021-02-01 16:38:29 +01:00
Arnout Engelen
31f654768f
Update copyright to 2021 2021-01-08 17:55:38 +01:00
Ignasi Marimon-Clos
24d01a101a
Configure visibility (#29797) 2020-11-10 09:41:44 +01:00
Patrik Nordwall
7bf12721c1 Merge branch 'master' into feature-active-active-event-sourcing 2020-09-02 15:46:06 +02:00
Renato Cavalcanti
32ec0428d3
Document workaround for jackson serialiaztion of scala case objects (#29531)
* workaround for jackson serialiaztion of scala case objects

* improved sentence
2020-09-02 14:19:13 +02:00
Ignasi Marimon-Clos
728dda874e
Event migration improvements (#29514) 2020-08-25 11:10:33 +02:00
Christopher Batey
67eb74f076 Embed akka serialization inside jackson serialization (#29455)
* Embed akka serialization inside jackson serialization

Allows re-use of existing serializers when embedding the types in
Jackson

* Fix false dead code warning

* Move marker trait and add docs

* Remove module and document adding annotations

* Review feedback
2020-08-17 07:54:33 +01:00
Arnout Engelen
ce07d5f15a
Avoid 'dead code after this construct' warnings in jackson-databind example (#29278)
This signature of jackson-databind's `set` is:

    public <T extends JsonNode> T set(String fieldName, JsonNode value)

When running the Scala compiler with dead code warnings enabled, this
will cause warnings due to https://github.com/scala/bug/issues/8109 .
Making the generic type explicit avoids that.
2020-06-23 09:15:17 +02:00
Johan Andrén
1e9e984727
Removing, deprecating and replacing usage of black/whitelist (#29254) 2020-06-18 15:48:28 +02:00
contrun
11816df236
add lz4 compression for jackson (#29012) 2020-05-22 13:37:22 +02:00
Patrik Nordwall
bfb67f4e74
Step two of the CBOR serialization issue, #28927 (#28928)
* Configuration changes to enable toBinary by default for jackson-cbor
* Must be in second step to support rolling updates
2020-05-07 15:26:47 +02:00
kerr
0e4d41ad33
+build Add sort imports support. (#28780)
* Add scalafix plugin for jdk 9.
* Add command alias sortImports.
* Excludes some sources from SortImports.
* Update SortImports to 0.4.0
* Sort imports with `sortImports` command.
2020-04-27 14:32:18 +02:00
Patrik Nordwall
ef9a2c79c6 JacksonCborSerializer should use CBOR ofc, #28918
* When we updated to Jackson 2.10 (prior Akka 2.6.0) the new JsonFactoryBuilder
  was used. That doesn't preserve the formatParserFeatures and formatGeneratorFeatures
  from the base CBORFactory and therefore the format was plain JSON.

* rolling update compatibility
2020-04-20 15:09:43 +02:00
Ignasi Marimon-Clos
bcfdb896b0
Test jackson support for scala enumerations (#28726)
* Extends Spec over scala enumerations
* Adds documentation for scala enumeration support serializing with Jackson
2020-03-19 11:09:05 +01:00
Patrik Nordwall
0469a66c2d test Jackson serialization of UUID 2020-02-05 10:12:00 +01:00
Mike Limansky
d9ed927df0 Update to ScalaTest 3.1.0, fix #28289. 2020-01-11 15:15:10 +03:00
Helena Edelson
6bf20f4117 Update all copyright headers to 2020 after new year's #27881 (#28434) 2020-01-02 13:24:59 +01:00
Brian Wignall
fd41299943 Fix typos, via a Levenshtein-style corrector 2019-12-19 01:57:55 -05:00
Johannes Rudolph
702b6a7f41 actor: allow seamless access to untyped extensions given typed ActorSystem (#28294)
* actor: allow seamless access to untyped extensions given typed ActorSystem

* add overrides with concrete type for Java API everywhere
2019-12-05 16:01:22 +01:00
James Roper
eb64d05b8c Manifest-less Jackson serializers, #28113 (#28299)
* This adds the ability to make Jackson serializers not output the class
  name in the manifest in cases where type information is stored in a more
  concise format in the JSON itself.

* documentation about rolling updates

* Ensure programatic bindings are search in Jackson serializer
2019-12-05 12:50:01 +01:00
Patrik Nordwall
ae70a833fe
Prepare for other compression algorithms in JacksonSerializer, #27066 (#27889)
* change config structure to be able to support other compression
  algorithms, such as lz4 in the future
* enable compression for json (as before) but disable it by default
  for cbor

Co-Authored-By: Ignasi Marimon-Clos <ignasi@lightbend.com>
2019-10-08 11:23:01 +02:00
Marcos Pereira
92b9db5858 Jackson 2.10.0 (#27814)
* Update Jackson to 2.10.0

* Support configuration for new features introduced in Jackson 2.10

* WRITE_DURATIONS_AS_TIMESTAMPS is the new config used to serialize durations

Previously WRITE_DATES_AS_TIMESTAMPS was used for both date/time and duration, but
in Jackson 2.10 WRITE_DURATIONS_AS_TIMESTAMPS is used for durations, so it needs to
be configured consistently with WRITE_DATES_AS_TIMESTAMPS.
2019-10-02 19:58:11 -07:00
Patrik Nordwall
1a90d45bdd
Only allow deserialization for know classes in ProtobufSerializer, #27730 (#27731)
* similar approach as in JacksonSerializer
2019-10-01 16:20:35 +02:00
Marcos Pereira
9caae087a2 Add configuration for all Jackson Features (#27409)
* Support configuration for Jackson MapperFeatures in Jackson Serializer

* Add JsonParser.Feature configuration support

* Add JsonGenerator.Feature configuration support

* Fix formatting issues

* Add examples for each feature configuration

* Test coverage of the override methods
2019-08-16 11:33:47 +02:00
Johan Andrén
03b8c543fc Serialization support for wrapped stream refs (#27353) 2019-07-16 10:11:33 -07:00
Patrik Nordwall
7505a13fc2 fix FIXMEs in Jackson serializer and docs (#27316) 2019-07-12 13:31:24 +02:00
Patrik Nordwall
8f8684ae6c Doc trait+object (enum) serialization for Jackson (#27244)
* Doc trait+object (enum) serialization for Jackson

* move to separate file
2019-07-12 08:25:10 +01:00
Patrik Nordwall
3efc1c2877
Disable Java serialization by default, #22333 (#27285)
* akka.actor.allow-java-serialization = off
* Moved primitive (Long, Int, String, ByteString) serializers
  from akka-remote to akka-actor since they had no dependency
  and are useful also in local systems, e.g. persistence.
  * e.g. needed for persistence-tck
  * less allow-java-serialization=on in tests
* CborSerializable in Jackson/test module for ease of use
* JavaSerializable for Java serialization in tests, already in akka-testkit,
  but misconfigured
* Made tests pass
  * allow-java-serialization=on in akka-persistence
  * allow-java-serialization=on in classic remoting tests
  * JavaSerializable and CborSerializable in other remoting tests
* Added serialization for
  * Boolean
  * java.util.concurrent.TimeoutException, AskTimeoutException
* support for testing serialization with the inmem journal
* utility to verifySerialization, in SerializationTestKit
* remove AccountExampleWithCommandHandlersInState becuase not possible to serialize State when it's not static
  * Effect() is factory in EventSourcedBehavior  class
* test the account examples
* SharedLeveldbJournal.configToEnableJavaSerializationForTest
* support for exceptions from remote deployed child actors
  * fallback to akka.remote.serialization.ThrowableNotSerializableException
    if exception is not serializable when wrapped in system messages from
    remote deployed child actors and Status.Failure messages
  * it's implemented in `WrappedPayloadSupport.payloadBuilder`
* update reference documentation
* serialize-messages=off in most places, separate ticket for
  improving or removing that feature
* migration guide, including description of rolling update

* fix 2.13 compiler error

* minor review feedback
2019-07-11 14:04:24 +02:00
Patrik Nordwall
72730036be Serialization of case object with Jackson, #27283
* the serializer must treat case objects specially since
  the way the class is loaded is different, and Jackson
  object mapper shouldn't be involved in fromBinary
2019-07-05 11:38:28 +02:00
Patrik Nordwall
57fd889548
remove Jackson afterburner, since no visible improvement #24155 (#27064)
* remove Jackson afterburner, since no visible improvement #24155

* add back timeMessage benchmark

* improve custom mapper test
2019-06-13 21:53:21 +02:00
Patrik Nordwall
6660e8504a
Remove Jackson Smile format, #24155 (#27105)
* No clear advantage over CBOR
* One less choice for users
* CBOR seems to have a stronger specification and therefore potential
  for wider adoption
* Performance of CBOR is equals to Smile
* Smile can be slightly more compact
  (I think it does more to reduce repeated field names),
  but that might be better to solve with good compression
2019-06-13 17:40:24 +02:00
Christopher Batey
6e93bef605
Enable Jackson for 2.13 (#27136)
* Enable jackson for 2.13

* Fix 2.13 warnings in jackson module
2019-06-13 16:17:04 +01:00
Patrik Nordwall
c62f428d51 Jackson whitelist for deserialization of unbound class, #26910 2019-06-07 17:52:50 +02:00
Patrik Nordwall
41600d3079 use ISO-8601 date/time format in Jackson serializer, #24155
* better for interoperability
* deserialization from both formats are supported
2019-06-07 16:51:44 +02:00
Patrik Nordwall
467d65043e try Jackson compression impact, #24155
* increased the default compress-larger-than to 32 KiB,
  because gzip performance overhead
* support 'off' config value to disable completely
2019-06-07 16:00:02 +02:00
Patrik Nordwall
23cbd68430 Support separate conf per JacksonSerializer binding, #24155
* Needed in Lagom to be able to have separate object mappers with different
  config for exernal and internal usage.
* Can also be good to be able to have different config for json and cbor
  serializers, or different for remote messages and persisted events.
* Pass in binding name when creating the serializer if it has a matching
  constructor
* Serialization identifiers loaded from config via the binding name instead
  of class name, for JacksonSerializer.
2019-06-07 14:43:36 +02:00
Patrik Nordwall
7c0be70eea
Doc Jackson annotation gotchas, #24155 (#27091)
* Describe annotations for single param constructor, #24155
* Describe annotations for polymorphic types, #24155
2019-06-07 14:41:01 +02:00
Patrik Nordwall
93017d05c7 serializer for akka.actor.typed.ActorRef
* most convenient for users to include it akka-serialization-jackson
  and load it when akka-actor-typed is in classpath
* provided dependency to akka-actor-typed
2019-05-30 15:08:48 +02:00
Patrik Nordwall
6122966fca Jackson serializer as replacement for Java serialization, #24155
* Copied from Lagom, with the following differences
  * Jsonable and CompressedJsonable not included
  * pcollection and guava modules not enabled by default
  * added scala and afterburner modules
* JSON, CBOR and Smile options (different serializers)
* JMH benchmark
* jackson version 2.9.9
* test polymorphism
* serializer for ActorRef
* Address serializer
* FiniteDuration serializer, same as java.time.Duration
* use blacklist from Jackson databind against gadgets
* disallow binding to open ended types, such as java.io.Serializable
* Configurable ObjectMapper ser/deser features
* testing date formats with WRITE_DATES_AS_TIMESTAMPS on/off
* ActorSystemSetup for ObjectMapper creation
  * and possibility to lookup created ObjectMapper via ObjectMapperProvider extension
* createObjectMapper without ActorSystem, needed by Lagom test
* add basic docs
* skip Scala 2.13 for akka-serialization-jackson for now, until the Jackson
  Scala module has been released
2019-05-24 09:03:45 +02:00