diff --git a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPConsumer.java b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPConsumer.java index 8b474697fa..e11044845c 100644 --- a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPConsumer.java +++ b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPConsumer.java @@ -58,7 +58,7 @@ final class AMQPConsumer extends AMQPWorker { public void handleDelivery(final String consumerTag, final Envelope envelope, final BasicProperties properties, final byte[] body) throws IOException { if (closed) { // simply discard the messages, all unacknowledged messages will be redelivered by the broker when the consumer connects again - processorLog.info("Consumer is closed, discarding message (delivery tag: {}).", new Object[]{envelope.getDeliveryTag()}); + processorLog.info("Consumer is closed, discarding message (delivery tag: {}).", envelope.getDeliveryTag()); return; } @@ -123,7 +123,7 @@ final class AMQPConsumer extends AMQPWorker { GetResponse response; while ((response = responseQueue.poll()) != null) { // simply discard the messages, all unacknowledged messages will be redelivered by the broker when the consumer connects again - processorLog.info("Consumer is closed, discarding message (delivery tag: {}).", new Object[]{response.getEnvelope().getDeliveryTag()}); + processorLog.info("Consumer is closed, discarding message (delivery tag: {}).", response.getEnvelope().getDeliveryTag()); } } catch (Exception e) { processorLog.error("Failed to drain response queue."); diff --git a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java index 0a0418ac55..cc6ac163bb 100644 --- a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java +++ b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java @@ -325,7 +325,7 @@ abstract class AbstractAMQPProcessor extends AbstractProce cf.setExceptionHandler(new DefaultExceptionHandler() { @Override public void handleUnexpectedConnectionDriverException(Connection conn, Throwable exception) { - getLogger().error("Connection lost to server {}:{}.", new Object[]{conn.getAddress(), conn.getPort()}, exception); + getLogger().error("Connection lost to server {}:{}.", conn.getAddress(), conn.getPort(), exception); } }); @@ -342,7 +342,7 @@ abstract class AbstractAMQPProcessor extends AbstractProce return connection; } catch (Exception e) { - throw new IllegalStateException("Failed to establish connection with AMQP Broker: " + cf.toString(), e); + throw new IllegalStateException(String.format("Failed to establish connection with AMQP Broker: %s:%s", cf.getHost(), cf.getPort()), e); } } }