Record Class MessageBatch
java.lang.Object
java.lang.Record
org.springframework.amqp.rabbit.batch.MessageBatch
- Record Components:
exchange- the exchange for batch of messagesroutingKey- the routing key for batchmessage- the message with a batch
public record MessageBatch(@Nullable String exchange, @Nullable String routingKey, Message message)
extends Record
An object encapsulating a
Message containing the batch of messages,
the exchange, and routing key.- Since:
- 1.4.1
- Author:
- Gary Russell, Artem Bilan
-
Constructor Summary
ConstructorsConstructorDescriptionMessageBatch(@Nullable String exchange, @Nullable String routingKey, Message message) Creates an instance of aMessageBatchrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable Stringexchange()Returns the value of theexchangerecord component.@Nullable StringDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.in favor ormessage().@Nullable StringDeprecated, for removal: This API element is subject to removal in a future version.in favor orroutingKey().final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.@Nullable StringReturns the value of theroutingKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessageBatch
Creates an instance of aMessageBatchrecord class.- Parameters:
exchange- the value for theexchangerecord componentroutingKey- the value for theroutingKeyrecord componentmessage- the value for themessagerecord component
-
-
Method Details
-
getExchange
Deprecated, for removal: This API element is subject to removal in a future version.in favor orexchange().- Returns:
- the exchange
-
getRoutingKey
Deprecated, for removal: This API element is subject to removal in a future version.in favor orroutingKey().- Returns:
- the routingKey
-
getMessage
Deprecated, for removal: This API element is subject to removal in a future version.in favor ormessage().- Returns:
- the message
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
exchange
Returns the value of theexchangerecord component.- Returns:
- the value of the
exchangerecord component
-
routingKey
Returns the value of theroutingKeyrecord component.- Returns:
- the value of the
routingKeyrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
exchange().