org.springframework.amqp.core.AmqpAdmin Java Examples

The following examples show how to use org.springframework.amqp.core.AmqpAdmin. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MessagingApplication.java    From building-microservices with Apache License 2.0 5 votes vote down vote up
@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);

	};
}
 
Example #2
Source File: RabbitTemplateMessageQueueFactory.java    From elasticactors with Apache License 2.0 5 votes vote down vote up
public RabbitTemplateMessageQueueFactory(
        String elasticActorsCluster,
        AmqpAdmin amqpAdmin,
        RabbitTemplate rabbitTemplate) {
    this.elasticActorsCluster = elasticActorsCluster;
    this.amqpAdmin = amqpAdmin;
    this.rabbitTemplate = rabbitTemplate;
    this.exchangeName = String.format(EA_EXCHANGE_FORMAT, elasticActorsCluster);
}
 
Example #3
Source File: RabbitMQInitializerTest.java    From sinavi-jfw with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #4
Source File: ExceptionQueueContextConfig.java    From sinavi-jfw with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #5
Source File: AmqpIntegration.java    From building-microservices with Apache License 2.0 5 votes vote down vote up
@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);
	};
}
 
Example #6
Source File: RabbitMQConfiguration.java    From Learning-Path-Spring-5-End-to-End-Programming with MIT License 4 votes vote down vote up
@Bean
public AmqpAdmin amqpAdmin(@Qualifier("springConnectionFactory") ConnectionFactory connectionFactory) {
  return new RabbitAdmin(connectionFactory);
}
 
Example #7
Source File: RepublishMessageRecovererExtend.java    From summerframework with Apache License 2.0 4 votes vote down vote up
public RepublishMessageRecovererExtend(AmqpTemplate errorTemplate, AmqpAdmin amqpAdmin) {
    this.errorTemplate = errorTemplate;
    this.deadLetterQueueCreator = new DeadLetterQueueCreator(amqpAdmin);
}
 
Example #8
Source File: SpringAMQPClientConfiguration.java    From elasticactors with Apache License 2.0 4 votes vote down vote up
@Bean
public RabbitTemplateMessageQueueFactoryFactory rabbitTemplateMessageQueueFactoryFactory(
        AmqpAdmin amqpAdmin,
        RabbitTemplate rabbitTemplate) {
    return new RabbitTemplateMessageQueueFactoryFactory(amqpAdmin, rabbitTemplate);
}
 
Example #9
Source File: RabbitTemplateMessageQueueFactoryFactory.java    From elasticactors with Apache License 2.0 4 votes vote down vote up
public RabbitTemplateMessageQueueFactoryFactory(
        AmqpAdmin amqpAdmin,
        RabbitTemplate rabbitTemplate) {
    this.amqpAdmin = amqpAdmin;
    this.rabbitTemplate = rabbitTemplate;
}
 
Example #10
Source File: RabbitConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
public AmqpAdmin amqpAdmin() {
    return new RabbitAdmin(connectionFactory());
}
 
Example #11
Source File: RabbitTemplateExtend.java    From summerframework with Apache License 2.0 4 votes vote down vote up
public void setRabbitAdmin(AmqpAdmin amqpAdmin) {
    this.deadLetterQueueCreator = new DeadLetterQueueCreator(amqpAdmin);
}
 
Example #12
Source File: RabbitMQInitializerTest.java    From sinavi-jfw with Apache License 2.0 4 votes vote down vote up
@Bean
public AmqpAdmin amqpAdmin() {
    RabbitAdmin rabbitAdmin = new RabbitAdmin(factory());
    rabbitAdmin.setAutoStartup(true);
    return rabbitAdmin;
}
 
Example #13
Source File: ExceptionQueueContextConfigTest.java    From sinavi-jfw with Apache License 2.0 4 votes vote down vote up
@Test
public void プロファイルが指定されていないときはRabbitAdminのインスタンスが生成される() {
    assertThat(context.getBean(AmqpAdmin.class), is(notNullValue()));
}
 
