Skip to content

User's defined cloud stream binder are not recognized by AOT stage #2828

Description

@petretiandrea

Describe the issue
This introduce a bug where AOT doesn't recognize user defined binders.

.bind("spring.cloud.stream.binders", Bindable.ofInstance(bindingServiceProperties));

Given this configuration the AOT pre-creates only "kafka" (the default one) not for test1 and test2

spring:
    cloud:
        function:
            definition: test1;test2
        stream:
            default-binder: test1
            bindings:
                test1-in-0:
                    destination: topic-test-1
                    group: topic-test1-group
                    binder: test1
                test2-in-0:
                    destination: topic-test-2
                    group: topic-test2-group
                    binder: test2
            binders:
              test1:
                type: kakfa
              test2:
                type: kakfa

By editing the configuration in this way:

spring:
    cloud:
        function:
            definition: test1;test2
        stream:
            default-binder: test1
            bindings:
                test1-in-0:
                    destination: topic-test-1
                    group: topic-test1-group
                    binder: test1
                test2-in-0:
                    destination: topic-test-2
                    group: topic-test2-group
                    binder: test2
            binders:
              binders:
                test1:
                  type: kakfa
                test2:
                  type: kakfa

Yes, with two binders keyword, the AOT pre-creates test1 and test2.

I'm doing something wrong or is an unexpected bug?

To Reproduce
Try to use this simple cloud stream configuration

spring:
    cloud:
        function:
            definition: test1;test2
        stream:
            default-binder: test1
            bindings:
                test1-in-0:
                    destination: topic-test-1
                    group: topic-test1-group
                    binder: test1
                test2-in-0:
                    destination: topic-test-2
                    group: topic-test2-group
                    binder: test2
            binders:
              test1:
                type: kakfa
              test2:
                type: kakfa

Version of the framework
2023.0.0-SNAPSHOT
Expected behavior
No two binders keywork required and AOT recognize user defined binders.
Screenshots

Additional context
Add any other context about the problem here.

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