-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config wizard BE: Add remaining cluster properties to wizard API (#3523)
* Important @value annotated properties moved to typed classes --------- Co-authored-by: iliax <[email protected]> Co-authored-by: Roman Zabaluev <[email protected]> Co-authored-by: VladSenyuta <[email protected]>
- Loading branch information
1 parent
19c0b29
commit 16305b2
Showing
7 changed files
with
76 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/WebclientProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.provectus.kafka.ui.config; | ||
|
||
import com.provectus.kafka.ui.exception.ValidationException; | ||
import java.beans.Transient; | ||
import javax.annotation.PostConstruct; | ||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.util.unit.DataSize; | ||
|
||
@Configuration | ||
@ConfigurationProperties("webclient") | ||
@Data | ||
public class WebclientProperties { | ||
|
||
String maxInMemoryBufferSize; | ||
|
||
@PostConstruct | ||
public void validate() { | ||
validateAndSetDefaultBufferSize(); | ||
} | ||
|
||
private void validateAndSetDefaultBufferSize() { | ||
if (maxInMemoryBufferSize != null) { | ||
try { | ||
DataSize.parse(maxInMemoryBufferSize); | ||
} catch (Exception e) { | ||
throw new ValidationException("Invalid format for webclient.maxInMemoryBufferSize"); | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters