本文整理汇总了Java中org.springframework.amqp.rabbit.core.RabbitAdmin.deleteQueue方法的典型用法代码示例。如果您正苦于以下问题:Java RabbitAdmin.deleteQueue方法的具体用法?Java RabbitAdmin.deleteQueue怎么用?Java RabbitAdmin.deleteQueue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.amqp.rabbit.core.RabbitAdmin
的用法示例。
在下文中一共展示了RabbitAdmin.deleteQueue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: declareQueue
import org.springframework.amqp.rabbit.core.RabbitAdmin; //导入方法依赖的package包/类
@Override
public void declareQueue() throws IOException {
RabbitAdmin rabbitAdmin = rabbitAdmin();
try {
rabbitAdmin.declareQueue(new Queue("demo2",false,false,false));
}catch (Exception e){
try {
if (406 == ((AMQImpl.Channel.Close) ((ShutdownSignalException)e.getCause().getCause()).getReason()).getReplyCode()) {
rabbitAdmin.deleteQueue("demo2");
declareQueue();
}
}catch (Exception e1){
}
log.error("e 's value : {}", e);
}
}
示例2: cleanUp
import org.springframework.amqp.rabbit.core.RabbitAdmin; //导入方法依赖的package包/类
@After
public void cleanUp() {
RabbitAdmin admin = new RabbitAdmin(rabbitTestSupport.getResource());
admin.deleteQueue("binder.dataOut.default");
admin.deleteQueue("binder.dataOut." + this.randomGroup);
admin.deleteExchange("binder.dataOut");
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream-samples,代码行数:8,代码来源:RabbitAndKafkaBinderApplicationTests.java
示例3: testConnect
import org.springframework.amqp.rabbit.core.RabbitAdmin; //导入方法依赖的package包/类
@Test
public void testConnect() {
RabbitAdmin admin = new RabbitAdmin(this.lqcf);
Queue queue = new Queue(UUID.randomUUID().toString(), false, false, true);
admin.declareQueue(queue);
ConnectionFactory targetConnectionFactory = this.lqcf.getTargetConnectionFactory("[" + queue.getName() + "]");
RabbitTemplate template = new RabbitTemplate(targetConnectionFactory);
template.convertAndSend("", queue.getName(), "foo");
assertThat(template.receiveAndConvert(queue.getName())).isEqualTo("foo");
((CachingConnectionFactory) targetConnectionFactory).destroy();
admin.deleteQueue(queue.getName());
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream-binder-rabbit,代码行数:13,代码来源:LocalizedQueueConnectionFactoryIntegrationTests.java
示例4: tearDown
import org.springframework.amqp.rabbit.core.RabbitAdmin; //导入方法依赖的package包/类
@After
public void tearDown() {
if (context != null) {
context.close();
context = null;
}
RabbitAdmin admin = new RabbitAdmin(rabbitTestSupport.getResource());
admin.deleteQueue("binder.input.default");
admin.deleteQueue("binder.output.default");
admin.deleteExchange("binder.input");
admin.deleteExchange("binder.output");
}
示例5: testBadUserDeclarationsFatal
import org.springframework.amqp.rabbit.core.RabbitAdmin; //导入方法依赖的package包/类
@Test
public void testBadUserDeclarationsFatal() throws Exception {
RabbitTestBinder binder = getBinder();
ConfigurableApplicationContext context = binder.getApplicationContext();
ConfigurableListableBeanFactory bf = context.getBeanFactory();
bf.registerSingleton("testBadUserDeclarationsFatal", new Queue("testBadUserDeclarationsFatal", false));
bf.registerSingleton("binder", binder);
RabbitExchangeQueueProvisioner provisioner = TestUtils.getPropertyValue(binder, "binder.provisioningProvider",
RabbitExchangeQueueProvisioner.class);
bf.initializeBean(provisioner, "provisioner");
bf.registerSingleton("provisioner", provisioner);
context.addApplicationListener(provisioner);
RabbitAdmin admin = new RabbitAdmin(rabbitAvailableRule.getResource());
admin.declareQueue(new Queue("testBadUserDeclarationsFatal"));
// reset the connection and configure the "user" admin to auto declare queues...
rabbitAvailableRule.getResource().resetConnection();
bf.initializeBean(admin, "rabbitAdmin");
bf.registerSingleton("rabbitAdmin", admin);
admin.afterPropertiesSet();
// the mis-configured queue should be fatal
Binding<?> binding = null;
try {
binding = binder.bindConsumer("input", "baddecls", this.createBindableChannel("input", new BindingProperties()), createConsumerProperties());
fail("Expected exception");
}
catch (BinderException e) {
assertThat(e.getCause()).isInstanceOf(AmqpIOException.class);
}
finally {
admin.deleteQueue("testBadUserDeclarationsFatal");
if (binding != null) {
binding.unbind();
}
}
}
示例6: cleaner
import org.springframework.amqp.rabbit.core.RabbitAdmin; //导入方法依赖的package包/类
public static void cleaner() {
RabbitAdmin admin = new RabbitAdmin(factory());
admin.setAutoStartup(true);
admin.deleteExchange("error.exchange");
admin.deleteExchange("exception.exchange");
admin.deleteQueue("recoverable.exception.messages.queue");
admin.deleteQueue("unrecoverable.exception.messages.queue");
}
示例7: retryCleaner
import org.springframework.amqp.rabbit.core.RabbitAdmin; //导入方法依赖的package包/类
public static void retryCleaner() {
RabbitAdmin admin = new RabbitAdmin(factory());
admin.setAutoStartup(true);
admin.deleteExchange("retry.test.exchange");
admin.deleteQueue("retry.test.queue");
}