Skip to content

Commit

Permalink
Let vanilla use RabbitMQ (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
wasdennnoch authored Jul 7, 2024
1 parent 5c40c43 commit d511953
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 6 additions & 2 deletions vanilla/src/main/java/gg/beemo/vanilla/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

public class Config {

public static String[] KAFKA_HOST = new String[]{"localhost:9092"};
public static String[] RABBIT_HOST = new String[]{"localhost:5672"};

public static boolean KAFKA_USE_TLS = false;
public static boolean RABBIT_USE_TLS = false;

public static String RABBIT_USERNAME = "guest";

public static String RABBIT_PASSWORD = "guest";

}
14 changes: 8 additions & 6 deletions vanilla/src/main/java/gg/beemo/vanilla/Vanilla.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gg.beemo.vanilla

import gg.beemo.latte.CommonConfig
import gg.beemo.latte.broker.kafka.KafkaConnection
import gg.beemo.latte.broker.rabbitmq.RabbitConnection
import gg.beemo.latte.config.Configurator
import gg.beemo.latte.logging.Log
import gg.beemo.latte.logging.log
Expand All @@ -19,11 +19,13 @@ object Vanilla {
Configurator.create().mirror(Config::class.java)

log.debug("Initializing Kafka connection")
val brokerConnection = KafkaConnection(
Config.KAFKA_HOST,
CommonConfig.BrokerServices.VANILLA,
"0", // There will only ever be one instance of vanilla
Config.KAFKA_USE_TLS,
val brokerConnection = RabbitConnection(
rabbitHosts = Config.RABBIT_HOST,
serviceName = CommonConfig.BrokerServices.VANILLA,
instanceId = "0", // There will only ever be one instance of vanilla
useTls = Config.RABBIT_USE_TLS,
username = Config.RABBIT_USERNAME,
password = Config.RABBIT_PASSWORD,
)

log.debug("Initializing Kafka Ratelimit client")
Expand Down

0 comments on commit d511953

Please sign in to comment.