增加 spring boot rabbitMQ 用例
This commit is contained in:
		
							
								
								
									
										14
									
								
								spring-boot/spring-boot-rabbitmq/rabbitmq-common/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								spring-boot/spring-boot-rabbitmq/rabbitmq-common/pom.xml
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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;
 | 
			
		||||
}
 | 
			
		||||
@@ -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";
 | 
			
		||||
}
 | 
			
		||||
@@ -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.*";
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user