@Override public DeclareOk exchangeDeclarePassive(String name) throws IOException { return this.delegate.exchangeDeclarePassive(name); }
private boolean innerExists(String exchangeName, Channel outerChannel) { boolean result = true; try { outerChannel.exchangeDeclarePassive(exchangeName); } catch (IOException e) { result = false; } return result; }
@Override public DeclareOk exchangeDeclarePassive(String name) throws IOException { return this.delegate.exchangeDeclarePassive(name); }
@Override public AMQP.Exchange.DeclareOk exchangeDeclarePassive(String name) throws IOException { return delegate.exchangeDeclarePassive(name); }
public boolean exchangeExists(String exchangeName) throws IOException { super.init(); boolean result = true; try { this.channel.exchangeDeclarePassive(exchangeName); } catch (IOException e) { result = false; } super.close(); return result; }
private boolean exchangeExists(String exchangeName) throws IOException { boolean result = true; try { channel.exchangeDeclarePassive(exchangeName); } catch (IOException e) { result = false; if (!channel.isOpen()) { super.init(); } } return result; }
channel.exchangeDeclarePassive(exchangeName); exchangeAvailable = true; } catch (IOException e) {
/** * Verifies the exchange exists, creates an exclusive, server-named queue * and binds it to the exchange. * * @return the server's response to the successful queue declaration (you * can use this to discover the name of the queue). * * @throws IOException if the exchange does not exist, or if the AMQP * connection drops. */ @Override public Queue.DeclareOk declare(Channel channel) throws IOException { channel.exchangeDeclarePassive(exchange); final Queue.DeclareOk queue = channel.queueDeclare(); channel.queueBind(queue.getQueue(), exchange, routingKey); return queue; }
private void declareExchange(final Channel channel, final String exchange, final String exchangeType, final Map<String, Object> exchangeArgs) throws IOException { if (endpoint.isPassive()) { channel.exchangeDeclarePassive(exchange); } else { channel.exchangeDeclare(exchange, exchangeType, endpoint.isDurable(), endpoint.isAutoDelete(), exchangeArgs); } }
/** * Verifies the exchange exists, creates the named queue if it does not * exist, and binds it to the exchange. * * @return the server's response to the successful queue declaration. * * @throws IOException if the exchange does not exist, the queue could not * be declared, or if the AMQP connection drops. */ @Override public Queue.DeclareOk declare(Channel channel) throws IOException { channel.exchangeDeclarePassive(exchange); final Queue.DeclareOk queue = channel.queueDeclare( queueName, /* durable */ true, /* non-exclusive */ false, /* non-auto-delete */ false, /* no arguments */ null); channel.queueBind(queue.getQueue(), exchange, routingKey); return queue; }
rmqChannel.getChannel().exchangeDeclarePassive(exchangeName); exchangeAvailable = true; } catch (IOException e) {
@Override protected void preEnhancement(final ReceiveBuilder receiveBuilder) { receiveBuilder .match(ChannelCreated.class, channelCreated -> { this.channelActor = channelCreated.channel(); addressMetric = ConnectivityModelFactory.newAddressMetric(ConnectionStatus.OPEN, "Started at " + Instant.now(), 0, null); final Set<String> exchanges = targets.stream() .map(t -> toPublishTarget(t.getAddress())) .map(RabbitMQTarget::getExchange) .collect(Collectors.toSet()); final ChannelMessage channelMessage = ChannelMessage.apply(channel -> { exchanges.forEach(exchange -> { log.debug("Checking for existence of exchange <{}>", exchange); try { channel.exchangeDeclarePassive(exchange); } catch (final IOException e) { log.warning("Failed to declare exchange <{}> passively", exchange); addressMetric = ConnectivityModelFactory.newAddressMetric(ConnectionStatus.FAILED, "Exchange '" + exchange + "' was missing at " + Instant.now(), 0, null); } }); return null; }, false); channelCreated.channel().tell(channelMessage, getSelf()); }); }
@Override protected void preEnhancement(final ReceiveBuilder receiveBuilder) { receiveBuilder .match(ChannelCreated.class, channelCreated -> { this.channelActor = channelCreated.channel(); addressMetric = ConnectivityModelFactory.newAddressMetric(ConnectionStatus.OPEN, "Started at " + Instant.now(), 0, null); final Set<String> exchanges = targets.stream() .map(t -> toPublishTarget(t.getAddress())) .map(RabbitMQTarget::getExchange) .collect(Collectors.toSet()); final ChannelMessage channelMessage = ChannelMessage.apply(channel -> { exchanges.forEach(exchange -> { log.debug("Checking for existence of exchange <{}>", exchange); try { channel.exchangeDeclarePassive(exchange); } catch (final IOException e) { log.warning("Failed to declare exchange <{}> passively", exchange); addressMetric = ConnectivityModelFactory.newAddressMetric(ConnectionStatus.FAILED, "Exchange '" + exchange + "' was missing at " + Instant.now(), 0, null); } }); return null; }, false); channelCreated.channel().tell(channelMessage, getSelf()); }); }
channel.exchangeDeclarePassive(exchangeName); return null; });
channel.exchangeDeclarePassive(exchangeName); } catch (Exception e) { channel = connection.createChannel();
channel.exchangeDeclarePassive(exchangeName); } catch (java.io.IOException e) { logger.info("Exchange :" + exchangeName + " not found. Declaring exchange.");
channel.exchangeDeclarePassive(settings.getExchange());
channel.exchangeDeclarePassive("openbaton-exchange"); channel.queueDeclarePassive("nfvo.manager.handling"); channel.basicQos(1);
channel.exchangeDeclarePassive("openbaton-exchange"); channel.queueDeclarePassive("nfvo.manager.handling"); channel.basicQos(1);
channel.exchangeDeclarePassive(settings.getExchange());