ReturnCode Send(
IMessage message
)
Note: returning SOLCLIENT_OK means that the message has been successfully copied to the underlying transport which does not guarantee successful delivery to the Solace appliance. In the case of persistent or non-persistent messages, the application will receive a subsequent Acknowledgement event for all messages (persistent and non-persistent) successfully delivered to the Solace appliance. For guaranteed(persistent or non-persistent) messages which cannot be accepted by the Solace appliance (quota, permission or other delivery problems), a RejectedMessageError event will be generated.
Special Buffering of Guaranteed MessagesGuaranteed messages (MessageDeliveryMode.Persistent or MessageDeliveryMode.NonPersistent) are assured by the protocol between the client and the Solace message-router. To make developers' task easier, guaranteed messages are queued for delivery in many instances:
The SDK will buffer up to a publishers window size (ADPublishWindowSize ) of guaranteed messages before ISession.Send() will either block (when SendBlocking is enabled) or return SOLCLIENT_WOULD_BLOCK (on active sessions) or return SOLCLIENT_NOT_READY (on disconnected or reconnecting sessions).
For the most part this is desired behavior. Transient sessions failures do not require special handling in applications. When ReconnectRetries is non-zero, the underlying transport will automatically reconnect and the publishing application does not need to concern itself with special handling for the transient reconnecting state.
OperationErrorException | Thrown when the Send operation fails. Possible sub-codes: |
ObjectDisposedException | Thrown when the session is already disposed (terminal state). |
FatalErrorException | Thrown when an unrecoverable error occurs. |
ArgumentNullException | Thrown if message is null. |