| Modifier and Type | Method and Description |
|---|---|
int |
getCount()
Gets the number of
messages in the batch. |
int |
getMaxSizeInBytes()
Gets the maximum size, in bytes, of the
batch. |
int |
getSizeInBytes()
Gets the size of the
batch in bytes. |
boolean |
tryAddMessage(ServiceBusMessage serviceBusMessage)
Tries to add an
message to the batch. |
public int getCount()
messages in the batch.messages in the batch.public int getMaxSizeInBytes()
batch.batch.public int getSizeInBytes()
batch in bytes.batch in bytes.public boolean tryAddMessage(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.NullPointerException - if message is null.com.azure.core.amqp.exception.AmqpException - if message is larger than the maximum size of the ServiceBusMessageBatch.Visit the Azure for Java Developers site for more Java documentation, including quick starts, tutorials, and code samples.