From d9b0864a0183db267a404f9d475d7dc2d64e4e58 Mon Sep 17 00:00:00 2001 From: Aliaksandr Belik Date: Fri, 29 Oct 2021 04:13:22 +0300 Subject: [PATCH] Fix no header in reply-to message (see jlavallee#41) --- .../jmeter/protocol/amqp/AMQPConsumer.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zeroclue/jmeter/protocol/amqp/AMQPConsumer.java b/src/main/java/com/zeroclue/jmeter/protocol/amqp/AMQPConsumer.java index 369797b..dbec681 100644 --- a/src/main/java/com/zeroclue/jmeter/protocol/amqp/AMQPConsumer.java +++ b/src/main/java/com/zeroclue/jmeter/protocol/amqp/AMQPConsumer.java @@ -365,13 +365,18 @@ private String formatHeaders(QueueingConsumer.Delivery delivery) { .append(": ") .append(delivery.getEnvelope().getRoutingKey()) .append("\n"); - sb.append(DELIVERY_TAG_PARAMETER).append(": ").append(delivery.getEnvelope().getDeliveryTag()).append("\n"); + sb.append(DELIVERY_TAG_PARAMETER) + .append(": ") + .append(delivery.getEnvelope().getDeliveryTag()) + .append("\n"); - for (String key : headers.keySet()) { - sb.append(key) - .append(": ") - .append(headers.get(key)) - .append("\n"); + if (headers != null) { + for (String key : headers.keySet()) { + sb.append(key) + .append(": ") + .append(headers.get(key)) + .append("\n"); + } } return sb.toString();