Share via


Send Method (Message)

Sends the specified message to the message buffer.

Namespace:  Microsoft.ServiceBus
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

Syntax

'Declaration
Public Sub Send ( _
    message As Message _
)
'Usage
Dim instance As MessageBufferClient
Dim message As Message

instance.Send(message)
public void Send(
    Message message
)
public:
void Send(
    Message^ message
)
member Send : 
        message:Message -> unit 
public function Send(
    message : Message
)

Parameters

Remarks

This method will attempt to send the message to the message buffer for one minute. If the attempt is unsuccessful, then this method returns a TimeoutException. Possible causes may be that the message buffer is full, or the connection between the client and the buffer is unavailable. For more information about sending a message, see How to: Send Messages to an AppFabric Service Bus Message Buffer.

Examples

// Create buffer
Uri bufferName = new Uri("https://" + serviceNamespace + ".servicebus.windows.net/services/MyBuffer");
MessageBufferClient client = MessageBufferClient.CreateMessageBuffer(behavior, bufferName, policy, messageVersion);

// Send some messages
for (int i = 0; i < 10; ++i)
{
   client.Send(Message.CreateMessage(messageVersion, messageAction, "Message #" + i));
}

See Also

Reference

MessageBufferClient Class

Send Overload

Microsoft.ServiceBus Namespace