public final class ServiceBusMessageBatch extends Object
ServiceBusMessage
into a single, size-limited, batch. It is treated as a single
message when sent to the Azure Service Bus service.Modifier and Type | Method and Description |
---|---|
int |
getCount()
Gets the number of
events in the batch. |
int |
getMaxSizeInBytes()
Gets the maximum size, in bytes, of the
ServiceBusMessageBatch . |
int |
getSizeInBytes()
Gets the size of the
ServiceBusMessageBatch in bytes. |
boolean |
tryAdd(ServiceBusMessage serviceBusMessage)
Tries to add an
message to the batch. |
public int getCount()
events
in the batch.events
in the batch.public int getMaxSizeInBytes()
ServiceBusMessageBatch
.ServiceBusMessageBatch
.public int getSizeInBytes()
ServiceBusMessageBatch
in bytes.ServiceBusMessageBatch
in bytes.public boolean tryAdd(ServiceBusMessage serviceBusMessage)
message
to the batch.serviceBusMessage
- The ServiceBusMessage
to add to the batch.true
if the message could be added to the batch; false
if the event was too large to fit
in the batch.IllegalArgumentException
- if message
is null
.com.azure.core.amqp.exception.AmqpException
- if message
is larger than the maximum size of the ServiceBusMessageBatch
.Copyright © 2020 Microsoft Corporation. All rights reserved.