This repository contains a Java application for synchronizing databases using RabbitMQ messaging queue.
The goal of this project is to demonstrate how to synchronize databases across different instances using RabbitMQ as a messaging queue. The Java application provided here establishes connections to MySQL databases, creates necessary tables, sends and retrieves data, and communicates with a RabbitMQ server for data synchronization.
- Establishes connections to MySQL databases.
- Creates database tables if they don't exist.
- Sends data updates to RabbitMQ for synchronization.
- Retrieves data from databases.
- Compatible with RabbitMQ messaging queue.
-
Clone this repository to your local machine
-
Make sure you have Java JDK and MySQL installed on your system.
-
Set up your MySQL database and RabbitMQ server. Ensure that the credentials are correctly configured.
-
Set up environment variables for your database connection in a
.env
file:DB_URL=jdbc:mysql://localhost:3306/database_name DB_USERNAME=username DB_PASSWORD=password
-
Run the Java application using your preferred IDE or build tools.
-
Run the Java application.
-
Monitor the console output for database synchronization messages and errors.
Feel free to submit issues or pull requests to improve the project.