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

pipeline: support a TriggerCutoff event #88

Open
adamdecaf opened this issue Feb 24, 2022 · 8 comments
Open

pipeline: support a TriggerCutoff event #88

adamdecaf opened this issue Feb 24, 2022 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@adamdecaf
Copy link
Member

adamdecaf commented Feb 24, 2022

This is a proposal to introduce a new event called TriggerCutoff to achgateway. This event will function the same as a manual/automatic cutoff trigger but allows us to keep state consistent across multiple instances of achgateway.

Imagine a kafka topic with messages file1, file2, triggerCutoff[09:00], file3:

Each instance of achgateway will queue file1 and file2 for a cutoff. Then the triggerCutoff event is consumed which initiates leadership election and processing. Only after completed cutoff processing is file3 queued for later upload.

Currently instances of achgateway can get out of sync due to clock skew which might let file3 be consumed by some instances and not others. This produces inconsistent state.

The service producing QueueACHFile events could produce this. Often the producing service needs knowledge of cutoff times to allow for setting EffectiveEntryDate to a proper value. Duplication of cutoff time configuration is not ideal.

@adamdecaf adamdecaf added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 24, 2022
@darwinz
Copy link
Contributor

darwinz commented Feb 25, 2022

For this to work with Kafka, it will require using only a single partition to guarantee linear message ordering. Otherwise, RabbitMQ might be a good option for this particular case.

@adamdecaf
Copy link
Member Author

@InfernoJJ Do you have any ideas?

@InfernoJJ
Copy link
Member

InfernoJJ commented Feb 25, 2022 via email

@InfernoJJ
Copy link
Member

InfernoJJ commented Feb 25, 2022 via email

@InfernoJJ
Copy link
Member

InfernoJJ commented Feb 25, 2022 via email

@InfernoJJ
Copy link
Member

InfernoJJ commented Feb 25, 2022 via email

@InfernoJJ
Copy link
Member

You don't really need to do the leader election either as Kafka already time one to determine what service reads the partitions. Just need impotency of checking if the file was already uploaded if for instance a network failure causes it to not commit the offsets.

The event to trigger to cutoff is the best way I can think of having consistent flow of messages and knowing exactly what events ended up in the file.

@adamdecaf
Copy link
Member Author

Yea. Doing this would require the partition keys are managed by producers in a way that they understand when cutoffs are triggered. We have a bunch of UUIDs mapped to "ODFI_1" and "ODFI_2", so the partition keys would need to be "ODFI_1" and "ODFI_2". Then each achgateway instance will get a consistent set of files to upload.

https://kafka.apache.org/documentation/#intro_concepts_and_terms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants