sendReceipt(packet, null, false);
}
private void sendReceipt(Packet packet, Throwable requestEx, boolean failed) {
if (packet != null && packet.isReceiptRequired()) {
Receipt receipt = new Receipt();
receipt.setId(this.packetIdGenerator.generateId());
receipt.setCorrelationId(packet.getId());
receipt.setBrokerName(brokerConnector.getBrokerInfo().getBrokerName());
receipt.setClusterName(brokerConnector.getBrokerInfo().getClusterName());
receipt.setException(requestEx);
receipt.setFailed(failed);
send(receipt);
}
}