Search in sources :

Example 1 with AvroMapper

use of com.fasterxml.jackson.dataformat.avro.AvroMapper in project redisson by redisson.

the class RedissonCodecTest method testAvro.

@Test
public void testAvro() throws IOException {
    AvroMapper am = new AvroMapper();
    AvroSchema schema = am.schemaFor(TestObject.class);
    Codec avroCodec = new AvroJacksonCodec(TestObject.class, schema);
    Config config = createConfig();
    config.setCodec(avroCodec);
    RedissonClient redisson = Redisson.create(config);
    RBucket<TestObject> b = redisson.getBucket("bucket");
    b.set(new TestObject("1", "2"));
    assertThat(b.get()).isEqualTo(new TestObject("1", "2"));
}
Also used : Codec(org.redisson.client.codec.Codec) JsonJacksonCodec(org.redisson.codec.JsonJacksonCodec) KryoCodec(org.redisson.codec.KryoCodec) MsgPackJacksonCodec(org.redisson.codec.MsgPackJacksonCodec) SnappyCodec(org.redisson.codec.SnappyCodec) JsonJacksonMapValueCodec(org.redisson.client.codec.JsonJacksonMapValueCodec) SerializationCodec(org.redisson.codec.SerializationCodec) LZ4Codec(org.redisson.codec.LZ4Codec) SmileJacksonCodec(org.redisson.codec.SmileJacksonCodec) CborJacksonCodec(org.redisson.codec.CborJacksonCodec) FstCodec(org.redisson.codec.FstCodec) AvroJacksonCodec(org.redisson.codec.AvroJacksonCodec) AvroSchema(com.fasterxml.jackson.dataformat.avro.AvroSchema) AvroJacksonCodec(org.redisson.codec.AvroJacksonCodec) RedissonClient(org.redisson.api.RedissonClient) Config(org.redisson.config.Config) AvroMapper(com.fasterxml.jackson.dataformat.avro.AvroMapper) Test(org.junit.Test)

Aggregations

AvroMapper (com.fasterxml.jackson.dataformat.avro.AvroMapper)1 AvroSchema (com.fasterxml.jackson.dataformat.avro.AvroSchema)1 Test (org.junit.Test)1 RedissonClient (org.redisson.api.RedissonClient)1 Codec (org.redisson.client.codec.Codec)1 JsonJacksonMapValueCodec (org.redisson.client.codec.JsonJacksonMapValueCodec)1 AvroJacksonCodec (org.redisson.codec.AvroJacksonCodec)1 CborJacksonCodec (org.redisson.codec.CborJacksonCodec)1 FstCodec (org.redisson.codec.FstCodec)1 JsonJacksonCodec (org.redisson.codec.JsonJacksonCodec)1 KryoCodec (org.redisson.codec.KryoCodec)1 LZ4Codec (org.redisson.codec.LZ4Codec)1 MsgPackJacksonCodec (org.redisson.codec.MsgPackJacksonCodec)1 SerializationCodec (org.redisson.codec.SerializationCodec)1 SmileJacksonCodec (org.redisson.codec.SmileJacksonCodec)1 SnappyCodec (org.redisson.codec.SnappyCodec)1 Config (org.redisson.config.Config)1