Skip to content

Commit

Permalink
JAMES-3784 WebAdmin: Document - Provide RunningOptions (limit) for Re…
Browse files Browse the repository at this point in the history
…deliver event task, Reprocessing mail task
  • Loading branch information
vttranlina committed Jul 7, 2022
1 parent f759e48 commit c92f7cc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ all mails in a mail repository] or
xref:operate/webadmin.adoc#_reprocessing_a_specific_mail_from_a_mail_repository[reprocessing
a single mail in a mail repository].

In order to prevent unbounded processing that could consume unbounded resources. We can provide a CRON with `limit` parameter.
Ex: 10 reprocessed per minute
Note that it only support the reprocessing all mails.

Also, one can decide to
xref:operate/webadmin.adoc#_removing_all_mails_from_a_mail_repository[delete
all the mails of a mail repository] or
Expand Down Expand Up @@ -114,6 +118,9 @@ xref:operate/webadmin.adoc#_redeliver_all_events[redeliver all events]
task. It will start reprocessing all the failed events registered in
event dead letters.

In order to prevent unbounded processing that could consume unbounded resources. We can provide a CRON with `limit` parameter.
Ex: 10 redelivery per minute

If for some other reason you don’t need to redeliver all events, you
have more fine-grained operations allowing you to
xref:operate/webadmin.adoc#_redeliver_group_events[redeliver group events]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3427,8 +3427,10 @@ processing in. Defaults to the `state` field of each processed email.
- `consume` (boolean defaulting to `true`) whether the reprocessing should consume the mail in its originating mail repository. Passing
this value to `false` allows non destructive reprocessing as you keep a copy of the email in the mail repository and can be valuable
when debugging.
- `limit` (integer value. Optional, default is empty). It enables to limit the count of elements reprocessed.
If unspecified the count of the processed elements is unbounded

For instance:
redeliver_group_events

....
curl -XPATCH 'http://ip:port/mailRepositories/var%2Fmail%2Ferror%2F/mails?action=reprocess&processor=transport&queue=spool'
Expand Down Expand Up @@ -3814,6 +3816,17 @@ Response codes:
curl -XPOST http://ip:port/events/deadLetter?action=redeliver
....

Additional query parameters are supported:

- `limit` (integer value. Optional, default is empty). It enables to limit the count of elements redelivered.
If unspecified the count of the processed elements is unbounded

For instance:

....
curl -XPOST http://ip:port/events/deadLetter?action=redeliver&limit=10
....

Will create a task that will attempt to redeliver all events stored in
``Event Dead Letter''. If successful, redelivered events will then be
removed from ``Dead Letter''.
Expand All @@ -3829,13 +3842,24 @@ Response codes:
=== Redeliver group events

....
curl -XPOST http://ip:port/events/deadLetter/groups/org.apache.james.mailbox.events.EventBusTestFixture$GroupA
curl -XPOST http://ip:port/events/deadLetter/groups/org.apache.james.mailbox.events.EventBusTestFixture$GroupA?action=redeliver
....

Will create a task that will attempt to redeliver all events of a
particular group stored in ``Event Dead Letter''. If successful,
redelivered events will then be removed from ``Dead Letter''.

Additional query parameters are supported:

- `limit` (integer value. Optional, default is empty). It enables to limit the count of elements redelivered.
If unspecified the count of the processed elements is unbounded

For instance:

....
curl -XPOST http://ip:port/events/deadLetter/groups/org.apache.james.mailbox.events.EventBusTestFixture$GroupA?action=redeliver&limit=10
....

link:#_endpoints_returning_a_task[More details about endpoints returning
a task].

Expand Down
7 changes: 7 additions & 0 deletions src/site/markdown/server/manage-guice-distributed-james.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ WebAdmin exposes all utilities for
or
[reprocessing a single mail in a mail repository](manage-webadmin.html#Reprocessing_a_specific_mail_from_a_mail_repository).

In order to prevent unbounded processing that could consume unbounded resources. We can provide a CRON with `limit` parameter.
Ex: 10 reprocessed per minute
Note that it only support the reprocessing all mails.

Also, one can decide to
[delete all the mails of a mail repository](manage-webadmin.html#Removing_all_mails_from_a_mail_repository)
or [delete a single mail of a mail repository](manage-webadmin.html#Removing_a_mail_from_a_mail_repository).
Expand Down Expand Up @@ -206,6 +210,9 @@ An easy way to solve this is just to trigger then the
[redeliver all events](manage-webadmin.html#Redeliver_all_events) task. It will start
reprocessing all the failed events registered in event dead letters.

In order to prevent unbounded processing that could consume unbounded resources. We can provide a CRON with `limit` parameter.
Ex: 10 redelivery per minute

If for some other reason you don't need to redeliver all events, you have more fine-grained operations allowing you to
[redeliver group events](manage-webadmin.html#Redeliver_group_events) or even just
[redeliver a single event](manage-webadmin.html#Redeliver_a_single_event).
Expand Down

0 comments on commit c92f7cc

Please sign in to comment.