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.
JsonRpcMapper
JsonRpcMapper.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)
JsonRpcMapper
ServiceDescription
can be used
to look up the invoked procedure and learn about
its signature.parse
in interface JsonRpcMapper
public JsonRpcMapper.JsonRpcResponse parse(String responseBody, Class<?> expectedReturnType)
JsonRpcMapper
parse
in interface JsonRpcMapper
public String write(Object input)
JsonRpcMapper
write
in interface JsonRpcMapper
protected Object convert(com.fasterxml.jackson.core.TreeNode node, Class<?> expectedType) throws IOException
IOException
Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.