Skip to content

Commit 1dd2db8

Browse files
committed
Interrim
1 parent cc17316 commit 1dd2db8

File tree

2 files changed

+32
-33
lines changed

2 files changed

+32
-33
lines changed

ui/src/main/java/com/studiomediatech/queryresponse/ui/messaging/MessagingConfig.java

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,38 @@
1414
import com.studiomediatech.queryresponse.QueryResponseTopicExchange;
1515

1616
/**
17-
* Configuration for ports that enable messaging, specifically AMQP including
18-
* Query/Response.
17+
* Configuration for ports that enable messaging, specifically AMQP including Query/Response.
1918
*/
2019
@Configuration
2120
@EnableQueryResponse
2221
@ComponentScan(basePackageClasses = MessagingConfig.class)
2322
public class MessagingConfig {
2423

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-
}
24+
static final String QUERY_RESPONSE_STATS_QUEUE_BEAN = "queryResponseStatsQueue";
25+
static final String QUERY_RESPONSE_QUERIES_QUEUE_BEAN = "queryResponseQueriesQueue";
26+
27+
protected static final String QUERY_RESPONSE_STATS_BINDING = "queryResponseStatsBinding";
28+
protected static final String QUERY_RESPONSE_TELEMETRY_BINDING = "queryResponseTelemetryBinding";
29+
30+
@Bean
31+
ConnectionNameStrategy connectionNameStrategy(Environment env) {
32+
return connectionFactory -> env.getProperty("spring.application.name", "query-response-ui");
33+
}
34+
35+
@Bean(QUERY_RESPONSE_STATS_QUEUE_BEAN)
36+
Queue queryResponseStatsQueue() {
37+
return new AnonymousQueue();
38+
}
39+
40+
@Bean(QUERY_RESPONSE_STATS_BINDING)
41+
Binding queryResponseStatsQueueBinding(QueryResponseTopicExchange queryResponseTopicExchange) {
42+
return BindingBuilder.bind(queryResponseStatsQueue()).to(queryResponseTopicExchange)
43+
.with("query-response/internal/stats");
44+
}
45+
46+
@Bean(QUERY_RESPONSE_TELEMETRY_BINDING)
47+
Binding queryResponseTelemetryQueueBinding(QueryResponseTopicExchange queryResponseTopicExchange) {
48+
return BindingBuilder.bind(queryResponseStatsQueue()).to(queryResponseTopicExchange)
49+
.with("query-response/internal/telemetry");
50+
}
5251
}

ui/src/test/java/com/studiomediatech/queryresponse/ui/messaging/MessagingConfigIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ void ensure_has_telemetry_queue_with_binding() {
2727
assertThat(binding.getRoutingKey()).isEqualTo("query-response/internal/stats");
2828
assertThat(binding.getExchange()).isEqualTo("query-response");
2929
}
30-
30+
3131
@Test
32-
void ensure_has_telemetry_queue_with_modernised_binding() throws Exception {
33-
32+
void ensure_has_telemetry_queue_with_modernised_binding() throws Exception {
33+
3434
Queue queue = (Queue) ctx.getBean(MessagingConfig.QUERY_RESPONSE_STATS_QUEUE_BEAN);
3535
assertThat(queue).isNotNull();
3636

@@ -39,5 +39,5 @@ void ensure_has_telemetry_queue_with_modernised_binding() throws Exception {
3939
assertThat(binding.getDestination()).isEqualTo(queue.getName());
4040
assertThat(binding.getRoutingKey()).isEqualTo("query-response/internal/telemetry");
4141
assertThat(binding.getExchange()).isEqualTo("query-response");
42-
}
42+
}
4343
}

0 commit comments

Comments
 (0)