fix: `metadata` is never `null`
authorKai Moritz <kai@juplo.de>
Sun, 28 Jan 2024 17:50:33 +0000 (18:50 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 20 Feb 2024 09:35:33 +0000 (10:35 +0100)
src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java
src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/InfoChannel.java

index da90663..381152b 100644 (file)
@@ -96,7 +96,7 @@ public class DataChannel implements Runnable, ConsumerRebalanceListener
 
       producer.send(record, ((metadata, exception) ->
       {
-        if (metadata != null)
+        if (exception == null)
         {
           // On successful send
           Message message = new Message(key, metadata.offset(), timestamp, text);
index 26e8696..1d9d801 100644 (file)
@@ -81,7 +81,7 @@ public class InfoChannel implements Runnable
 
       producer.send(record, ((metadata, exception) ->
       {
-        if (metadata != null)
+        if (exception == null)
         {
           log.info("Successfully sent chreate-request for chat room: {}", to);
           ChatRoomInfo chatRoomInfo = new ChatRoomInfo(chatRoomId, name, shard);