getBodyObject
Retrieve the body of the message as an object of the given type. Allowing to write message.getBodyObject<Foo>()
instead of message.getBody(Argument.of(Foo::class.java)).getOrNull()
or message.getBody(Foo::class.java)).getOrNull()
.
Parameters
T
The type of the object