Skip to content

Streaming query - (Flux as Query handler return type) #3

Closed
@schananas

Description

@schananas

The Streaming query allows a client to stream large database result sets. The Streaming query relies on the reactive stream model, specifically the Flux type.

The streaming query is flexible enough to be used with any query return type. That means that any return type that is not Flux will automatically be converted to Flux, based on that Flux will return single or multiple items.

Natively, if we want fine-grained control of the producing stream we can use Flux as return type:

@QueryHandler fun handleQuery(query: GetAllUsersQuery): Flux<UserView> { return repository.findAll() }

When using Flux as a return type, we can control backpressure, stream cancellation and implement more complex features like pagination.

Update: This feature will be part of Axon Framework core, while reactive extension will add support for reactive interceptors

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions