Skip to content

Commit e8b9aa0

Browse files
committed
[fix][broker] Avoid IllegalStateException when marker_type field is not set in publishing (#24087)
(cherry picked from commit 3e6f7de)
1 parent e73aa8b commit e8b9aa0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/MessageDeduplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private void setContextPropsIfRepl(PublishContext publishContext, ByteBuf header
372372
// Message is coming from replication, we need to use the replication's producer name, ledger id and entry
373373
// id for the purpose of deduplication.
374374
MessageMetadata md = Commands.peekMessageMetadata(headersAndPayload, "Check-Deduplicate", -1);
375-
if (Markers.isReplicationMarker(md.getMarkerType())) {
375+
if (md != null && md.hasMarkerType() && Markers.isReplicationMarker(md.getMarkerType())) {
376376
publishContext.setProperty(MSG_PROP_IS_REPL_MARKER, "");
377377
}
378378
return;

0 commit comments

Comments
 (0)