Class JsonRpcClient

java.lang.Object
com.rabbitmq.client.RpcClient
com.rabbitmq.tools.jsonrpc.JsonRpcClient
All Implemented Interfaces:
AutoCloseable, InvocationHandler

public class JsonRpcClient extends RpcClient implements InvocationHandler
JSON-RPC is a lightweight RPC mechanism using JSON as a data language for request and reply messages. It is rapidly becoming a standard in web development, where it is used to make RPC requests over HTTP. RabbitMQ provides an AMQP transport binding for JSON-RPC in the form of the JsonRpcClient class.

JSON-RPC services are self-describing - each service is able to list its supported procedures, and each procedure describes its parameters and types. An instance of JsonRpcClient retrieves its service description using the standard system.describe procedure when it is constructed, and uses the information to coerce parameter types appropriately. A JSON service description is parsed into instances of ServiceDescription. Client code can access the service description by reading the serviceDescription field of JsonRpcClient instances.

JsonRpcClient delegates JSON parsing and generating to a JsonRpcMapper.

See Also: