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

A few ideas (if you want to consider) #1

Open
ruslantalpa opened this issue Apr 9, 2017 · 1 comment
Open

A few ideas (if you want to consider) #1

ruslantalpa opened this issue Apr 9, 2017 · 1 comment

Comments

@ruslantalpa
Copy link

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:[email protected]: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?

@FGRibreau
Copy link
Owner

FGRibreau commented Apr 10, 2017

where entity is either an exchange or a queue

I would like to definitely enforce an exchange, everytime so it creates a layer of indirection and helps for debugging or extension

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.

In theory I think every app should create their own exchanges/queues on the broker and they should be removed when no one is publishing/listening on them anymore BUT for the v1 I won't go into that path and let the dev(ops) configure it manually :) so 👍

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)

I will prefer to have an instance of the app per channel instead of letting the app handle it itself, since postgresql-to-amqp is so lightweight we can definitely do this (and it will keep the code easy, not complex reconnection feature), the only issue I see will be that it will grow the number of active connection to both PG and the AMQP broker but it's not that big of an issue.

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:[email protected]:port/database \
-e AMQP_HOST_PORT=127.0.0.1:5672 \
-e BRIDGE_CHANNELS="foo:queue,bar:exchange" \
fgribreau/postgresql-to-amqp

I would like to change it to something like:

docker run --rm -it \
-e POSTGRESQL_URI=postgresql://username:[email protected]:port/database \
-e POSTGRESQL_CHANNEL="foo" \
-e AMQP_URI=amqp://username:[email protected]:port/vhost \
-e AMQP_EXCHANGE=bar \
fgribreau/postgresql-to-amqp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants