增加 spring boot rabbitMQ 用例

This commit is contained in:
luoxiang
2019-01-01 14:57:16 +08:00
parent 4484b8d2af
commit dbd515b862
16 changed files with 448 additions and 0 deletions

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>spring-boot-rabbitmq</artifactId>
<groupId>com.heibaiying</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>rabbitmq-common</artifactId>
</project>

View File

@ -0,0 +1,26 @@
package com.heibaiying.bean;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @author : heibaiying
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
// 需要实现序列化接口
public class Programmer implements Serializable {
private String name;
private int age;
private float salary;
private Date birthday;
}

View File

@ -0,0 +1,19 @@
package com.heibaiying.constant;
/**
* @author : heibaiying
* @description : rabbit 公用配置信息
*/
public class RabbitBeanInfo {
// queue 配置
public static final String QUEUE_NAME = "spring.boot.bean.queue";
public static final String QUEUE_DURABLE = "true";
// exchange 配置
public static final String EXCHANGE_NAME = "spring.boot.bean.exchange";
public static final String EXCHANGE_TYPE = "direct";
// routing key
public static final String ROUTING_KEY = "springboot.bean";
}

View File

@ -0,0 +1,19 @@
package com.heibaiying.constant;
/**
* @author : heibaiying
* @description : rabbit 公用配置信息
*/
public class RabbitInfo {
// queue 配置
public static final String QUEUE_NAME = "spring.boot.simple.queue";
public static final String QUEUE_DURABLE = "true";
// exchange 配置
public static final String EXCHANGE_NAME = "spring.boot.simple.exchange";
public static final String EXCHANGE_TYPE = "topic";
// routing key
public static final String ROUTING_KEY = "springboot.simple.*";
}