Browse Source

Merge branch 'master' into issues/4082

Roman Zabaluev 1 year ago
parent
commit
c4273e5c94

+ 4 - 0
README.md

@@ -18,6 +18,10 @@
     <a href="https://www.producthunt.com/products/ui-for-apache-kafka/reviews/new">ProductHunt</a>
     <a href="https://www.producthunt.com/products/ui-for-apache-kafka/reviews/new">ProductHunt</a>
 </p>
 </p>
 
 
+<p align="center">
+  <img src="https://repobeats.axiom.co/api/embed/2e8a7c2d711af9daddd34f9791143e7554c35d0f.svg" />
+</p>
+
 #### UI for Apache Kafka is a free, open-source web UI to monitor and manage Apache Kafka clusters.
 #### UI for Apache Kafka is a free, open-source web UI to monitor and manage Apache Kafka clusters.
 
 
 UI for Apache Kafka is a simple tool that makes your data flows observable, helps find and troubleshoot issues faster and deliver optimal performance. Its lightweight dashboard makes it easy to track key metrics of your Kafka clusters - Brokers, Topics, Partitions, Production, and Consumption.
 UI for Apache Kafka is a simple tool that makes your data flows observable, helps find and troubleshoot issues faster and deliver optimal performance. Its lightweight dashboard makes it easy to track key metrics of your Kafka clusters - Brokers, Topics, Partitions, Production, and Consumption.

+ 9 - 0
kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/builtin/HexSerde.java

@@ -16,12 +16,21 @@ public class HexSerde implements BuiltInSerde {
     return "Hex";
     return "Hex";
   }
   }
 
 
+  @Override
+  public void autoConfigure(PropertyResolver kafkaClusterProperties, PropertyResolver globalProperties) {
+    configure(" ", true);
+  }
+
   @Override
   @Override
   public void configure(PropertyResolver serdeProperties,
   public void configure(PropertyResolver serdeProperties,
                         PropertyResolver kafkaClusterProperties,
                         PropertyResolver kafkaClusterProperties,
                         PropertyResolver globalProperties) {
                         PropertyResolver globalProperties) {
     String delim = serdeProperties.getProperty("delimiter", String.class).orElse(" ");
     String delim = serdeProperties.getProperty("delimiter", String.class).orElse(" ");
     boolean uppercase = serdeProperties.getProperty("uppercase", Boolean.class).orElse(true);
     boolean uppercase = serdeProperties.getProperty("uppercase", Boolean.class).orElse(true);
+    configure(delim, uppercase);
+  }
+
+  private void configure(String delim, boolean uppercase) {
     deserializeHexFormat = HexFormat.ofDelimiter(delim);
     deserializeHexFormat = HexFormat.ofDelimiter(delim);
     if (uppercase) {
     if (uppercase) {
       deserializeHexFormat = deserializeHexFormat.withUpperCase();
       deserializeHexFormat = deserializeHexFormat.withUpperCase();

+ 2 - 6
kafka-ui-api/src/test/java/com/provectus/kafka/ui/serdes/builtin/HexSerdeTest.java

@@ -16,16 +16,12 @@ public class HexSerdeTest {
   private static final byte[] TEST_BYTES = "hello world".getBytes();
   private static final byte[] TEST_BYTES = "hello world".getBytes();
   private static final String TEST_BYTES_HEX_ENCODED = "68 65 6C 6C 6F 20 77 6F 72 6C 64";
   private static final String TEST_BYTES_HEX_ENCODED = "68 65 6C 6C 6F 20 77 6F 72 6C 64";
 
 
-  private Serde hexSerde;
+  private HexSerde hexSerde;
 
 
   @BeforeEach
   @BeforeEach
   void init() {
   void init() {
     hexSerde = new HexSerde();
     hexSerde = new HexSerde();
-    hexSerde.configure(
-        PropertyResolverImpl.empty(),
-        PropertyResolverImpl.empty(),
-        PropertyResolverImpl.empty()
-    );
+    hexSerde.autoConfigure(PropertyResolverImpl.empty(), PropertyResolverImpl.empty());
   }
   }