micronaut-projects / micronaut-projects/micronaut-cache

Cached Flux with multiple values returns list wrapped in Flux

Open
#519 2 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: awaiting feedback
Dominant language
PLSQL
Stars
32
Forks
36
Avg merge
2h 2m
Merged PRs (30d)
5

Description

Expected Behavior

Cached Flux (or any Publisher) with multiple values should return a Flux containing the same values. (Or fail instantly, if this should not be supported.)

Actual Behaviour

Cached Flux returns a Flux with the values wrapped in a List.

Steps To Reproduce
  1. Return Flux with multiple values from a cached method
    @Cacheable(cacheNames = ["sample"])
    open fun flux(first: Int): Flux<Int> = Flux.just(first, first + 1)
  1. Call the cached service collecting the result
  2. Observe the result is list of list with values
Environment Information

No response

Example Application

https://github.com/tPeltola/mncache/tree/cache-flux-multiple

Version

3.7.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked example application and reproduce the cached Kotlin service method returning Flux.just(first, first + 1) on version 3.7.1. Trace the cache handling for a Publisher and verify that collecting the cached result preserves the individual values, or that unsupported caching fails immediately.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.