org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer Java Examples

The following examples show how to use org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer. 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: AmqpConfig.java    From myth with Apache License 2.0 5 votes vote down vote up
/**
 * My container factory simple rabbit listener container factory.
 *
 * @param configurer        the configurer
 * @param connectionFactory the connection factory
 * @return the simple rabbit listener container factory
 */
@Bean
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = "host")
public SimpleRabbitListenerContainerFactory myContainerFactory(
        SimpleRabbitListenerContainerFactoryConfigurer configurer,
        ConnectionFactory connectionFactory) {
    SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
    factory.setPrefetchCount(100);
    configurer.configure(factory, connectionFactory);
    return factory;
}
 
Example #2
Source File: AmqpConfig.java    From myth with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = "host")
public SimpleRabbitListenerContainerFactory myContainerFactory(
        SimpleRabbitListenerContainerFactoryConfigurer configurer,
        ConnectionFactory connectionFactory) {
    SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
    factory.setPrefetchCount(100);
    configurer.configure(factory, connectionFactory);
    return factory;
}
 
Example #3
Source File: AmqpConfig.java    From myth with Apache License 2.0 5 votes vote down vote up
/**
 * My container factory simple rabbit listener container factory.
 *
 * @param configurer        the configurer
 * @param connectionFactory the connection factory
 * @return the simple rabbit listener container factory
 */
@Bean
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = "host")
public SimpleRabbitListenerContainerFactory myContainerFactory(
        SimpleRabbitListenerContainerFactoryConfigurer configurer,
        ConnectionFactory connectionFactory) {
    SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
    factory.setPrefetchCount(100);
    configurer.configure(factory, connectionFactory);
    return factory;
}
 
Example #4
Source File: AmqpConfiguration.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create RabbitListenerContainerFactory bean if no listenerContainerFactory
 * bean found
 *
 * @return RabbitListenerContainerFactory bean
 */
@Bean
@ConditionalOnMissingBean(name = "listenerContainerFactory")
public RabbitListenerContainerFactory<SimpleMessageListenerContainer> listenerContainerFactory(
        final SimpleRabbitListenerContainerFactoryConfigurer configurer, final ErrorHandler errorHandler) {
    final ConfigurableRabbitListenerContainerFactory factory = new ConfigurableRabbitListenerContainerFactory(
            amqpProperties.isMissingQueuesFatal(), amqpProperties.getDeclarationRetries(), errorHandler);
    configurer.configure(factory, rabbitConnectionFactory);
    return factory;
}
 
Example #5
Source File: FatalExceptionStrategyAmqpConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(
  ConnectionFactory connectionFactory,
  SimpleRabbitListenerContainerFactoryConfigurer configurer) {
    SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
    configurer.configure(factory, connectionFactory);
    factory.setErrorHandler(errorHandler());
    return factory;
}
 
Example #6
Source File: ListenerErrorHandlerAmqpConfiguration.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory,
                                                                           SimpleRabbitListenerContainerFactoryConfigurer configurer) {
    SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
    configurer.configure(factory, connectionFactory);
    factory.setErrorHandler(errorHandler());
    return factory;
}