Skip to content

Commit

Permalink
refactor the compact session topic event
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed May 30, 2024
1 parent 016ca37 commit 405c718
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

public final class MqttKafkaEventFormatter implements EventFormatterSpi
{
private static final String NON_COMPACT_SESSIONS_TOPIC_FORMAT = "NON COMPACT SESSIONS TOPIC - %s";

private final EventFW eventRO = new EventFW();
private final MqttKafkaEventExFW mqttKafkaEventExRO = new MqttKafkaEventExFW();

Expand All @@ -49,7 +47,7 @@ public String format(
case NON_COMPACT_SESSIONS_TOPIC:
{
MqttKafkaResetMqttConnectionExFW ex = extension.nonCompactSessionsTopic();
result = String.format(NON_COMPACT_SESSIONS_TOPIC_FORMAT, asString(ex.reason()));
result = String.format("%s", asString(ex.reason()));
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public class MqttKafkaSessionFactory implements MqttKafkaStreamFactory
public static final int MQTT_NOT_AUTHORIZED = 0x87;
public static final int MQTT_IMPLEMENTATION_SPECIFIC_ERROR = 0x83;
public static final String MQTT_INVALID_SESSION_TIMEOUT_REASON = "Invalid session expiry interval";
public static final String16FW MQTT_NON_COMPACT_SESSIONS_TOPIC = new String16FW("Sessions Kafka topic in non-compacted");
public static final String16FW MQTT_NON_COMPACT_SESSIONS_TOPIC = new String16FW("The Sessions Kafka topic is non-compacted");
private static final KafkaConfigFW CONFIG_COMPACT_CLEANUP_POLICY = new KafkaConfigFW.Builder()
.wrap(new UnsafeBuffer(new byte[25]), 0, 25)
.name("cleanup.policy")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ telemetry:
events:
- qname: test.kafka0
id: binding.mqtt.kafka.non.compact.sessions.topic
message: NON COMPACT SESSIONS TOPIC - Sessions Kafka topic in non-compacted
name: BINDING_MQTT_KAFKA_NON_COMPACT_SESSIONS_TOPIC
message: The Sessions Kafka topic is non-compacted
bindings:
mqtt0:
type: mqtt-kafka
Expand Down

0 comments on commit 405c718

Please sign in to comment.