diff --git a/templates/java-spring/.partials/AmqpConfig.java b/templates/java-spring/.partials/AmqpConfig.java index b96f03270..490764f43 100644 --- a/templates/java-spring/.partials/AmqpConfig.java +++ b/templates/java-spring/.partials/AmqpConfig.java @@ -34,7 +34,7 @@ public class Config { private String password; {{#each asyncapi.topics as |topic key|}} - {{#if topic.subscribe}} + {{#if topic.publish}} @Value("${amqp.exchange.{{~topic.x-service-name~}}}") private String {{topic.x-service-name}}Exchange; diff --git a/templates/java-spring/.partials/MqttConfig.java b/templates/java-spring/.partials/MqttConfig.java index a7cd58496..9b752a8a9 100644 --- a/templates/java-spring/.partials/MqttConfig.java +++ b/templates/java-spring/.partials/MqttConfig.java @@ -36,11 +36,9 @@ public class Config { private String password; {{#each asyncapi.topics as |topic key|}} - {{#if topic.subscribe}} @Value("${mqtt.topic.{{~topic.x-service-name~}}Topic}") private String {{topic.x-service-name}}Topic; - {{/if}} {{/each}} @Bean