Skip to content

Commit

Permalink
Revert changes of PersistentTopic#getMessageTTL in apache#12339.
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangHaiting committed Jul 31, 2022
1 parent d6f56f1 commit ff5945a
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2475,10 +2475,8 @@ private int getMessageTTL() throws Exception {
TopicName name = TopicName.get(topic);
TopicPolicies topicPolicies = getTopicPolicies(name);
Policies policies = brokerService.pulsar().getConfigurationCache().policiesCache()
.getDataIfPresent(AdminResource.path(POLICIES, name.getNamespace()));
if (policies == null) {
throw new KeeperException.NoNodeException();
}
.get(AdminResource.path(POLICIES, TopicName.get(topic).getNamespace()))
.orElseThrow(() -> new KeeperException.NoNodeException());
if (topicPolicies != null && topicPolicies.isMessageTTLSet()) {
return topicPolicies.getMessageTTLInSeconds();
}
Expand Down

0 comments on commit ff5945a

Please sign in to comment.