ISessionSendRequest Method

Send a Topic Request message. The application expects an end-to-end reply from the client that receives the request message. If the Reply-To destination in the UserProperties of the request message is not set, it defaults to the current session's ReplyTo destination. Leaving the replyTo destination unset and allowing the API to set the default replyTo destination is the easiest way to set a valid replyTo destination. When the responses are handled asynchronously (that is, the timeout parameter is zero), the application may set any replyTo destination. When the application needs to block and wait for the reply (that is, the timeout parameter is non-zero), the replyTo destination must be a topic that the application has subscribed to for Direct messages. If timeoutInMsecs is zero, this method returns immediately upon successfully accepting the request message for transmission. Any replies sent back by the destination client are delivered to the ReplyTo Destination through the message receive delegate. In such a case, the reply tag is set (IsReplyMessage == true) on the response message. It is entirely the responsibility of the application to manage asynchronous replies. Applications can use the CorrelationId message property on outgoing requests. If the timeoutInMsecs parameter is non-zero, the function waits for the amount of time specified by timeoutInMsecs milliseconds before returning with SOLCLIENT_INCOMPLETE. If the replyTo destination is set to an unsubscribed topic, or endpoint, a call to Session.SendRequest() will block until the amount of time set for the timeout parameter expires and then return SOLCLIENT_INCOMPLETE. The function only allows one blocking request (timeout non-zero) at a time. If a multiple threaded application calls Session.SendRequest() from multiple threads at the same time, the first processed request is sent and all other requests block until the first response is received, then the next request is sent.This will consume some of the timeout period for each request.


Namespace: SolaceSystems.Solclient.Messaging
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.24.0
ReturnCode SendRequest(
	IMessage requestMessage,
	out IMessage replyMessage,
	int timeoutInMsecs


requestMessage  IMessage
The request message (DeliveryMode cannot be PERSISTENT or NON_PERSISTENT).
replyMessage  IMessage
The reply message. Null reference if SOLCLIENT_INCOMPLETE is returned.
timeoutInMsecs  Int32
Timeout for the request to complete.

Return Value


SOLCLIENT_INCOMPLETE if only some of the requested operations were performed.

SOLCLIENT_OK if successful.


OperationErrorException Thrown when the operation fails to complete.
ObjectDisposedException Thrown when the session is already disposed (terminal state).
FatalErrorException Thrown when an unrecoverable error occurs.
ArgumentNullException Thrown if requestMessage is null.

See Also