org.springframework.amqp.core.Binding.setAdminsThatShouldDeclare()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(190)

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

Binding.setAdminsThatShouldDeclare介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

  1. binding.setAdminsThatShouldDeclare(rabbitAdmin);

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

  1. @Override
  2. public Binding getObject() {
  3. String destination;
  4. DestinationType destinationType;
  5. if (this.destinationQueue != null) {
  6. destination = this.destinationQueue.getName();
  7. destinationType = DestinationType.QUEUE;
  8. }
  9. else {
  10. destination = this.destinationExchange.getName();
  11. destinationType = DestinationType.EXCHANGE;
  12. }
  13. Binding binding = new Binding(destination, destinationType, this.exchange, this.routingKey, this.arguments);
  14. if (this.shouldDeclare != null) {
  15. binding.setShouldDeclare(this.shouldDeclare);
  16. }
  17. if (this.ignoreDeclarationExceptions != null) {
  18. binding.setIgnoreDeclarationExceptions(this.ignoreDeclarationExceptions);
  19. }
  20. if (this.adminsThatShouldDeclare != null) {
  21. binding.setAdminsThatShouldDeclare((Object[]) this.adminsThatShouldDeclare);
  22. }
  23. return binding;
  24. }

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

  1. @Bean
  2. public Binding binding() throws IOException {
  3. Binding binding = new Binding("foo", DestinationType.QUEUE, exchange().getName(), "foo", null);
  4. binding.setAdminsThatShouldDeclare(admin1());
  5. return binding;
  6. }
  7. }

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

  1. @Override
  2. public Binding getObject() {
  3. String destination;
  4. DestinationType destinationType;
  5. if (this.destinationQueue != null) {
  6. destination = this.destinationQueue.getName();
  7. destinationType = DestinationType.QUEUE;
  8. }
  9. else {
  10. destination = this.destinationExchange.getName();
  11. destinationType = DestinationType.EXCHANGE;
  12. }
  13. Binding binding = new Binding(destination, destinationType, this.exchange, this.routingKey, this.arguments);
  14. if (this.shouldDeclare != null) {
  15. binding.setShouldDeclare(this.shouldDeclare);
  16. }
  17. if (this.ignoreDeclarationExceptions != null) {
  18. binding.setIgnoreDeclarationExceptions(this.ignoreDeclarationExceptions);
  19. }
  20. if (this.adminsThatShouldDeclare != null) {
  21. binding.setAdminsThatShouldDeclare((Object[]) this.adminsThatShouldDeclare);
  22. }
  23. return binding;
  24. }

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

  1. context.getBeanFactory().registerSingleton("bar", exchange);
  2. Binding binding = new Binding("foo", DestinationType.QUEUE, "bar", "foo", null);
  3. binding.setAdminsThatShouldDeclare(admin);
  4. context.getBeanFactory().registerSingleton("baz", binding);
  5. context.refresh();

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

  1. context.getBeanFactory().registerSingleton("bar", exchange);
  2. Binding binding = new Binding("foo", DestinationType.QUEUE, "bar", "foo", null);
  3. binding.setAdminsThatShouldDeclare(other);
  4. context.getBeanFactory().registerSingleton("baz", binding);
  5. context.refresh();

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

  1. private void registerBindings(QueueBinding binding, String queueName, String exchangeName, String exchangeType) {
  2. final String[] routingKeys;
  3. if (exchangeType.equals(ExchangeTypes.FANOUT) || binding.key().length == 0) {
  4. routingKeys = new String[] { "" };
  5. }
  6. else {
  7. final int length = binding.key().length;
  8. routingKeys = new String[length];
  9. for (int i = 0; i < length; ++i) {
  10. routingKeys[i] = resolveExpressionAsString(binding.key()[i], "@QueueBinding.key");
  11. }
  12. }
  13. final Map<String, Object> bindingArguments = resolveArguments(binding.arguments());
  14. final boolean bindingIgnoreExceptions = resolveExpressionAsBoolean(binding.ignoreDeclarationExceptions());
  15. boolean declare = resolveExpressionAsBoolean(binding.declare());
  16. for (String routingKey : routingKeys) {
  17. final Binding actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, routingKey,
  18. bindingArguments);
  19. actualBinding.setIgnoreDeclarationExceptions(bindingIgnoreExceptions);
  20. actualBinding.setShouldDeclare(declare);
  21. if (binding.admins().length > 0) {
  22. actualBinding.setAdminsThatShouldDeclare((Object[]) binding.admins());
  23. }
  24. ((ConfigurableBeanFactory) this.beanFactory)
  25. .registerSingleton(exchangeName + "." + queueName + ++this.increment, actualBinding);
  26. }
  27. }

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

  1. private void registerBindings(QueueBinding binding, String queueName, String exchangeName, String exchangeType) {
  2. final String[] routingKeys;
  3. if (exchangeType.equals(ExchangeTypes.FANOUT) || binding.key().length == 0) {
  4. routingKeys = new String[] { "" };
  5. }
  6. else {
  7. final int length = binding.key().length;
  8. routingKeys = new String[length];
  9. for (int i = 0; i < length; ++i) {
  10. routingKeys[i] = resolveExpressionAsString(binding.key()[i], "@QueueBinding.key");
  11. }
  12. }
  13. final Map<String, Object> bindingArguments = resolveArguments(binding.arguments());
  14. final boolean bindingIgnoreExceptions = resolveExpressionAsBoolean(binding.ignoreDeclarationExceptions());
  15. boolean declare = resolveExpressionAsBoolean(binding.declare());
  16. for (String routingKey : routingKeys) {
  17. final Binding actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, routingKey,
  18. bindingArguments);
  19. actualBinding.setIgnoreDeclarationExceptions(bindingIgnoreExceptions);
  20. actualBinding.setShouldDeclare(declare);
  21. if (binding.admins().length > 0) {
  22. actualBinding.setAdminsThatShouldDeclare((Object[]) binding.admins());
  23. }
  24. ((ConfigurableBeanFactory) this.beanFactory)
  25. .registerSingleton(exchangeName + "." + queueName + ++this.increment, actualBinding);
  26. }
  27. }

相关文章