ServiceBusMessageBatch.TryAddMessage(ServiceBusMessage) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attempts to add a message to the batch, ensuring that the size of the batch does not exceed its maximum.
public bool TryAddMessage (Azure.Messaging.ServiceBus.ServiceBusMessage message);
member this.TryAddMessage : Azure.Messaging.ServiceBus.ServiceBusMessage -> bool
Public Function TryAddMessage (message As ServiceBusMessage) As Boolean
Parameters
- message
- ServiceBusMessage
The message to attempt to add to the batch.
Returns
true
if the message was added; otherwise, false
.
Exceptions
When a batch is sent, it will be locked for the duration of that operation. During this time,
no messages may be added to the batch. Calling TryAdd
while the batch is being sent will
result in an InvalidOperationException until the send has completed.
Occurs when the message
has a member in its ApplicationProperties collection that is an
unsupported type for serialization. See the ApplicationProperties remarks for details.
Remarks
When a message is accepted into the batch, changes made to its properties will not be reflected in the batch nor will any state transitions be reflected to the original instance.
Note: Any ReadOnlyMemory<T>, byte array, or BinaryData instance associated with the event is referenced by the batch and must remain valid and unchanged until the batch is disposed.
Applies to
Azure SDK for .NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기