forked from HomeAdvisor/Kafdrop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request HomeAdvisor#33 from lcary/lcary/avro_integration
Add Avro message deserialization capability
- Loading branch information
Showing
12 changed files
with
363 additions
and
51 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
42 changes: 42 additions & 0 deletions
42
src/main/java/com/homeadvisor/kafdrop/config/MessageFormatConfiguration.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,42 @@ | ||
package com.homeadvisor.kafdrop.config; | ||
|
||
import javax.annotation.PostConstruct; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.homeadvisor.kafdrop.util.MessageFormat; | ||
|
||
|
||
@Configuration | ||
public class MessageFormatConfiguration { | ||
|
||
@Component | ||
@ConfigurationProperties(prefix = "message") | ||
public static class MessageFormatProperties | ||
{ | ||
|
||
private MessageFormat format; | ||
|
||
@PostConstruct | ||
public void init() { | ||
// Set a default message format if not configured. | ||
if (format == null) { | ||
format = MessageFormat.DEFAULT; | ||
} | ||
} | ||
|
||
public MessageFormat getFormat() | ||
{ | ||
return format; | ||
} | ||
|
||
public void setFormat(MessageFormat format) | ||
{ | ||
this.format = format; | ||
} | ||
|
||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/homeadvisor/kafdrop/config/SchemaRegistryConfiguration.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,44 @@ | ||
package com.homeadvisor.kafdrop.config; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
import java.util.regex.Pattern; | ||
import java.util.stream.Collectors; | ||
|
||
|
||
@Configuration | ||
public class SchemaRegistryConfiguration { | ||
|
||
@Component | ||
@ConfigurationProperties(prefix = "schemaregistry") | ||
public static class SchemaRegistryProperties | ||
{ | ||
|
||
public static final Pattern CONNECT_SEPARATOR = Pattern.compile("\\s*,\\s*"); | ||
|
||
private String connect; | ||
|
||
public String getConnect() | ||
{ | ||
return connect; | ||
} | ||
|
||
public void setConnect(String connect) | ||
{ | ||
this.connect = connect; | ||
} | ||
|
||
public List<String> getConnectList() | ||
{ | ||
return CONNECT_SEPARATOR.splitAsStream(this.connect) | ||
.map(String::trim) | ||
.filter(s -> s.length() > 0) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
} | ||
|
||
} |
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
Oops, something went wrong.