parent
e6d3e03ac1
commit
f8937b3af6
@ -0,0 +1,19 @@
|
|||||||
|
package com.mashibing.smsgateway;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zjw
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableDiscoveryClient
|
||||||
|
public class SmsGatewayStarterApp {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(SmsGatewayStarterApp.class,args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.mashibing.smsgateway.mq;
|
||||||
|
|
||||||
|
import com.mashibing.common.model.StandardSubmit;
|
||||||
|
import com.rabbitmq.client.Channel;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.amqp.core.Message;
|
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zjw
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class SmsGatewayListener {
|
||||||
|
|
||||||
|
@RabbitListener(queues = "${gateway.sendtopic}",containerFactory = "gatewayContainerFactory")
|
||||||
|
public void consume(StandardSubmit submit, Channel channel, Message message) throws IOException, InterruptedException {
|
||||||
|
log.info("【短信网关模块】 接收到消息 submit = {}",submit);
|
||||||
|
// =====================完成运营商交互,发送一次请求,接收两次响应==========================
|
||||||
|
channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
# 服务名称
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: beacon-smsgateway
|
||||||
|
# 多环境
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
# nacos注册中心地址
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 114.116.226.76:8848
|
||||||
|
# nacos配置中心地址:
|
||||||
|
config:
|
||||||
|
server-addr: 114.116.226.76:8848
|
||||||
|
file-extension: yml
|
Loading…
Reference in new issue