本文整理了Java中org.springframework.amqp.core.Binding.setAdminsThatShouldDeclare()
方法的一些代码示例,展示了Binding.setAdminsThatShouldDeclare()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binding.setAdminsThatShouldDeclare()
方法的具体详情如下:
包路径:org.springframework.amqp.core.Binding
类名称:Binding
方法名:setAdminsThatShouldDeclare
暂无
代码示例来源:origin: stackoverflow.com
binding.setAdminsThatShouldDeclare(rabbitAdmin);
代码示例来源:origin: spring-projects/spring-amqp
@Override
public Binding getObject() {
String destination;
DestinationType destinationType;
if (this.destinationQueue != null) {
destination = this.destinationQueue.getName();
destinationType = DestinationType.QUEUE;
}
else {
destination = this.destinationExchange.getName();
destinationType = DestinationType.EXCHANGE;
}
Binding binding = new Binding(destination, destinationType, this.exchange, this.routingKey, this.arguments);
if (this.shouldDeclare != null) {
binding.setShouldDeclare(this.shouldDeclare);
}
if (this.ignoreDeclarationExceptions != null) {
binding.setIgnoreDeclarationExceptions(this.ignoreDeclarationExceptions);
}
if (this.adminsThatShouldDeclare != null) {
binding.setAdminsThatShouldDeclare((Object[]) this.adminsThatShouldDeclare);
}
return binding;
}
代码示例来源:origin: spring-projects/spring-amqp
@Bean
public Binding binding() throws IOException {
Binding binding = new Binding("foo", DestinationType.QUEUE, exchange().getName(), "foo", null);
binding.setAdminsThatShouldDeclare(admin1());
return binding;
}
}
代码示例来源:origin: org.springframework.amqp/spring-rabbit
@Override
public Binding getObject() {
String destination;
DestinationType destinationType;
if (this.destinationQueue != null) {
destination = this.destinationQueue.getName();
destinationType = DestinationType.QUEUE;
}
else {
destination = this.destinationExchange.getName();
destinationType = DestinationType.EXCHANGE;
}
Binding binding = new Binding(destination, destinationType, this.exchange, this.routingKey, this.arguments);
if (this.shouldDeclare != null) {
binding.setShouldDeclare(this.shouldDeclare);
}
if (this.ignoreDeclarationExceptions != null) {
binding.setIgnoreDeclarationExceptions(this.ignoreDeclarationExceptions);
}
if (this.adminsThatShouldDeclare != null) {
binding.setAdminsThatShouldDeclare((Object[]) this.adminsThatShouldDeclare);
}
return binding;
}
代码示例来源:origin: spring-projects/spring-amqp
context.getBeanFactory().registerSingleton("bar", exchange);
Binding binding = new Binding("foo", DestinationType.QUEUE, "bar", "foo", null);
binding.setAdminsThatShouldDeclare(admin);
context.getBeanFactory().registerSingleton("baz", binding);
context.refresh();
代码示例来源:origin: spring-projects/spring-amqp
context.getBeanFactory().registerSingleton("bar", exchange);
Binding binding = new Binding("foo", DestinationType.QUEUE, "bar", "foo", null);
binding.setAdminsThatShouldDeclare(other);
context.getBeanFactory().registerSingleton("baz", binding);
context.refresh();
代码示例来源:origin: spring-projects/spring-amqp
private void registerBindings(QueueBinding binding, String queueName, String exchangeName, String exchangeType) {
final String[] routingKeys;
if (exchangeType.equals(ExchangeTypes.FANOUT) || binding.key().length == 0) {
routingKeys = new String[] { "" };
}
else {
final int length = binding.key().length;
routingKeys = new String[length];
for (int i = 0; i < length; ++i) {
routingKeys[i] = resolveExpressionAsString(binding.key()[i], "@QueueBinding.key");
}
}
final Map<String, Object> bindingArguments = resolveArguments(binding.arguments());
final boolean bindingIgnoreExceptions = resolveExpressionAsBoolean(binding.ignoreDeclarationExceptions());
boolean declare = resolveExpressionAsBoolean(binding.declare());
for (String routingKey : routingKeys) {
final Binding actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, routingKey,
bindingArguments);
actualBinding.setIgnoreDeclarationExceptions(bindingIgnoreExceptions);
actualBinding.setShouldDeclare(declare);
if (binding.admins().length > 0) {
actualBinding.setAdminsThatShouldDeclare((Object[]) binding.admins());
}
((ConfigurableBeanFactory) this.beanFactory)
.registerSingleton(exchangeName + "." + queueName + ++this.increment, actualBinding);
}
}
代码示例来源:origin: org.springframework.amqp/spring-rabbit
private void registerBindings(QueueBinding binding, String queueName, String exchangeName, String exchangeType) {
final String[] routingKeys;
if (exchangeType.equals(ExchangeTypes.FANOUT) || binding.key().length == 0) {
routingKeys = new String[] { "" };
}
else {
final int length = binding.key().length;
routingKeys = new String[length];
for (int i = 0; i < length; ++i) {
routingKeys[i] = resolveExpressionAsString(binding.key()[i], "@QueueBinding.key");
}
}
final Map<String, Object> bindingArguments = resolveArguments(binding.arguments());
final boolean bindingIgnoreExceptions = resolveExpressionAsBoolean(binding.ignoreDeclarationExceptions());
boolean declare = resolveExpressionAsBoolean(binding.declare());
for (String routingKey : routingKeys) {
final Binding actualBinding = new Binding(queueName, DestinationType.QUEUE, exchangeName, routingKey,
bindingArguments);
actualBinding.setIgnoreDeclarationExceptions(bindingIgnoreExceptions);
actualBinding.setShouldDeclare(declare);
if (binding.admins().length > 0) {
actualBinding.setAdminsThatShouldDeclare((Object[]) binding.admins());
}
((ConfigurableBeanFactory) this.beanFactory)
.registerSingleton(exchangeName + "." + queueName + ++this.increment, actualBinding);
}
}
内容来源于网络,如有侵权,请联系作者删除!