Currently AmqpMessage.isBodyNull() throws an IllegalStateException("The body is not an AMQP Value") if message.getBody() is not null and it's type is not an AmqpValue.
This does not comply to what the javadoc says: This method returns true is the message does not contain a body or if the message contain a null AMQP value as body.
java.lang.IllegalStateException: The body is not an AMQP Value
at io.vertx.amqp.impl.AmqpMessageImpl.getAmqpValue(AmqpMessageImpl.java:100) ~[vertx-amqp-client-4.0.0.jar:4.0.0]
at io.vertx.amqp.impl.AmqpMessageImpl.isBodyNull(AmqpMessageImpl.java:95) ~[vertx-amqp-client-4.0.0.jar:4.0.0]
@Override
public boolean isBodyNull() {
return message.getBody() == null || getAmqpValue() == null;
}
private Object getAmqpValue() {
if (message.getBody().getType() != Section.SectionType.AmqpValue) {
throw new IllegalStateException("The body is not an AMQP Value");
}
return ((AmqpValue) message.getBody()).getValue();
}
Currently
AmqpMessage.isBodyNull()
throws an IllegalStateException("The body is not an AMQP Value") ifmessage.getBody()
is not null and it's type is not an AmqpValue.This does not comply to what the javadoc says:
This method returns true is the message does not contain a body or if the message contain a null AMQP value as body.