diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/common/cp/CpRelationBroadcastMqClient.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/common/cp/CpRelationBroadcastMqClient.java index 6cc1f0cd..0990c7d3 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/common/cp/CpRelationBroadcastMqClient.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/common/cp/CpRelationBroadcastMqClient.java @@ -12,7 +12,6 @@ import lombok.RequiredArgsConstructor; import lombok.experimental.Accessors; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Slf4j @@ -20,22 +19,13 @@ import org.springframework.stereotype.Component; @RequiredArgsConstructor public class CpRelationBroadcastMqClient { + private static final String MQ_TOPIC = "RC_DEFAULT_APP_ORDINARY"; + private static final String MQ_TAG = "cp_relation_broadcast"; + private final ObjectProvider messageSenderServiceProvider; private final UserProfileGateway userProfileGateway; - @Value("${cp.relation-broadcast.mq.enabled:false}") - private boolean mqEnabled; - - @Value("${cp.relation-broadcast.mq.topic:RC_DEFAULT_APP_ORDINARY}") - private String mqTopic; - - @Value("${cp.relation-broadcast.mq.tag:cp_relation_broadcast}") - private String mqTag; - public void publish(String sysOrigin, Long applyId, Long userId, Long cpUserId, String relationType) { - if (!mqEnabled) { - return; - } if (Objects.isNull(userId) || Objects.isNull(cpUserId)) { log.warn("CP relation broadcast mq skip: user id missing. applyId={}, userId={}, cpUserId={}", applyId, userId, cpUserId); @@ -65,8 +55,8 @@ public class CpRelationBroadcastMqClient { } senderService.sendEventMessage(MessageEvent.builder() .consumeId(eventId) - .topicString(defaultIfBlank(mqTopic, "RC_DEFAULT_APP_ORDINARY")) - .tag(defaultIfBlank(mqTag, "cp_relation_broadcast")) + .topicString(MQ_TOPIC) + .tag(MQ_TAG) .body(event) .build()); } catch (Exception e) {