|
14 | 14 | import com.studiomediatech.queryresponse.QueryResponseTopicExchange; |
15 | 15 |
|
16 | 16 | /** |
17 | | - * Configuration for ports that enable messaging, specifically AMQP including Query/Response. |
| 17 | + * Configuration for ports that enable messaging, specifically AMQP including |
| 18 | + * Query/Response. |
18 | 19 | */ |
19 | 20 | @Configuration |
20 | 21 | @EnableQueryResponse |
21 | 22 | @ComponentScan(basePackageClasses = MessagingConfig.class) |
22 | 23 | public class MessagingConfig { |
23 | 24 |
|
24 | | - static final String QUERY_RESPONSE_STATS_QUEUE_BEAN = "queryResponseStatsQueue"; |
25 | | - static final String QUERY_RESPONSE_QUERIES_QUEUE_BEAN = "queryResponseQueriesQueue"; |
26 | | - static final String QUERY_RESPONSE_STATS_QUEUE_BINDING_BEAN = "queryResponseQueriesQueueBinding"; |
27 | | - static final String QUERY_RESPONSE_INTERNAL_STATS_ROUTING_KEY = "query-response/internal/stats"; |
28 | | - |
29 | | - @Bean |
30 | | - ConnectionNameStrategy connectionNameStrategy(Environment env) { |
31 | | - return connectionFactory -> env.getProperty("spring.application.name", "query-response-ui"); |
32 | | - } |
33 | | - |
34 | | - @Bean(QUERY_RESPONSE_STATS_QUEUE_BEAN) |
35 | | - Queue queryResponseStatsQueue() { |
36 | | - return new AnonymousQueue(); |
37 | | - } |
38 | | - |
39 | | - @Bean(QUERY_RESPONSE_STATS_QUEUE_BINDING_BEAN) |
40 | | - Binding queryResponseStatsQueueBinding(QueryResponseTopicExchange queryResponseTopicExchange) { |
41 | | - return BindingBuilder.bind(queryResponseStatsQueue()).to(queryResponseTopicExchange) |
42 | | - .with(QUERY_RESPONSE_INTERNAL_STATS_ROUTING_KEY); |
43 | | - } |
| 25 | + static final String QUERY_RESPONSE_STATS_QUEUE_BEAN = "queryResponseStatsQueue"; |
| 26 | + static final String QUERY_RESPONSE_QUERIES_QUEUE_BEAN = "queryResponseQueriesQueue"; |
| 27 | + |
| 28 | + protected static final String QUERY_RESPONSE_STATS_BINDING = "queryResponseStatsBinding"; |
| 29 | + protected static final String QUERY_RESPONSE_TELEMETRY_BINDING = "queryResponseTelemetryBinding"; |
| 30 | + |
| 31 | + @Bean |
| 32 | + ConnectionNameStrategy connectionNameStrategy(Environment env) { |
| 33 | + return connectionFactory -> env.getProperty("spring.application.name", "query-response-ui"); |
| 34 | + } |
| 35 | + |
| 36 | + @Bean(QUERY_RESPONSE_STATS_QUEUE_BEAN) |
| 37 | + Queue queryResponseStatsQueue() { |
| 38 | + return new AnonymousQueue(); |
| 39 | + } |
| 40 | + |
| 41 | + @Bean(QUERY_RESPONSE_STATS_BINDING) |
| 42 | + Binding queryResponseStatsQueueBinding(QueryResponseTopicExchange queryResponseTopicExchange) { |
| 43 | + return BindingBuilder.bind(queryResponseStatsQueue()).to(queryResponseTopicExchange) |
| 44 | + .with("query-response/internal/stats"); |
| 45 | + } |
| 46 | + |
| 47 | + @Bean(QUERY_RESPONSE_TELEMETRY_BINDING) |
| 48 | + Binding queryResponseTelemetryQueueBinding(QueryResponseTopicExchange queryResponseTopicExchange) { |
| 49 | + return BindingBuilder.bind(queryResponseStatsQueue()).to(queryResponseTopicExchange) |
| 50 | + .with("query-response/internal/telemetry"); |
| 51 | + } |
44 | 52 | } |
0 commit comments