Skip to content

Kotlin DSL: handle(handler: (P, MessageHeaders) -> Any) endpoint should not require output channel if lambda returns void #3344

@ikarsokolov

Description

@ikarsokolov

Expected Behavior

handle<T> { payload, headers -> .. } should work without output channel configured if lambda returns void.
Like handle { message -> .. } currently does.

Current Behavior

integrationFlow(inputChannel) {
    wireTap {
        transform(Transformers.toJson(NODE))
        handle<ObjectNode> { payload, headers ->
            logger.debug(...)
        }
    }
    ...
}

throws DestinationResolutionException: no output-channel or replyChannel header available. While

integrationFlow(inputChannel) {
    wireTap {
        transform(Transformers.toJson(NODE))
        handle { message ->
            logger.debug(...)
        }
    }
    ...
}

works as intended.

Context
Now I am using this workaround, not sure if it is the best way to go:

handle<ObjectNode> { payload, headers ->
    logger.debug(...)
}
channel(nullChannel)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions