Skip to content

Function post processing doesn't work with Kotlin classes #1300

@dnijssen

Description

@dnijssen

Describe the bug
We've recently started to implement a PostProcessingFunction (described in https://docs.spring.io/spring-cloud-stream/reference/spring-cloud-stream/post-processing-after-sending-message.html and #1023) however this doesn't seem to work when doing it in Kotlin. The PostProcessionFunction gets wrapped into KotlinFunctionWrapper and therefore it's not recognized as a PostProcessingFunction anymore;

if (target instanceof PostProcessingFunction) {
    this.postProcessor = (PostProcessingFunction) target;
}

Using the following versions:

  • Spring Boot :: v3.5.4
  • Spring Cloud Stream :: v4.3.0
  • Spring Cloud Function :: v4.3.0

So in our case the postProcess function simply doesn't get invoked. As workaround we added a Java equivelent for now, which works. But we actually don't want to be writing Java in our codebases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions