-
Notifications
You must be signed in to change notification settings - Fork 2
Description
I see this as a "bridge" between the two components, so with this idea in mind, why not have the convention that the PG channel is equal to the RMQ entity, where entity is either an exchange or a queue. This is also probably the way users will want to set up things anyway, in order to make it obvious where the PG event will end up in RabbitMQ.
I am not sure if this component should take on the creation of the queue/exchange since this will complicate the code and the config interface, maybe it should just error out (or try to reconnect again) if the entity is not yet created in Rabbit.
Another idea to consider is that you probably want to be able to bridge multiple channels at the same time (each handled by a separate thread)
With this ideas/features in place, the config interface is very simple yet very flexible/powerful
docker run --rm -it \
-e POSTGRESQL_URI=postgresql://username:password@domain.tld:port/database \
-e AMQP_HOST_PORT=127.0.0.1:5672 \
-e BRIDGE_CHANNELS="foo:queue,bar:exchange" \
fgribreau/postgresql-to-amqp
What do you think?