Skip to content

add 'spring.config.intergration-location' with 'classpath*:' support #25080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

stategen
Copy link

@stategen stategen commented Feb 2, 2021

This new feature add a lowest arg spring.config.intergration-location with value 'classpath*:' support.
In some cases, we integrate jars with an uncertain number, such as message subscribers. This new feature can make message sending truly dynamic and zero configuration for providers

@pivotal-issuemaster
Copy link

@stategen Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 2, 2021
@pivotal-issuemaster
Copy link

@stategen Thank you for signing the Contributor License Agreement!

@philwebb
Copy link
Member

philwebb commented Feb 2, 2021

Thanks for the pull-request, but this is quite a substantial set of changes and we won't be able to apply them in their current form. We have an open issue (#24688) to discuss the idea of jars contributing additional properties, could you please add your use-case to that issue.

There's a lot of potential gotchas with adding wildcard imports so we're taking some time to think about the design.

@philwebb philwebb closed this Feb 2, 2021
@philwebb philwebb added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 2, 2021
@stategen
Copy link
Author

stategen commented Feb 2, 2021

thanks for your replies, my case is as this :

project B is the spring-stream consumer recieves mq from project A

    classpath:/sink/B/application.yml:
    spring.cloud.stream:
        function.definition: supplier;methodB1;methodB2...n;
        bindings:
            methodB1-in-0.destination: methodB1-dest
            methodB2-in-0.destination: methodB2-dest
            ...
            methodBn-in-0.destination: methodBn-dest

project C is the spring-stream consumer recieves mq from project A

    classpath:/sink/C/application.yml:
    spring.cloud.stream:
        function.definition: supplier;methodC1;methodC2...n;
        bindings:
            methodC1-in-0.destination: methodC1-dest
            methodC2-in-0.destination: methodC2-dest
            ...
            methodCn-in-0.destination: methodCn-dest
    ...       

project N is the spring-stream consumer recieves mq from project A

project A's config will sync manual summary with B,C...N'config like below:

    classpath:/application.yml:
    spring.cloud.stream:
        function.definition: methodB1;methodB2...n,methodC1;methodC2...n,...methodN1;methodN2...n;
        bindings:
            methodB1-in-0.destination: methodB1-dest
            methodB2-in-0.destination: methodB2-dest
            ...
            methodBn-in-0.destination: methodBn-dest

            methodC1-in-0.destination: methodC1-dest
            methodC2-in-0.destination: methodC2-dest
            ...
            methodCn-in-0.destination: methodCn-dest            
    ...  

the work is hard,hard,hard and never stable,never never never stop!

Now Now Now with my this update. project B ,C,...N only facade a itself jar with config as below

--spring.config.intergration-location=classpath*:/sink/*/[application.yml] 
//rule: lowest order and can be overrided by any, not care conflicts,not overrides higher value, limit 2 wildcards ,endswith '*/' or file and filtered by /sink/ ,so not slow,
    classpath:/sink/N/application.yml: 
    spring.cloud.stream:
        function.map: 
           methodN1: true
           methodN2: true
           ...
           methodN2: true
        bindings:
            methodN1-in-0.destination: methodN1-dest
            methodN2-in-0.destination: methodN2-dest
            ...
            methodNn-in-0.destination: methodNn-dest 
    auto join spring.cloud.stream.function.map's keySet as it's onwer spring.cloud.stream.function.definition     
project A do nothing but hold the arg,
--spring.config.intergration-location=classpath*:/sink/*/[application.yml] 

auto join or plus spring.cloud.stream.function.map's keySet as it's onwer spring.cloud.stream.function.definition
project A can override classpath*:/sink/*/[application.yml] configs any time,any way.

Perfect!

@stategen
Copy link
Author

stategen commented Feb 2, 2021

@philwebb ,the github'editor musk some chars or changed the style I typed,if need ,i can create a demo from my real from my real projects?

@philwebb
Copy link
Member

philwebb commented Feb 2, 2021

@stategen I tried to edit your comment. Take a look at https://guides.github.com/features/mastering-markdown/ for instructions on how to format your comments. I think a sample would certainly help.

@stategen
Copy link
Author

stategen commented Feb 2, 2021

@philwebb ,nice format!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants