mora-resource-allocation-edge-cloud / mora

1 stars 0 forks source link

Fix conditional creation of Kafka Beans on VMS #14

Open aleskandro opened 3 years ago

aleskandro commented 3 years ago

In the VMS, we had to comment out annotation of KafkaConsumerConfig.java and KafkaTopicConfig.java in order to deploy the Cloud Variant and correctly handle connection to the Kafka container.


@Service
@ConditionalOnProperty(
        value="deployment.needKafka",
        havingValue="true",
        matchIfMissing=true
)

However, we need to not instantiate those beans in some of the Edge variants (e.g., the Cache variant).

We need to remove those comments and fix.

Current behavior (to be verified)

Kafka beans are not instantiated and the spring application (VMS) tries to connect with Kafka at localhost, raising an exception since kafka is not available on "localhost".

Expected behavior

When we deploy a variant with the needKafkaBeans environment variable set to true, the Kafka beans have to be instantiated. Otherwise we must instantiate those java beans.