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 aMessageBatch
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.@Nullable String
exchange()
Returns the value of theexchange
record component.@Nullable String
Deprecated, 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 String
Deprecated, for removal: This API element is subject to removal in a future version.in favor orroutingKey()
.final int
hashCode()
Returns a hash code value for this object.message()
Returns the value of themessage
record component.@Nullable String
Returns the value of theroutingKey
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
MessageBatch
Creates an instance of aMessageBatch
record class.- Parameters:
exchange
- the value for theexchange
record componentroutingKey
- the value for theroutingKey
record componentmessage
- the value for themessage
record 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
-
hashCode
-
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
-
routingKey
Returns the value of theroutingKey
record component.- Returns:
- the value of the
routingKey
record component
-
message
-
exchange()
.