提交 f29df46a 编写于 作者: M MaxKey

remove rocketmq

上级 a7060664
......@@ -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}"
......
......@@ -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}"
......
......@@ -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}"
......
......@@ -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}"
......
......@@ -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<String, String> 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();
}
......
/*
* 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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册