diff --git a/build.gradle b/build.gradle index 982c0241e..6f59dbf8f 100644 --- a/build.gradle +++ b/build.gradle @@ -298,14 +298,6 @@ subprojects { implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}" // https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}" - //rocketmq - implementation group: 'org.apache.rocketmq', name: 'rocketmq-common', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-remoting', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-logging', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-client', version: "${rocketmqclientVersion}" - // https://mvnrepository.com/artifact/org.apache.rocketmq/rocketmq-spring-boot - implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot', version: "${rocketmqspringbootVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot-starter', version: "${rocketmqspringbootVersion}" //saml see maxkey-lib //implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}" diff --git a/config/build_docker.gradle b/config/build_docker.gradle index de66e8705..9c70cdf3c 100644 --- a/config/build_docker.gradle +++ b/config/build_docker.gradle @@ -259,14 +259,6 @@ subprojects { implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}" // https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}" - //rocketmq - implementation group: 'org.apache.rocketmq', name: 'rocketmq-common', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-remoting', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-logging', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-client', version: "${rocketmqclientVersion}" - // https://mvnrepository.com/artifact/org.apache.rocketmq/rocketmq-spring-boot - implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot', version: "${rocketmqspringbootVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot-starter', version: "${rocketmqspringbootVersion}" //saml see maxkey-lib //implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}" diff --git a/config/build_jar.gradle b/config/build_jar.gradle index b145e72b1..17504a8fe 100644 --- a/config/build_jar.gradle +++ b/config/build_jar.gradle @@ -259,15 +259,7 @@ subprojects { implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}" // https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}" - //rocketmq - implementation group: 'org.apache.rocketmq', name: 'rocketmq-common', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-remoting', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-logging', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-client', version: "${rocketmqclientVersion}" - // https://mvnrepository.com/artifact/org.apache.rocketmq/rocketmq-spring-boot - implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot', version: "${rocketmqspringbootVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot-starter', version: "${rocketmqspringbootVersion}" - + //saml see maxkey-lib //implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}" //implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}" diff --git a/config/build_standard.gradle b/config/build_standard.gradle index b18ba4343..5555f5f06 100644 --- a/config/build_standard.gradle +++ b/config/build_standard.gradle @@ -295,15 +295,7 @@ subprojects { implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}" // https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}" - //rocketmq - implementation group: 'org.apache.rocketmq', name: 'rocketmq-common', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-remoting', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-logging', version: "${rocketmqclientVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-client', version: "${rocketmqclientVersion}" - // https://mvnrepository.com/artifact/org.apache.rocketmq/rocketmq-spring-boot - implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot', version: "${rocketmqspringbootVersion}" - implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot-starter', version: "${rocketmqspringbootVersion}" - + //saml see maxkey-lib //implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}" //implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}" diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/mq/MessageQueueService.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/mq/MessageQueueService.java index 3e6467a14..2ea4f6774 100644 --- a/maxkey-persistence/src/main/java/org/maxkey/persistence/mq/MessageQueueService.java +++ b/maxkey-persistence/src/main/java/org/maxkey/persistence/mq/MessageQueueService.java @@ -19,10 +19,8 @@ package org.maxkey.persistence.mq; import java.util.UUID; -import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.maxkey.configuration.ApplicationConfig; import org.maxkey.persistence.mq.thread.KafkaProvisioningThread; -import org.maxkey.persistence.mq.thread.RocketMQProvisioningThread; import org.maxkey.util.DateUtils; import org.maxkey.util.JsonUtils; import org.slf4j.Logger; @@ -40,9 +38,6 @@ public class MessageQueueService { @Autowired protected KafkaTemplate kafkaTemplate; - - @Autowired - private RocketMQTemplate rocketMQTemplate; public void setApplicationConfig(ApplicationConfig applicationConfig) { this.applicationConfig = applicationConfig; @@ -63,7 +58,7 @@ public class MessageQueueService { * @param actionType CREATE UPDATE DELETE */ public void send(String topic,Object content,String actionType) { - //maxkey.server.message.queue , if not none , Kafka , RocketMQ + //maxkey.server.message.queue , if not none , Kafka if(applicationConfig.isMessageQueueSupport()) { MqMessage message = new MqMessage( @@ -79,9 +74,8 @@ public class MessageQueueService { if(applicationConfig.getMessageQueue().equalsIgnoreCase("Kafka")) { _logger.trace("Kafka message..."); thread = new KafkaProvisioningThread(kafkaTemplate,topic,msg); - }else if(applicationConfig.getMessageQueue().equalsIgnoreCase("RocketMQ")) { - _logger.trace("RocketMQ message..."); - thread = new RocketMQProvisioningThread(rocketMQTemplate,topic,msg); + }else{ + _logger.trace("no send message..."); } thread.start(); } diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/mq/thread/RocketMQProvisioningThread.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/mq/thread/RocketMQProvisioningThread.java deleted file mode 100644 index db311fe1d..000000000 --- a/maxkey-persistence/src/main/java/org/maxkey/persistence/mq/thread/RocketMQProvisioningThread.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.maxkey.persistence.mq.thread; - -import org.apache.rocketmq.spring.core.RocketMQTemplate; -import org.maxkey.pretty.PrettyFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.messaging.support.MessageBuilder; - -/** - * RocketMQ Provisioning Thread for send message - * - */ -public class RocketMQProvisioningThread extends Thread{ - - private static final Logger _logger = LoggerFactory.getLogger(RocketMQProvisioningThread.class); - - RocketMQTemplate rocketMQTemplate; - - String topic ; - - String msg; - - public RocketMQProvisioningThread( - RocketMQTemplate rocketMQTemplate, - String topic, - String msg) { - this.rocketMQTemplate = rocketMQTemplate; - this.topic = topic; - this.msg = msg; - } - - @Override - public void run() { - _logger.debug("send message \n{}" , PrettyFactory.getJsonPretty().format(msg)); - rocketMQTemplate.syncSend(topic, MessageBuilder.withPayload(msg).build()); - _logger.debug("send to Message Queue finished ."); - } -} \ No newline at end of file