-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rm global Kafka configuration
Global Kafka configration would not work as certian services/components require a slightly different parameters to be set for the Kafka client initialized for them. One solution would be to allow service/components to override certian parameters set in the global Kafka configuration, however it would introduce extra complexity around generating service specific KAfka configuration from multiple sources. Another alternative to have dedicated Kafka configuration for all the service/components. It makes the configuration more verbose, but less complex/error prone.
- Loading branch information
1 parent
ef914df
commit d87c9b7
Showing
7 changed files
with
122 additions
and
105 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package config | ||
|
||
import "strings" | ||
|
||
// AddPrefix returns string with "<prefix>." prepended to key. | ||
// If returns key unmodified if prefix is empty or key already has the prefix added. | ||
func AddPrefix(prefix, key string) string { | ||
if prefix == "" || strings.HasPrefix(key, prefix+".") { | ||
return key | ||
} | ||
|
||
return prefix + "." + key | ||
} |
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