mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-08 09:58:56 +08:00
remove rocketmq
This commit is contained in:
parent
a7060664c5
commit
f29df46ac4
@ -298,14 +298,6 @@ subprojects {
|
|||||||
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
||||||
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
||||||
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
|
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
|
//saml see maxkey-lib
|
||||||
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
||||||
|
|||||||
@ -259,14 +259,6 @@ subprojects {
|
|||||||
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
||||||
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
||||||
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
|
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
|
//saml see maxkey-lib
|
||||||
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
||||||
|
|||||||
@ -259,15 +259,7 @@ subprojects {
|
|||||||
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
||||||
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
||||||
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
|
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
|
//saml see maxkey-lib
|
||||||
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
||||||
//implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}"
|
//implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}"
|
||||||
|
|||||||
@ -295,15 +295,7 @@ subprojects {
|
|||||||
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
||||||
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
||||||
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
|
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
|
//saml see maxkey-lib
|
||||||
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
||||||
//implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}"
|
//implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}"
|
||||||
|
|||||||
@ -19,10 +19,8 @@ package org.maxkey.persistence.mq;
|
|||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|
||||||
import org.maxkey.configuration.ApplicationConfig;
|
import org.maxkey.configuration.ApplicationConfig;
|
||||||
import org.maxkey.persistence.mq.thread.KafkaProvisioningThread;
|
import org.maxkey.persistence.mq.thread.KafkaProvisioningThread;
|
||||||
import org.maxkey.persistence.mq.thread.RocketMQProvisioningThread;
|
|
||||||
import org.maxkey.util.DateUtils;
|
import org.maxkey.util.DateUtils;
|
||||||
import org.maxkey.util.JsonUtils;
|
import org.maxkey.util.JsonUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -40,9 +38,6 @@ public class MessageQueueService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected KafkaTemplate<String, String> kafkaTemplate;
|
protected KafkaTemplate<String, String> kafkaTemplate;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RocketMQTemplate rocketMQTemplate;
|
|
||||||
|
|
||||||
public void setApplicationConfig(ApplicationConfig applicationConfig) {
|
public void setApplicationConfig(ApplicationConfig applicationConfig) {
|
||||||
this.applicationConfig = applicationConfig;
|
this.applicationConfig = applicationConfig;
|
||||||
@ -63,7 +58,7 @@ public class MessageQueueService {
|
|||||||
* @param actionType CREATE UPDATE DELETE
|
* @param actionType CREATE UPDATE DELETE
|
||||||
*/
|
*/
|
||||||
public void send(String topic,Object content,String actionType) {
|
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()) {
|
if(applicationConfig.isMessageQueueSupport()) {
|
||||||
MqMessage message =
|
MqMessage message =
|
||||||
new MqMessage(
|
new MqMessage(
|
||||||
@ -79,9 +74,8 @@ public class MessageQueueService {
|
|||||||
if(applicationConfig.getMessageQueue().equalsIgnoreCase("Kafka")) {
|
if(applicationConfig.getMessageQueue().equalsIgnoreCase("Kafka")) {
|
||||||
_logger.trace("Kafka message...");
|
_logger.trace("Kafka message...");
|
||||||
thread = new KafkaProvisioningThread(kafkaTemplate,topic,msg);
|
thread = new KafkaProvisioningThread(kafkaTemplate,topic,msg);
|
||||||
}else if(applicationConfig.getMessageQueue().equalsIgnoreCase("RocketMQ")) {
|
}else{
|
||||||
_logger.trace("RocketMQ message...");
|
_logger.trace("no send message...");
|
||||||
thread = new RocketMQProvisioningThread(rocketMQTemplate,topic,msg);
|
|
||||||
}
|
}
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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 .");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user