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

RabbitMQ #677

Merged
merged 1 commit into from
Sep 27, 2022
Merged

RabbitMQ #677

merged 1 commit into from
Sep 27, 2022

Conversation

benjben
Copy link
Contributor

@benjben benjben commented Aug 16, 2022

No description provided.

@benjben benjben force-pushed the feature/RabbitMQ branch 2 times, most recently from cee1306 to 4d0c1e4 Compare August 24, 2022 10:14
Copy link
Contributor

@peel peel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a quality PR Ben!

One idea worth pondering is whether it generally wouldn't be good to initialise clients outside of Sink/Source resources. Currently there is a nice init flow and the fs2-rabbit is a well-designed library that has a clear algebra-interpreter separation. That really makes it easy to set up a test-harness for all the edge cases around ACK/connection failures etc with the way how we configure it. Probably not in scope of this PR, but an idea for the future maybe.

ssl: Boolean,
internalQueueSize: Int,
requestedHeartbeat: Int,
automaticRecovery: Boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spent the most time in this review looking at this topic and still can't work out what we should be doing here by default. What should be our take on this in practice? Should we recover by default?

On one hand, automatic recovery has been a default in rabbitmq clients in many years, yet it comes with its own set of issues. We don't really run dynamic or TTL queues here, so most of the limitations of AQMP don't really count, so it should be safe to use automatic recovery.

One thing that I can't see is fs2-rabbit is publisher confirms - when we publish do we assume transactional ACK from the broker so no messages are lost much like we do with consumer. This comes important when we'd like to do an automatic recovery and the connection drops after sending messages. So we don't really know if they've been ACKed by the broker. I haven't done enough digging on that topic in fs2-rabbit, but it's worth exploring.

I wonder about notifications about recovery attempts. They seem to be logged by the rabbit-client these days, but there's a way for us to also set up our own RecoveryListener if we needed that for visibility/reporting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we publish do we assume transactional ACK from the broker so no messages are lost much like we do with consumer

We ack only after this line has returned successfully. Are you saying that this is possible that this line returns successfully, although the events failed to get published?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I'm not sure about. When the AMQP goes down and does not do a confirm this line will fail, so when it (automatically?) recovers we publish twice. I think we're fine, but it's worth checking various scenarios in testing.

@benjben benjben requested a review from peel August 29, 2022 16:21
@benjben
Copy link
Contributor Author

benjben commented Aug 29, 2022

One idea worth pondering is whether it generally wouldn't be good to initialize clients outside of Sink/Source resources.

It would be great indeed ! That's something that I've already considered. I will not do it now because it also impacts enrich-pubsub, enrich-kinesis and enrich-kafka that is currently in implementation. They will need to get updated all at once. I created #684

@benjben benjben force-pushed the feature/RabbitMQ branch 3 times, most recently from eff64f0 to 674fa0e Compare September 23, 2022 08:41
@benjben benjben merged commit 3cc6ba6 into develop Sep 27, 2022
@benjben benjben deleted the feature/RabbitMQ branch September 27, 2022 09:28
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

Successfully merging this pull request may close these issues.

2 participants