Commit graph

24 commits

Author SHA1 Message Date
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
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
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
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
Patrik Nordwall
7505a13fc2 fix FIXMEs in Jackson serializer and docs (#27316) 2019-07-12 13:31:24 +02: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
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