SharedConfiguration.java
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.diligrp.etrade.shared;
import com.diligrp.etrade.core.mybatis.MybatisMapperSupport;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("com.diligrp.etrade.shared")
@MapperScan(basePackages = {"com.diligrp.etrade.shared.dao"}, markerInterface = MybatisMapperSupport.class)
public class SharedConfiguration {
/**
* MQ_STOCK_EXCHANGE
*/
public static final String MQ_STOCK_EXCHANGE = "dili.stock.exchange.xtrade";
/**
* MQ_ORDER_EXCHANGE
*/
public static final String MQ_ORDER_EXCHANGE = "dili.order.exchange.xtrade";
/**
* stockExchange
*
* @return {@link FanoutExchange}
*/
@Bean
public FanoutExchange stockExchange() {
return new FanoutExchange(MQ_STOCK_EXCHANGE, true, false);
}
/**
* orderExchange
*
* @return {@link FanoutExchange}
*/
@Bean
public FanoutExchange orderExchange() {
return new FanoutExchange(MQ_ORDER_EXCHANGE, true, false);
}
}