Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
[skip-ci]
  • Loading branch information
badgerwithagun authored Mar 21, 2024
1 parent 415dcf1 commit 7162078
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,21 @@ outbox.with()
Where `context-clientid` is a globally-unique identifier derived from the incoming request. Such ids are usually available from queue middleware as message ids, or if not you can require as part of the incoming API (possibly with a tenant prefix to ensure global uniqueness across tenants).
### Delayed/scheduled processing ###
To delay execution of a task, use:
```java
outbox.with()
.delayForAtLeast(Duration.of(5, MINUTES))
.schedule(Service.class)
.process("Foo");
```
There are some caveats around how accurate timing is. See the JavaDoc on the `delayForAtLeast` method for more information.
This is particularly useful when combined with the [nested outbox pattern](#the-nested-outbox-pattern) for creating polling/repeated or recursive tasks to throttle prcessing.
### Flexible serialization (beta)
Most people will use the default persistor, `DefaultPersistor`, to persist tasks to a relational database. This uses `DefaultInvocationSerializer` by default, which in turn uses [GSON](https://github.com/google/gson) to serialize as JSON. `DefaultInvocationSerializer` is extremely limited by design, with a small list of allowed classes in method arguments.
Expand Down

0 comments on commit 7162078

Please sign in to comment.