Example usage for org.springframework.amqp.rabbit.core RabbitTemplate afterPropertiesSet

List of usage examples for org.springframework.amqp.rabbit.core RabbitTemplate afterPropertiesSet

Introduction

In this page you can find the example usage for org.springframework.amqp.rabbit.core RabbitTemplate afterPropertiesSet.

Prototype

@Override
    public void afterPropertiesSet() 

Source Link

Usage

From source file:org.springframework.xd.dirt.integration.rabbit.RabbitMessageBus.java

private RabbitTemplate determineRabbitTemplate(RabbitPropertiesAccessor properties) {
    RabbitTemplate rabbitTemplate = null;
    if (properties.isBatchingEnabled(this.defaultBatchingEnabled)) {
        BatchingStrategy batchingStrategy = new SimpleBatchingStrategy(
                properties.getBatchSize(this.defaultBatchSize),
                properties.geteBatchBufferLimit(this.defaultBatchBufferLimit),
                properties.getBatchTimeout(this.defaultBatchTimeout));
        rabbitTemplate = new BatchingRabbitTemplate(batchingStrategy, getApplicationContext()
                .getBean(IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME, TaskScheduler.class));
        rabbitTemplate.setConnectionFactory(this.connectionFactory);
    }/*from  w  w  w  . j a v a  2  s  .  co m*/
    if (properties.isCompress(this.defaultCompress)) {
        if (rabbitTemplate == null) {
            rabbitTemplate = new RabbitTemplate(this.connectionFactory);
        }
        rabbitTemplate.setBeforePublishPostProcessors(this.compressingPostProcessor);
        rabbitTemplate.afterPropertiesSet();
    }
    if (rabbitTemplate == null) {
        rabbitTemplate = this.rabbitTemplate;
    }
    return rabbitTemplate;
}