Example #14
Source File: ExceptionQueueContextConfigTest.java    From sinavi-jfw with Apache License 2.0 4 votes vote down vote up
@Test
public void プロファイルが指定されていないときはRabbitAdminのインスタンスが生成されない() {
    thrown.expect(NoSuchBeanDefinitionException.class);
    context.getBean(AmqpAdmin.class);
}
 
Example #15
Source File: SimpleRabbitListenerContainerFactoryConfigurer.java    From summerframework with Apache License 2.0 4 votes vote down vote up
void setRetryAmqpAdmin(AmqpAdmin amqpAdmin) {
    this.retryAmqpAdmin = amqpAdmin;
}
 
Example #16
Source File: RabbitMqConfiguration.java    From scraping-microservice-java-python-rabbitmq with Apache License 2.0 4 votes vote down vote up
@Bean
public AmqpAdmin amqpAdmin()
{
    return new RabbitAdmin(connectionFactory());
}
 
Example #17
Source File: SpringRabbitMQTest.java    From java-specialagent with Apache License 2.0 4 votes vote down vote up
@Bean
public AmqpAdmin amqpAdmin() {
  return new RabbitAdmin(connectionFactory());
}
 
Example #18
Source File: DeadLetterQueueCreator.java    From summerframework with Apache License 2.0 4 votes vote down vote up
public DeadLetterQueueCreator(AmqpAdmin rabbitAdmin) {
    this.rabbitAdmin = rabbitAdmin;
}
 
Example #19
Source File: RabbitMQConfig.java    From konker-platform with Apache License 2.0 4 votes vote down vote up
@Bean
public AmqpAdmin amqpAdmin() {
    RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory());
    return rabbitAdmin;
}
 
Example #20
Source File: RabbitConfiguration.java    From JuniperBot with GNU General Public License v3.0 4 votes vote down vote up
@Bean
public AmqpAdmin amqpAdmin() {
    return new RabbitAdmin(connectionFactory());
}
 
Example #21
Source File: RabbitMQConfiguration.java    From Spring-5.0-By-Example with MIT License 4 votes vote down vote up
@Bean
public AmqpAdmin amqpAdmin(@Qualifier("springConnectionFactory") ConnectionFactory connectionFactory) {
  return new RabbitAdmin(connectionFactory);
}
 
Example #22
Source File: RabbitMQConfig.java    From kkbinlog with Apache License 2.0 4 votes vote down vote up
@Bean
public AmqpAdmin amqpAdmin(ConnectionFactory connectionFactory) {
    return new RabbitAdmin(connectionFactory);
}
 
Example #23
Source File: RabbitMQClient.java    From kkbinlog with Apache License 2.0 4 votes vote down vote up
public AmqpAdmin getAmqpAdmin() {
    return amqpAdmin;
}
 
Example #24
Source File: AmqpConfiguration.java    From ESarch with Apache License 2.0 4 votes vote down vote up
@Autowired
public void defineExchange(AmqpAdmin admin) {
    admin.declareExchange(eventsExchange());
}
 
Example #25
Source File: RabbitMQConfiguration.java    From Learning-Path-Spring-5-End-to-End-Programming with MIT License 4 votes vote down vote up
@Bean
public AmqpAdmin amqpAdmin(@Qualifier("springConnectionFactory") ConnectionFactory connectionFactory) {
  return new RabbitAdmin(connectionFactory);
}
 
Example #26
Source File: RabbitMQConfig.java    From micro-service with MIT License 3 votes vote down vote up
public AmqpAdmin amqpAdmin() {
	
	RabbitAdmin admin = new RabbitAdmin(connectionFactory());
	admin.setAutoStartup(false);
	
	return admin;
}
 
Example #27
Source File: RabbitMQInitializer.java    From sinavi-jfw with Apache License 2.0 2 votes vote down vote up
/**
 * {@link AmqpAdmin} を設定します。
 * @param admin {@link AmqpAdmin}
 */
public void setAdmin(AmqpAdmin admin) {
    this.admin = admin;
}