spring-cloud-dataflowspring-cloud-dataflow-ui

Spring cloud data flow custom application properties


I created a custom spring cloud data flow application. I would like to create a stream with it and put some application properties in it, as we can add for the provided application log (0/3 properties): enter image description here

I tried with application.yml file in resources folder:

spring:
  application:
    toto: 'titi'

but it didn't work.

I also tried to create some Properties.class

public class Properties {

    //public static final String PREFIX = "portin";
    private String toto;

    public Properties(String toto) {
        this.toto = toto;
    }

    public Properties() {
    }

    public String getToto() {
        return toto;
    }

    public void setToto(String toto) {
        this.toto = toto;
    }
}

and add the folowing declaration in dataflow-configuration-metadata-whitelist.properties file:

configuration-properties.classes=com.mycompany.Properties but that was not a success and the aplication doesn't have any property.

I couldn't find anything relevant in documentation (I am not English speaking native so I may have misread something).

Thanks for helping

EDIT after moving dataflow-configuration-metadata-whitelist.properties in META-INF folder

the whitelist property files were not under META-INF folder. Now I have this project:

enter image description here

but it doesn't help. The pom.xml is:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-app-starter-metadata-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>aggregate-metadata</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>aggregate-metadata</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

then I build the application with docker. Is there something docker specific to do then? I could read the documentation but cannot see what is missing on my project


Solution

  • I could do the job thanks to this post: Spring Cloud Dataflow Kubernetes get properties of jar from dockerfile The way I registered the app was wrong. Now, I add the companion metadata URI and it works