@Test public void testSerializerNoEventHeaders() throws RedisSerializerException { String res = serialize(new HashMap<String, String>()); assertTrue(res.equals("{}")); }
@Override public byte[] serialize(Event event) throws RedisSerializerException { JsonObject jsonObject = new JsonObject(); for (Map.Entry<String, String> entry : event.getHeaders().entrySet()) { jsonObject.addProperty(entry.getKey(), entry.getValue()); } return jsonObject.toString().getBytes(); }
JsonSerializer implements Serializer { @Override public byte[] serialize(Event event) throws RedisSerializerException { JsonObject jsonObject = new JsonObject(); for (Map.Entry<String, String> entry : event.getHeaders().entrySet()) { jsonObject.addProperty(entry.getKey(), entry.getValue()); } return jsonObject.toString().getBytes(); } }
JsonSerializer implements Serializer { @Override public byte[] serialize(Event event) throws RedisSerializerException { JsonObject jsonObject = new JsonObject(); for (Map.Entry<String, String> entry : event.getHeaders().entrySet()) { jsonObject.addProperty(entry.getKey(), entry.getValue()); } return jsonObject.toString().getBytes(); }  }
JsonSerializer implements Serializer { @Override public byte[] serialize(Event event) throws RedisSerializerException { JsonObject jsonObject = new JsonObject(); for (Map.Entry<String, String> entry : event.getHeaders().entrySet()) { jsonObject.addProperty(entry.getKey(), entry.getValue()); } return jsonObject.toString().getBytes(); }  @Override byte[] serialize(Event event); @Override void configure(Context context); @Override void configure(ComponentConfiguration componentConfiguration); }
JsonSerializer implements Serializer { @Override public byte[] serialize(Event event) throws RedisSerializerException { JsonObject jsonObject = new JsonObject(); for (Map.Entry<String, String> entry : event.getHeaders().entrySet()) { jsonObject.addProperty(entry.getKey(), entry.getValue()); } return jsonObject.toString().getBytes(); }  @Override byte[] serialize(Event event); @Override void configure(Context context); @Override void configure(ComponentConfiguration componentConfiguration);  }