Class JacksonJsonRpcMapper

  • All Implemented Interfaces:
    JsonRpcMapper

    public class JacksonJsonRpcMapper
    extends java.lang.Object
    implements JsonRpcMapper
    JsonRpcMapper based on Jackson.

    Uses the streaming and databind modules. You need to add the appropriate dependency to the classpath if you want to use this class, as the RabbitMQ Java client library does not pull Jackson automatically when using a dependency management tool like Maven or Gradle.

    Make sure to use the latest version of the Jackson library, as the version used in the RabbitMQ Java client can be a little bit behind.

    Since:
    5.4.0
    See Also:
    JsonRpcMapper
    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • mapper

        private final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • JacksonJsonRpcMapper

        public JacksonJsonRpcMapper​(com.fasterxml.jackson.databind.ObjectMapper mapper)
      • JacksonJsonRpcMapper

        public JacksonJsonRpcMapper()
    • Method Detail

      • write

        public java.lang.String write​(java.lang.Object input)
        Description copied from interface: JsonRpcMapper
        Serialize an object into JSON.
        Specified by:
        write in interface JsonRpcMapper
        Returns:
      • convert

        protected java.lang.Object convert​(com.fasterxml.jackson.core.TreeNode node,
                                           java.lang.Class<?> expectedType)
                                    throws java.io.IOException
        Throws:
        java.io.IOException