public class JacksonJsonRpcMapper extends 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.
JsonRpcMapperJsonRpcMapper.JsonRpcRequest, JsonRpcMapper.JsonRpcResponse| Constructor and Description |
|---|
JacksonJsonRpcMapper() |
JacksonJsonRpcMapper(com.fasterxml.jackson.databind.ObjectMapper mapper) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
convert(com.fasterxml.jackson.core.TreeNode node,
Class<?> expectedType) |
JsonRpcMapper.JsonRpcResponse |
parse(String responseBody,
Class<?> expectedReturnType)
Parses a JSON RPC response.
|
JsonRpcMapper.JsonRpcRequest |
parse(String requestBody,
ServiceDescription description)
Parses a JSON RPC request.
|
String |
write(Object input)
Serialize an object into JSON.
|
public JacksonJsonRpcMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
public JacksonJsonRpcMapper()
public JsonRpcMapper.JsonRpcRequest parse(String requestBody, ServiceDescription description)
JsonRpcMapperServiceDescription can be used
to look up the invoked procedure and learn about
its signature.parse in interface JsonRpcMapperpublic JsonRpcMapper.JsonRpcResponse parse(String responseBody, Class<?> expectedReturnType)
JsonRpcMapperparse in interface JsonRpcMapperpublic String write(Object input)
JsonRpcMapperwrite in interface JsonRpcMapperprotected Object convert(com.fasterxml.jackson.core.TreeNode node, Class<?> expectedType) throws IOException
IOExceptionCopyright © 2021 VMware, Inc. or its affiliates.. All rights reserved.