public class Request extends Message
Request
messages are sent using the DxlClient.syncRequest(com.opendxl.client.message.Request)
and DxlClient.asyncRequest(com.opendxl.client.message.Request, com.opendxl.client.callback.ResponseCallback, long)
methods of a client instance. Request messages are used when invoking a method on a remote service.
This communication is one-to-one where a client sends a request to a service instance and in turn receives
a response.CHARSET_ASCII, CHARSET_UTF8, MESSAGE_TYPE_ERROR, MESSAGE_TYPE_EVENT, MESSAGE_TYPE_REQUEST, MESSAGE_TYPE_RESPONSE, MESSAGE_VERSION
Constructor and Description |
---|
Request(DxlClient client,
java.lang.String destinationTopic)
Constructor for
Request |
Request(java.lang.String destinationTopic)
Constructor for
Request |
Request(java.lang.String sourceClientId,
java.lang.String destinationTopic)
Constructor for
Request |
Modifier and Type | Method and Description |
---|---|
byte |
getMessageType()
Returns the numeric type of the message
|
java.lang.String |
getReplyToTopic()
|
java.lang.String |
getServiceId()
Returns the identifier of the service that this request will be routed to.
|
void |
setReplyToTopic(java.lang.String topic)
|
void |
setServiceId(java.lang.String serviceId)
Sets the identifier of the service that this request will be routed to.
|
fromBytes, getBrokerIds, getClientIds, getDestinationTopic, getDestTenantGuids, getMessageId, getMessagePack, getOtherFields, getPayload, getSourceBrokerId, getSourceClientId, getSourceClientInstanceId, getSourceTenantGuid, getVersion, setBrokerIds, setClientIds, setDestinationTopic, setDestTenantGuids, setOtherFields, setPayload, setSourceClientId, setSourceClientInstanceId, setSourceTenantGuid, toBytes
public Request(DxlClient client, java.lang.String destinationTopic)
Request
client
- The client that will be sending this request.destinationTopic
- The topic to publish the request topublic Request(java.lang.String destinationTopic)
Request
destinationTopic
- The topic to publish the request topublic Request(java.lang.String sourceClientId, java.lang.String destinationTopic)
Request
sourceClientId
- The identifier of the client that will be sending this message.destinationTopic
- The topic to publish the request topublic byte getMessageType()
getMessageType
in class Message
public java.lang.String getReplyToTopic()
public void setReplyToTopic(java.lang.String topic)
public java.lang.String getServiceId()
public void setServiceId(java.lang.String serviceId)
serviceId
- The identifier of the service that this request will be routed to.