moov-io / achgateway

Payment gateway enabling automated ACH operations in a distributed and fault tolerant way.
https://moov-io.github.io/achgateway/
Apache License 2.0
52 stars 19 forks source link

chore: bubble up error #137

Closed yordis closed 1 year ago

yordis commented 1 year ago

Changes

Bubble up the error instead of logging and ignoring it.

Why Are Changes Being Made

The following section will log the error as before:

https://github.com/moov-io/achgateway/blob/4533b6fe2a0c802ceebc6ba7535ea0282a804b3f/internal/pipeline/file_receiver.go#L83-L88

Such a situation where somebody could publish a message with the appropriate type should be considered an error.


Side note, we encountered an issue where messages weren't acked so the Kafka offset was never moved. I think that you should ack the message even when there was an error otherwise you will be queueing the system forever.

https://github.com/moov-io/achgateway/blob/4533b6fe2a0c802ceebc6ba7535ea0282a804b3f/internal/pipeline/file_receiver.go#L211

https://github.com/moov-io/achgateway/blob/4533b6fe2a0c802ceebc6ba7535ea0282a804b3f/internal/pipeline/file_receiver.go#L220

https://github.com/moov-io/achgateway/blob/4533b6fe2a0c802ceebc6ba7535ea0282a804b3f/internal/pipeline/file_receiver.go#L228

adamdecaf commented 1 year ago

I've combined this into https://github.com/moov-io/achgateway/pull/140