com.rabbitmq.client.Channel.exchangeBind()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中com.rabbitmq.client.Channel.exchangeBind()方法的一些代码示例,展示了Channel.exchangeBind()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channel.exchangeBind()方法的具体详情如下:
包路径:com.rabbitmq.client.Channel
类名称:Channel
方法名:exchangeBind

Channel.exchangeBind介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-amqp

@Override
public void exchangeBindNoWait(String destination, String source,
    String routingKey, Map<String, Object> arguments) throws IOException {
  this.delegate.exchangeBind(destination, source, routingKey, arguments);
}

代码示例来源:origin: spring-projects/spring-amqp

@Override
public BindOk exchangeBind(String destination, String source,
    String routingKey) throws IOException {
  return this.delegate.exchangeBind(destination, source, routingKey);
}

代码示例来源:origin: spring-projects/spring-amqp

@Override
public BindOk exchangeBind(String destination, String source,
    String routingKey, Map<String, Object> arguments)
    throws IOException {
  return this.delegate
      .exchangeBind(destination, source, routingKey, arguments);
}

代码示例来源:origin: org.springframework.amqp/spring-rabbit

@Override
public void exchangeBindNoWait(String destination, String source,
    String routingKey, Map<String, Object> arguments) throws IOException {
  this.delegate.exchangeBind(destination, source, routingKey, arguments);
}

代码示例来源:origin: org.springframework.amqp/spring-rabbit

@Override
public BindOk exchangeBind(String destination, String source,
    String routingKey) throws IOException {
  return this.delegate.exchangeBind(destination, source, routingKey);
}

代码示例来源:origin: org.springframework.amqp/spring-rabbit

@Override
public BindOk exchangeBind(String destination, String source,
    String routingKey, Map<String, Object> arguments)
    throws IOException {
  return this.delegate
      .exchangeBind(destination, source, routingKey, arguments);
}

代码示例来源:origin: vert-x3/vertx-rabbitmq-client

@Override
public void exchangeBind(String destination, String source, String routingKey, Handler<AsyncResult<Void>> resultHandler) {
 forChannel(resultHandler, channel -> {
  channel.exchangeBind(destination, source, routingKey);
  return null;
 });
}

代码示例来源:origin: yanghua/banyan

public void bind(String exchangeName, String bindTo, String routingKey) throws IOException {
  super.init();
  if (!this.innerExists(exchangeName, channel) || !this.innerExists(bindTo, channel)) {
    logger.error("exchange : " + exchangeName + " or " + bindTo + "is not exists");
    throw new IOException("exchange : " + exchangeName + " or " + bindTo + "is not exists");
  }
  this.channel.exchangeBind(exchangeName, bindTo, routingKey);
  super.close();
}

代码示例来源:origin: jhalterman/lyra

/** Recover exchange bindings using the {@code channelSupplier}. */
void recoverExchangeBindings(Iterable<Binding> exchangeBindings) throws Exception {
 if (exchangeBindings != null)
  synchronized (exchangeBindings) {
   for (Binding binding : exchangeBindings)
    try {
     log.info("Recovering exchange binding from {} to {} with {} via {}", binding.source,
       binding.destination, binding.routingKey, this);
     getRecoveryChannel().exchangeBind(binding.destination, binding.source,
       binding.routingKey, binding.arguments);
    } catch (Exception e) {
     log.error("Failed to recover exchange binding from {} to {} with {} via {}",
       binding.source, binding.destination, binding.routingKey, this, e);
     if (throwOnRecoveryFailure() || Exceptions.isCausedByConnectionClosure(e))
      throw e;
    }
  }
}

代码示例来源:origin: net.jodah/lyra

/** Recover exchange bindings using the {@code channelSupplier}. */
void recoverExchangeBindings(Iterable<Binding> exchangeBindings) throws Exception {
 if (exchangeBindings != null)
  synchronized (exchangeBindings) {
   for (Binding binding : exchangeBindings)
    try {
     log.info("Recovering exchange binding from {} to {} with {} via {}", binding.source,
       binding.destination, binding.routingKey, this);
     getRecoveryChannel().exchangeBind(binding.destination, binding.source,
       binding.routingKey, binding.arguments);
    } catch (Exception e) {
     log.error("Failed to recover exchange binding from {} to {} with {} via {}",
       binding.source, binding.destination, binding.routingKey, this, e);
     if (throwOnRecoveryFailure() || Exceptions.isCausedByConnectionClosure(e))
      throw e;
    }
  }
}

代码示例来源:origin: yanghua/banyan

public void create(String exchangeName,
          String routerType,
          String bindTo,
          String routingKey) throws IOException {
  super.init();
  this.channel.exchangeDeclare(exchangeName, routerType, true);
  //bind
  if (bindTo != null && !bindTo.isEmpty() && this.innerExists(bindTo, channel))
    this.channel.exchangeBind(exchangeName, bindTo, routingKey);
  super.close();
}

代码示例来源:origin: io.eventuate.tram.core/eventuate-tram-consumer-rabbitmq

