当前位置: 首页>>代码示例>>Java>>正文


Java RabbitAdmin.deleteQueue方法代码示例

本文整理汇总了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);
    }


}
 
开发者ID:laidu,项目名称:java-learn,代码行数:21,代码来源:SpringClientDemo.java

示例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");
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-binder-rabbit,代码行数:13,代码来源:RabbitBinderModuleTests.java

示例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();
		}
	}
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-binder-rabbit,代码行数:36,代码来源:RabbitBinderTests.java

示例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");
}
 
开发者ID:ctc-g,项目名称:sinavi-jfw,代码行数:9,代码来源:TestQueueCleaner.java

示例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");
}
 
开发者ID:ctc-g,项目名称:sinavi-jfw,代码行数:7,代码来源:TestQueueCleaner.java


注:本文中的org.springframework.amqp.rabbit.core.RabbitAdmin.deleteQueue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。