Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
<exclusions>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Info] The okhttp exclusion is well-targeted. Since RocketMQ uses the gRPC exporter (opentelemetry-exporter-otlp with gRPC transport), the HTTP sender (okhttp) is unused and was pulling kotlin-stdlib transitively into pure-Java consumers.

This mirrors the existing okio-jvm exclusion pattern in the root pom and keeps the dependency tree clean for Java-only deployments.

<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;

public class Message implements Serializable {
private static final long serialVersionUID = 8445773977080406428L;
Expand Down Expand Up @@ -98,10 +99,12 @@ public void putUserProperty(final String name, final String value) {
this.putProperty(name, value);
}

@Nullable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Info] The @Nullable annotations are correctly applied to all seven getters that can legitimately return null. This improves IDE support and Kotlin interop without changing runtime behavior.

One minor note: javax.annotation.Nullable is from JSR-305 (legacy). Modern Java projects sometimes prefer org.jetbrains.annotations.Nullable or @org.checkerframework.checker.nullness.qual.Nullable, but javax.annotation.Nullable is widely recognized and works well with Kotlin's null-safety. No action needed.

public String getUserProperty(final String name) {
return this.getProperty(name);
}

@Nullable
public String getProperty(final String name) {
if (null == this.properties) {
this.properties = new HashMap<>();
Expand All @@ -125,6 +128,7 @@ public void setTopic(String topic) {
this.topic = topic;
}

@Nullable
public String getTags() {
return this.getProperty(MessageConst.PROPERTY_TAGS);
}
Expand All @@ -133,6 +137,7 @@ public void setTags(String tags) {
this.putProperty(MessageConst.PROPERTY_TAGS, tags);
}

@Nullable
public String getKeys() {
return this.getProperty(MessageConst.PROPERTY_KEYS);
}
Expand Down Expand Up @@ -200,6 +205,7 @@ public void setBody(byte[] body) {
this.body = body;
}

@Nullable
public Map<String, String> getProperties() {
return properties;
}
Expand All @@ -208,6 +214,7 @@ void setProperties(Map<String, String> properties) {
this.properties = properties;
}

@Nullable
public String getBuyerId() {
return getProperty(MessageConst.PROPERTY_BUYER_ID);
}
Expand All @@ -216,6 +223,7 @@ public void setBuyerId(String buyerId) {
putProperty(MessageConst.PROPERTY_BUYER_ID, buyerId);
}

@Nullable
public String getTransactionId() {
return transactionId;
}
Expand Down