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

Questions about .tags file and failure_policy #393

Open
dearith opened this issue Jun 4, 2021 · 1 comment
Open

Questions about .tags file and failure_policy #393

dearith opened this issue Jun 4, 2021 · 1 comment

Comments

@dearith
Copy link
Contributor

dearith commented Jun 4, 2021

I would like to know how to use the .tags file.

My use case is as follows.

==> a MFDATA plugin A (a listener)

  • consumes message on an amqp queue

  • depending of the content of the message, plugin A creates a file F containing the message, adds custom tags (e.g. tag "subject", value "xxxx") and then redirects the new file to switch plugin using move_to_plugin_step function

==> a MFDATA plugin B processes input files whose tag "subject" is "xxxx":

  • processing failed for some reason (e.g. database is shutdown) and failure policy is applied (e.g. keep)

  • so the "trash" directory contains the file F and its tags file (.tags)

Later (e.g. when database is OK), I would like to process again the file F : reinject the file to switch plugin with custom tag "subject" and its value "xxxx".
(I can't read any the message from the amqp queue)

To do this :

  • either I have to publish again a message in the amqp queue from the file F (that's not my favorite solution)

  • or I have to extract the tag subject from the .tags file and then redirects file F to switch plugin using move_to_plugin_step function

My first question : is there a mecanism implemented in Metwork to do this without implementing a new plugin ?

My second question : if I use failure_policy = move, I notice the .tags file is not created when failure policy is "move"
see _trash function in the AcquisitionStep class. Is there a way to get the .tags file in this case ?

In your opinion, what's the best way to implement my use case?

Thanks.

@thefab
Copy link
Member

thefab commented Jun 8, 2021

IMHO you should use the standard retry feature with some special parameters to retry for a long period? And not develop another retry feature by yourself?

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

No branches or pull requests

2 participants