return new AmqpConnectException((ShutdownSignalException) ex); return new AmqpConnectException((ConnectException) ex);
return new AmqpConnectException((ShutdownSignalException) ex); return new AmqpConnectException((ConnectException) ex);
throw e instanceof AmqpConnectException // NOSONAR exception type check ? (AmqpConnectException) e : new AmqpConnectException(e);
throw e instanceof AmqpConnectException // NOSONAR exception type check ? (AmqpConnectException) e : new AmqpConnectException(e);
throw new AmqpConnectException(null);
@Nullable private SimpleConsumer consume(String queue, Connection connection) { Channel channel = null; SimpleConsumer consumer = null; try { channel = connection.createChannel(isChannelTransacted()); channel.basicQos(getPrefetchCount()); consumer = new SimpleConsumer(connection, channel, queue); channel.queueDeclarePassive(queue); consumer.consumerTag = channel.basicConsume(queue, getAcknowledgeMode().isAutoAck(), (getConsumerTagStrategy() != null ? getConsumerTagStrategy().createConsumerTag(queue) : ""), // NOSONAR never null isNoLocal(), isExclusive(), getConsumerArguments(), consumer); } catch (AmqpApplicationContextClosedException e) { throw new AmqpConnectException(e); } catch (Exception e) { RabbitUtils.closeChannel(channel); RabbitUtils.closeConnection(connection); consumer = handleConsumeException(queue, consumer, e); } return consumer; }
@Nullable private SimpleConsumer consume(String queue, Connection connection) { Channel channel = null; SimpleConsumer consumer = null; try { channel = connection.createChannel(isChannelTransacted()); channel.basicQos(getPrefetchCount()); consumer = new SimpleConsumer(connection, channel, queue); channel.queueDeclarePassive(queue); consumer.consumerTag = channel.basicConsume(queue, getAcknowledgeMode().isAutoAck(), (getConsumerTagStrategy() != null ? getConsumerTagStrategy().createConsumerTag(queue) : ""), // NOSONAR never null isNoLocal(), isExclusive(), getConsumerArguments(), consumer); } catch (AmqpApplicationContextClosedException e) { throw new AmqpConnectException(e); } catch (Exception e) { RabbitUtils.closeChannel(channel); RabbitUtils.closeConnection(connection); consumer = handleConsumeException(queue, consumer, e); } return consumer; }