// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 package app.settlement.ingestion.services; import app.settlement.ingestion.pojo.RawMessage; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import java.io.IOException; @Slf4j @Service public class RawMessageService { private final static ObjectMapper JSON = new ObjectMapper(); static { JSON.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); } public RawMessage fromBytes(byte[] b) { try { return JSON.readValue(b, RawMessage.class); } catch (IOException e) { return null; } } }