Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let vanilla use RabbitMQ #13

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading