|
@@ -5,13 +5,15 @@ import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
|
|
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
|
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@Component
|
|
@Component
|
|
public class RabbitMQConfig {
|
|
public class RabbitMQConfig {
|
|
// private static final Logger LOGGER= LoggerFactory.getLogger(RabbitMQConfig.class);
|
|
// private static final Logger LOGGER= LoggerFactory.getLogger(RabbitMQConfig.class);
|
|
-
|
|
|
|
|
|
+ @Value("${queueName}")
|
|
|
|
+ private String queueName;
|
|
@Autowired
|
|
@Autowired
|
|
private CachingConnectionFactory cachingConnectionFactory;
|
|
private CachingConnectionFactory cachingConnectionFactory;
|
|
|
|
|
|
@@ -67,7 +69,7 @@ public class RabbitMQConfig {
|
|
|
|
|
|
@Bean
|
|
@Bean
|
|
public DirectExchange directExchange() {
|
|
public DirectExchange directExchange() {
|
|
- return new DirectExchange(MailConstants.MAIL_EXCHANGE_NAME);
|
|
|
|
|
|
+ return new DirectExchange(queueName);
|
|
}
|
|
}
|
|
|
|
|
|
@Bean
|
|
@Bean
|