本文整理汇总了Java中org.springframework.amqp.core.AmqpAdmin类的典型用法代码示例。如果您正苦于以下问题:Java AmqpAdmin类的具体用法?Java AmqpAdmin怎么用?Java AmqpAdmin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AmqpAdmin类属于org.springframework.amqp.core包,在下文中一共展示了AmqpAdmin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: schedulingRunner
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Bean
public CommandLineRunner schedulingRunner(final TaskExecutor executor, final AmqpAdmin amqpAdmin, final ProcessService processStarter) {
return args -> executor.execute(() -> {
// Init Rabbit exchange and queue
amqpAdmin.deleteExchange(EXCHANGE);
TopicExchange exchange = new TopicExchange(EXCHANGE);
amqpAdmin.declareExchange(exchange);
Queue queue = new Queue("flowable-history-jobs", true);
amqpAdmin.declareQueue(queue);
amqpAdmin.declareBinding(BindingBuilder.bind(queue).to(exchange).with("flowable-history-jobs"));
});
}
示例2: amqpAdmin
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Bean
@ConditionalOnSingleCandidate(ConnectionFactory.class)
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = "dynamic", matchIfMissing = true)
@ConditionalOnMissingBean(AmqpAdmin.class)
public AmqpAdmin amqpAdmin(ConnectionFactory connectionFactory) {
return new RabbitAdmin(connectionFactory);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:RabbitAutoConfiguration.java
示例3: testStaticQueues
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Test
public void testStaticQueues() {
load(TestConfiguration.class, "spring.rabbitmq.dynamic:false");
// There should NOT be an AmqpAdmin bean when dynamic is switch to false
this.thrown.expect(NoSuchBeanDefinitionException.class);
this.thrown.expectMessage("No qualifying bean of type "
+ "[org.springframework.amqp.core.AmqpAdmin] is defined");
this.context.getBean(AmqpAdmin.class);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:RabbitAutoConfigurationTests.java
示例4: prepareQueues
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Bean
public InitializingBean prepareQueues(AmqpAdmin amqpAdmin) {
return () -> {
Queue queue = new Queue(NOTIFICATIONS, true);
DirectExchange exchange = new DirectExchange(NOTIFICATIONS);
Binding binding = BindingBuilder.bind(queue).to(exchange).with(NOTIFICATIONS);
amqpAdmin.declareQueue(queue);
amqpAdmin.declareExchange(exchange);
amqpAdmin.declareBinding(binding);
};
}
示例5: prepareQueues
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Bean
public InitializingBean prepareQueues(AmqpAdmin amqpAdmin) {
return () -> {
Queue queue = new Queue(this.echoQueueAndExchangeName, true);
DirectExchange exchange = new DirectExchange(this.echoQueueAndExchangeName);
Binding binding = BindingBuilder.bind(queue).to(exchange)
.with(this.echoQueueAndExchangeName);
amqpAdmin.declareQueue(queue);
amqpAdmin.declareExchange(exchange);
amqpAdmin.declareBinding(binding);
};
}
示例6: amqpAdmin
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
/**
* RabbitMQの管理操作を実行する{@link AmqpAdmin}のインスタンスを生成し、DIコンテナに登録します。
* この{@link AmqpAdmin}を利用することにより、Exchange/Queueの自動生成を行うことが可能となります。
* 自動生成する場合はSpring のBeanProfileのスコープ指定を<strong>development</strong>に指定してください。
* @return {@link RabbitAdmin}のインスタンス
*/
@Bean
@Profile("development")
public AmqpAdmin amqpAdmin() {
RabbitAdmin rabbitAdmin = new RabbitAdmin(factory());
rabbitAdmin.setAutoStartup(true);
return rabbitAdmin;
}
示例7: setup
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Before
public void setup() {
context = new AnnotationConfigApplicationContext(RabbitMQInitializerTestContext.class);
admin = context.getBean(AmqpAdmin.class);
initializer = new RabbitMQInitializer();
initializer.setAdmin(admin);
initializer.setContext(context);
initializer.setDeleted(true);
}
示例8: rabbitAdmin
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Bean
AmqpAdmin rabbitAdmin(ConnectionFactory connectionFactory) {
return new RabbitAdmin(connectionFactory);
}
示例9: rabbitAdmin
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Autowired
void rabbitAdmin(AmqpAdmin admin, FanoutExchange eventBusExchange) {
admin.declareExchange(eventBusExchange);
}
示例10: MqProducer
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Autowired
public MqProducer(AmqpAdmin amqpAdmin, AmqpTemplate amqpTemplate) {
this.amqpAdmin = amqpAdmin;
this.amqpTemplate = amqpTemplate;
}
示例11: rabbitAdmin
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Bean
@ConditionalOnSingleCandidate(ConnectionFactory.class)
@ConditionalOnMissingBean(AmqpAdmin.class)
public RabbitAdmin rabbitAdmin() {
return new RabbitAdmin(connectionFactory);
}
示例12: amqpAdmin
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Bean
public AmqpAdmin amqpAdmin() {
RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory());
return rabbitAdmin;
}
示例13: amqpAdmin
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Bean
public AmqpAdmin amqpAdmin() {
return new RabbitAdmin(connectionFactory());
}
示例14: getRabbitAdmin
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Bean
public AmqpAdmin getRabbitAdmin(final ConnectionFactory connectionFactory) {
return new RabbitAdmin(connectionFactory);
}
示例15: amqpService
import org.springframework.amqp.core.AmqpAdmin; //导入依赖的package包/类
@Bean
@Autowired
AmqpService amqpService(AmqpAdmin amqpAdmin, ConnectionFactory connectionFactory, AmqpTemplate amqpTemplate) {
return new AmqpService(amqpAdmin, connectionFactory, amqpTemplate);
}