Merge branch 'vip' into rocketmq

pull/10/head
Java3y 2 years ago committed by GitHub
commit 637f48523b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -98,6 +98,12 @@
<groupId>com.aliyun</groupId>
<artifactId>alibaba-dingtalk-service-sdk</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
</dependency>
</dependencies>
</project>

@ -10,5 +10,6 @@ public interface MessageQueuePipeline {
String EVENT_BUS = "eventBus";
String KAFKA = "kafka";
String ROCKET_MQ = "rocketMq";
String RABBIT_MQ = "rabbitMq";
}

@ -0,0 +1,45 @@
package com.java3y.austin.support.mq.rabbit;
import com.java3y.austin.support.constans.MessageQueuePipeline;
import com.java3y.austin.support.mq.SendMqService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;
/**
* @Autor xzcawl
* @Date 2022/7/15 17:29
*/
@Slf4j
@Service
@ConditionalOnProperty(name = "austin-mq-pipeline", havingValue = MessageQueuePipeline.RABBIT_MQ)
public class RabbitSendMqServiceImpl implements SendMqService {
@Autowired
private RabbitTemplate rabbitTemplate;
@Value("${austin.rabbitmq.topic.name}")
private String confTopic;
@Value("${austin.rabbitmq.exchange.name}")
private String exchangeName;
@Override
public void send(String topic, String jsonValue, String tagId) {
if (topic.equals(confTopic)) {
rabbitTemplate.convertAndSend(exchangeName, confTopic, jsonValue);
} else {
log.error("RabbitSendMqServiceImpl send topic error! topic:{},confTopic:{}", topic, confTopic);
}
}
@Override
public void send(String topic, String jsonValue) {
send(topic, jsonValue, null);
}
}

@ -63,6 +63,26 @@ spring.kafka.consumer.enable-auto-commit=true
rocketmq.name-server=${austin-rocketmq-nameserver-ip}:${austin-rocketmq-nameserver-port}
rocketmq.producer.group=${austin-rocketmq-producer-group}
##################### Rabbit properties #####################
server.port=8080
spring.application.name=cl
#RabbitMq所在服务器IP
spring.rabbitmq.host=127.0.0.1
#连接端口号
spring.rabbitmq.port=5672
#用户名
spring.rabbitmq.username=root
#用户密码
spring.rabbitmq.password=123456
# 开启发送确认
spring.rabbitmq.publisher-confirm-type=correlated
# 开启发送失败退回
spring.rabbitmq.publisher-returns=true
spring.rabbitmq.virtual-host=/
austin.rabbitmq.topic.name=austinRabbit
austin.rabbitmq.exchange.name=austin.point
##################### redis properties #####################
spring.redis.host=${austin-redis-ip}
spring.redis.port=${austin-redis-port}

@ -153,6 +153,13 @@
<version>${flink.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.flink/flink-connector-rabbitmq -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-rabbitmq</artifactId>
<version>1.15.1</version>
</dependency>
<!--微信服务号第三方SDK-->
<dependency>
<groupId>com.github.binarywang</groupId>
@ -193,6 +200,7 @@
<artifactId>rocketmq-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
</dependencies>
</dependencyManagement>

Loading…
Cancel
Save