The application reads messages from the queue and saves them to the database.
- PostgreSQL
- MySQL
make build
or for build with flags
make build-flags
make all
- Create a table in your database:
PostgreSQL:
CREATE TABLE public.messages (
id bigserial PRIMARY KEY,
correlation_id text,
created_at timestamptz default CURRENT_TIMESTAMP,
message text
);
CREATE INDEX messages_correlation_id_index
ON messages (correlation_id);
MySQL
CREATE TABLE messages
(
id int auto_increment primary key,
correlation_id varchar(255) null,
created_at timestamp default CURRENT_TIMESTAMP not null,
message text null
);
CREATE INDEX messages_correlation_id_index
ON messages (correlation_id);
- Change config.yaml
- Run the app:
./rabbitmq-consumer -config config.yaml
- Base functionality
- Add auto reconnect to DB
- Change structure
- Add Sentry support
- Add tests
- Add optional saving headers and properties