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

fix: run next middleware of fail (nack) #29

Merged
merged 1 commit into from
Feb 19, 2025
Merged

Conversation

mindhells
Copy link
Member

Fix middleware pattern: unexpected behaviour

Next middleware should be executed correctly of the message is discarded (nack)

@@ -50,6 +53,7 @@ services:
volumes:
- shared_socket:/tmp
image: softonic/hp-pass-middleware:dev
user: root
environment:
IN_SOCKET: "/tmp/res2"
command: ["-stderrthreshold=INFO"]
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to use root in order for docker-compose to work, as the default user for the images is now 1000:1000

@@ -55,7 +55,14 @@ func (ew *Writer) timeout(ackChannel chan<- messages.Message) {
func (ew *Writer) trigger(ackChannel chan<- messages.Message) {
ew.mutex.Lock()

ew.WriteAdapter.ProcessMessages(&ew.msgs)
// filter out messages explicitly n-acked
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting new usage for nack/ack that can be done due to the latest change done from @paupm. I didn't realize this possible usage then.

Copy link
Contributor

Choose a reason for hiding this comment

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

This nack messages come from a failing middleware, right?
It can also be possible that the middleware works but it nack specific messages for some reason?

Copy link
Member Author

Choose a reason for hiding this comment

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

the middleware itself does not have control over the messages to nack them, does it?
Only the adapters do as far as I can tell 🤔 (elastic)... and now the middleware manager

@mindhells mindhells merged commit a830e8a into master Feb 19, 2025
2 checks passed
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.

4 participants