@ -8,7 +8,10 @@ import com.bsmlab.dfx.agent.listener.dto.ReceiveMessageDto;
import com.bsmlab.dfx.agent.support.exception.IllegalMessageException ;
import com.bsmlab.dfx.agent.support.exception.IllegalMessageException ;
import com.bsmlab.dfx.agent.support.exception.InCompleteMessageException ;
import com.bsmlab.dfx.agent.support.exception.InCompleteMessageException ;
import com.bsmlab.dfx.agent.support.exception.NullMessageException ;
import com.bsmlab.dfx.agent.support.exception.NullMessageException ;
import com.fasterxml.jackson.core.JsonFactory ;
import com.fasterxml.jackson.core.JsonFactoryBuilder ;
import com.fasterxml.jackson.core.JsonProcessingException ;
import com.fasterxml.jackson.core.JsonProcessingException ;
import com.fasterxml.jackson.core.StreamReadConstraints ;
import com.fasterxml.jackson.core.type.TypeReference ;
import com.fasterxml.jackson.core.type.TypeReference ;
import com.fasterxml.jackson.databind.ObjectMapper ;
import com.fasterxml.jackson.databind.ObjectMapper ;
import lombok.extern.slf4j.Slf4j ;
import lombok.extern.slf4j.Slf4j ;
@ -23,7 +26,12 @@ import java.util.*;
@Slf4j
@Slf4j
public class MessageUtils {
public class MessageUtils {
private static final ObjectMapper objectMapper = new ObjectMapper ( ) ;
private static final ObjectMapper objectMapper ;
static {
StreamReadConstraints constraints = StreamReadConstraints . builder ( ) . maxStringLength ( 500_000_000 ) . build ( ) ;
JsonFactory jsonFactory = new JsonFactoryBuilder ( ) . streamReadConstraints ( constraints ) . build ( ) ;
objectMapper = new ObjectMapper ( jsonFactory ) ;
}
private MessageUtils ( ) { } ;
private MessageUtils ( ) { } ;