private void leaderSelected() {
 logger.info("Subscription selected as leader. {}", identificationInformation());
 subscriberGroupChannel = createRabbitMQChannel();
 for (String channelName : channels) {
  try {
   logger.info("Leading subscription is creating exchanges and queues for channel {}. {}",
       channelName, identificationInformation());
   subscriberGroupChannel.exchangeDeclare(makeConsistentHashExchangeName(channelName, subscriberId), "x-consistent-hash");
   for (int i = 0; i < partitionCount; i++) {
    subscriberGroupChannel.queueDeclare(makeConsistentHashQueueName(channelName, subscriberId, i), true, false, false, null);
    subscriberGroupChannel.queueBind(makeConsistentHashQueueName(channelName, subscriberId, i), makeConsistentHashExchangeName(channelName, subscriberId), "10");
   }
   subscriberGroupChannel.exchangeDeclare(channelName, "fanout");
   subscriberGroupChannel.exchangeBind(makeConsistentHashExchangeName(channelName, subscriberId), channelName, "");
   logger.info("Leading subscription created exchanges and queues for channel {}. {}",
       channelName, identificationInformation());
  } catch (IOException e) {
   logger.error(e.getMessage(), e);
   throw new RuntimeException(e);
  }
 }
}

代码示例来源:origin: yanghua/banyan

public void initExchange(List<Exchange> sortedExchanges, Map<Integer, Exchange> exchangeMap) {
  try {
    super.init();
    //declare exchange
    for (Exchange exchange : sortedExchanges) {
      channel.exchangeDeclare(exchange.getExchangeName(), exchange.getRouterType(), true);
    }
    //bind exchange
    for (Exchange exchange : sortedExchanges) {
      if (exchange.getParentId() == -1)
        continue;
      channel.exchangeBind(exchange.getExchangeName(),
          exchangeMap.get(exchange.getParentId()).getExchangeName(),
          exchange.getRoutingKey());
    }
  } catch (IOException e) {
    logger.error(e);
    throw new RuntimeException(e);
  } finally {
    super.close();
  }
}

代码示例来源:origin: rabbitmq/rabbitmq-jms-client

this.channel.exchangeBind(selectionExchange, dest.getAmqpExchangeName(), dest.getAmqpRoutingKey());
this.bindSelectorQueue(dest, jmsSelector, queueName, selectionExchange);

代码示例来源:origin: kodokojo/kodokojo

channel.exchangeBind(microServiceConfig.name(), rabbitMqConfig.broadcastExchangeName(), "");

代码示例来源:origin: spring-projects/spring-amqp

private void declareBindings(final Channel channel, final Binding... bindings) throws IOException {
  for (Binding binding : bindings) {
    if (this.logger.isDebugEnabled()) {
      this.logger.debug("Binding destination [" + binding.getDestination() + " (" + binding.getDestinationType()
          + ")] to exchange [" + binding.getExchange() + "] with routing key [" + binding.getRoutingKey()
          + "]");
    }
    try {
      if (binding.isDestinationQueue()) {
        if (!isDeclaringImplicitQueueBinding(binding)) {
          channel.queueBind(binding.getDestination(), binding.getExchange(), binding.getRoutingKey(),
              binding.getArguments());
        }
      }
      else {
        channel.exchangeBind(binding.getDestination(), binding.getExchange(), binding.getRoutingKey(),
            binding.getArguments());
      }
    }
    catch (IOException e) {
      logOrRethrowDeclarationException(binding, "binding", e);
    }
  }
}

代码示例来源:origin: org.springframework.amqp/spring-rabbit

private void declareBindings(final Channel channel, final Binding... bindings) throws IOException {
  for (Binding binding : bindings) {
    if (this.logger.isDebugEnabled()) {
      this.logger.debug("Binding destination [" + binding.getDestination() + " (" + binding.getDestinationType()
          + ")] to exchange [" + binding.getExchange() + "] with routing key [" + binding.getRoutingKey()
          + "]");
    }
    try {
      if (binding.isDestinationQueue()) {
        if (!isDeclaringImplicitQueueBinding(binding)) {
          channel.queueBind(binding.getDestination(), binding.getExchange(), binding.getRoutingKey(),
              binding.getArguments());
        }
      }
      else {
        channel.exchangeBind(binding.getDestination(), binding.getExchange(), binding.getRoutingKey(),
            binding.getArguments());
      }
    }
    catch (IOException e) {
      logOrRethrowDeclarationException(binding, "binding", e);
    }
  }
}

代码示例来源:origin: com.intrbiz.bergamot/bergamot-queue

on.exchangeDeclare("bergamot.check.worker_pool." + site + ".any", "topic", true, false, args("alternate-exchange", "bergamot.dead_check"));
  on.exchangeBind("bergamot.check.site." + site, "bergamot.check", site + ".*.*.*");
  on.exchangeBind("bergamot.check.site.default", "bergamot.check.worker_pool.default." + workerPool, "*." + workerPool + ".*.*");
  on.exchangeBind("bergamot.check.worker_pool." + site + "." + workerPool, "bergamot.check.site." + site, "*." + workerPool + ".*.*");
on.exchangeBind(engineExchangeName, "bergamot.check.worker_pool." + Util.coalesce(site, "default") + "." + Util.coalesce(workerPool, "any"), "*.*." + engine + ".*");

相关文章

微信公众号

最新文章

更多