What are the six working modes of rabbitmq? How to integrate rabbitmq with springboot

What years and things 2021-01-23 09:42:37
working modes rabbitmq integrate rabbitmq


Catalog

  • One 、RabbitMQ Entry procedure
  • Two 、Work queues Working mode
  • 3、 ... and 、Publish / Subscribe Release / A subscription model
  • Four 、Routing Routing mode
  • 5、 ... and 、Topics
  • 6、 ... and 、Header
  • 7、 ... and 、RPC
  • 8、 ... and 、Spring Data Elasticsearch

One 、RabbitMQ Entry procedure

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</dependency>
</dependencies>

application.yml

server:
port: 44000
spring:
application:
name: test-rabbitmq-producer
rabbitmq:
username: guest
password: guest
host: 127.0.0.1
port: 5672
virtual-host: /

Message sender

/**
* Description: rabbitmq Entry procedure
*
* @author zygui
* @date Created on 2020/5/13 15:34
*/
public class Producer01 {
// Declare a message queue name
private static final String QUEUE_NAME = "helloworld";
public static void main(String[] args) {
// Create new connections with the connection factory mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/"); // The default is / that will do
// Establishing a connection
Connection connection = null;
// Set up a channel ( The purpose is to reuse the connection )
Channel channel = null;
try {
// Build new connections
connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
channel = connection.createChannel();
// Declaration queue , If the queue is in mq If not, create
// Parameters :String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<String, Object> arguments
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_NAME,true,false,false,null);
// Send a message
// Parameters :String exchange, String routingKey, BasicProperties props, byte[] body
/**
* Parameter details :
* 1、exchange, Switch , If not specified mq The default switch for ( Set to "")
* 2、routingKey, route key, Switch according to route key To forward the message to the specified queue , If you use the default switch ,routingKey Set to the name of the queue
* 3、props, The properties of the message
* 4、body, The message content
*/
// The message content
String message = "hello world GUI Chaoyang ";
channel.basicPublish("",QUEUE_NAME,null,message.getBytes());
System.out.println("send to mq "+message);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
// Turn off the channel
channel.close();
// Close the connection
connection.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

Message Receiver

/**
* Description: rabbitmq Entry procedure
*
* @author zygui
* @date Created on 2020/5/13 15:45
*/
public class Consumer01 {
private static final String QUEUE_NAME = "helloworld";
public static void main(String[] args) throws IOException, TimeoutException {
// Create new connections and mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);// port
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/");
// Build new connections
Connection connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
Channel channel = connection.createChannel();
// Listening to the queue
// Declaration queue , If the queue is in mq If not, create
// Parameters :String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<String, Object> arguments
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_NAME,true,false,false,null);
// Realize the consumption method
DefaultConsumer defaultConsumer = new DefaultConsumer(channel) {
/**
* When the message is received, this method will be called
* @param consumerTag Consumer labels , Used to identify consumers , Set when listening to the queue channel.basicConsume
* @param envelope The envelope , adopt envelope
* @param properties Message properties
* @param body The message content
* @throws IOException
*/
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
// Switch
String exchange = envelope.getExchange();
// news id,mq stay channel Used to identify messages in id, Can be used to confirm that a message has been received
long deliveryTag = envelope.getDeliveryTag();
// The message content
String message= new String(body,"utf-8");
System.out.println("receive message:"+message);
}
};
// Listening to the queue
// Parameters :String queue, boolean autoAck, Consumer callback
/**
* Parameter details :
* 1、queue Queue name
* 2、autoAck Automatic recovery , When the consumer receives the message, he should tell mq Message received , If this parameter is set to tru It means that you will reply automatically mq, If set to false Reply by programming
* 3、callback, Consumption method , When the consumer receives the message, the method to be executed
*/
channel.basicConsume(QUEUE_NAME,true,defaultConsumer);
}
}

The steps to getting started
 Insert picture description here

Two 、Work queues Working mode

 Insert picture description here
 Insert picture description here

3、 ... and 、Publish / Subscribe Release / A subscription model

 Insert picture description here
Message producer

public class Producer02_publish {
// Queue name
private static final String QUEUE_INFORM_EMAIL = "queue_inform_email";
private static final String QUEUE_INFORM_SMS = "queue_inform_sms";
// Switch name
private static final String EXCHANGE_FANOUT_INFORM="exchange_fanout_inform";
public static void main(String[] args) {
// Create new connections and mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);// port
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/");
Connection connection = null;
Channel channel = null;
try {
// Build new connections
connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
channel = connection.createChannel();
// Declaration queue , If the queue is in mq If not, create
// Parameters :String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<String, Object> arguments
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_INFORM_EMAIL,true,false,false,null);
channel.queueDeclare(QUEUE_INFORM_SMS,true,false,false,null);
// Declare a switch
// Parameters :String exchange, String type
/**
* Parameter details :
* 1、 Name of switch
* 2、 Type of switch
* fanout: Corresponding rabbitmq The working mode of publish/subscribe
* direct: Corresponding Routing Working mode
* topic: Corresponding Topics Working mode
* headers: Corresponding headers Working mode
*/
channel.exchangeDeclare(EXCHANGE_FANOUT_INFORM, BuiltinExchangeType.FANOUT);
// Switch and queue binding
// Parameters :String queue, String exchange, String routingKey
/**
* Parameter details :
* 1、queue Queue name
* 2、exchange Switch name
* 3、routingKey route key, The function of the switch is based on routing key Forward the message to the specified queue , In the publish subscribe mode, the mediation is an empty string
*/
channel.queueBind(QUEUE_INFORM_EMAIL,EXCHANGE_FANOUT_INFORM,"");
channel.queueBind(QUEUE_INFORM_SMS,EXCHANGE_FANOUT_INFORM,"");
// Send a message
// Parameters :String exchange, String routingKey, BasicProperties props, byte[] body
/**
* Parameter details :
* 1、exchange, Switch , If not specified mq The default switch for ( Set to "")
* 2、routingKey, route key, Switch according to route key To forward the message to the specified queue , If you use the default switch ,routingKey Set to the name of the queue
* 3、props, The properties of the message
* 4、body, The message content
*/
for(int i=0;i<5;i++){
// The message content
String message = "send inform message to user";
channel.basicPublish(EXCHANGE_FANOUT_INFORM,"",null,message.getBytes());
System.out.println("send to mq "+message);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
// Close the connection
// Close the channel first
try {
channel.close();
} catch (IOException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
}
try {
connection.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

Message Receiver 1

public class Consumer02_subscribe_email {
// Queue name
private static final String QUEUE_INFORM_EMAIL = "queue_inform_email";
private static final String EXCHANGE_FANOUT_INFORM="exchange_fanout_inform";
public static void main(String[] args) throws IOException, TimeoutException {
// Create new connections and mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);// port
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/");
// Build new connections
Connection connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
Channel channel = connection.createChannel();
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_INFORM_EMAIL,true,false,false,null);
// Declare a switch
// Parameters :String exchange, String type
/**
* Parameter details :
* 1、 Name of switch
* 2、 Type of switch
* fanout: Corresponding rabbitmq The working mode of publish/subscribe
* direct: Corresponding Routing Working mode
* topic: Corresponding Topics Working mode
* headers: Corresponding headers Working mode
*/
channel.exchangeDeclare(EXCHANGE_FANOUT_INFORM, BuiltinExchangeType.FANOUT);
// Switch and queue binding
// Parameters :String queue, String exchange, String routingKey
/**
* Parameter details :
* 1、queue Queue name
* 2、exchange Switch name
* 3、routingKey route key, The function of the switch is based on routing key Forward the message to the specified queue , In the publish subscribe mode, the mediation is an empty string
*/
channel.queueBind(QUEUE_INFORM_EMAIL, EXCHANGE_FANOUT_INFORM, "");
// Realize the consumption method
DefaultConsumer defaultConsumer = new DefaultConsumer(channel){
/**
* When the message is received, this method will be called
* @param consumerTag Consumer labels , Used to identify consumers , Set when listening to the queue channel.basicConsume
* @param envelope The envelope , adopt envelope
* @param properties Message properties
* @param body The message content
* @throws IOException
*/
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
// Switch
String exchange = envelope.getExchange();
// news id,mq stay channel Used to identify messages in id, Can be used to confirm that a message has been received
long deliveryTag = envelope.getDeliveryTag();
// The message content
String message= new String(body,"utf-8");
System.out.println("receive message:"+message);
}
};
// Listening to the queue
// Parameters :String queue, boolean autoAck, Consumer callback
/**
* Parameter details :
* 1、queue Queue name
* 2、autoAck Automatic recovery , When the consumer receives the message, he should tell mq Message received , If this parameter is set to tru It means that you will reply automatically mq, If set to false Reply by programming
* 3、callback, Consumption method , When the consumer receives the message, the method to be executed
*/
channel.basicConsume(QUEUE_INFORM_EMAIL,true,defaultConsumer);
}
}

Message Receiver 2

public class Consumer02_subscribe_sms {
// Queue name
private static final String QUEUE_INFORM_SMS = "queue_inform_sms";
private static final String EXCHANGE_FANOUT_INFORM="exchange_fanout_inform";
public static void main(String[] args) throws IOException, TimeoutException {
// Create new connections and mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);// port
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/");
// Build new connections
Connection connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
Channel channel = connection.createChannel();
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_INFORM_SMS,true,false,false,null);
// Declare a switch
// Parameters :String exchange, String type
/**
* Parameter details :
* 1、 Name of switch
* 2、 Type of switch
* fanout: Corresponding rabbitmq The working mode of publish/subscribe
* direct: Corresponding Routing Working mode
* topic: Corresponding Topics Working mode
* headers: Corresponding headers Working mode
*/
channel.exchangeDeclare(EXCHANGE_FANOUT_INFORM, BuiltinExchangeType.FANOUT);
// Switch and queue binding
// Parameters :String queue, String exchange, String routingKey
/**
* Parameter details :
* 1、queue Queue name
* 2、exchange Switch name
* 3、routingKey route key, The function of the switch is based on routing key Forward the message to the specified queue , In the publish subscribe mode, the mediation is an empty string
*/
channel.queueBind(QUEUE_INFORM_SMS, EXCHANGE_FANOUT_INFORM, "");
// Realize the consumption method
DefaultConsumer defaultConsumer = new DefaultConsumer(channel){
/**
* When the message is received, this method will be called
* @param consumerTag Consumer labels , Used to identify consumers , Set when listening to the queue channel.basicConsume
* @param envelope The envelope , adopt envelope
* @param properties Message properties
* @param body The message content
* @throws IOException
*/
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
// Switch
String exchange = envelope.getExchange();
// news id,mq stay channel Used to identify messages in id, Can be used to confirm that a message has been received
long deliveryTag = envelope.getDeliveryTag();
// The message content
String message= new String(body,"utf-8");
System.out.println("receive message:"+message);
}
};
// Listening to the queue
// Parameters :String queue, boolean autoAck, Consumer callback
/**
* Parameter details :
* 1、queue Queue name
* 2、autoAck Automatic recovery , When the consumer receives the message, he should tell mq Message received , If this parameter is set to tru It means that you will reply automatically mq, If set to false Reply by programming
* 3、callback, Consumption method , When the consumer receives the message, the method to be executed
*/
channel.basicConsume(QUEUE_INFORM_SMS,true,defaultConsumer);
}
}

 Insert picture description here

Four 、Routing Routing mode

 Insert picture description here
Message producer

public class Producer03_routing {
// Queue name
private static final String QUEUE_INFORM_EMAIL = "queue_inform_email";
private static final String QUEUE_INFORM_SMS = "queue_inform_sms";
// Switch name
private static final String EXCHANGE_ROUTING_INFORM="exchange_routing_inform";
// Routing key name
private static final String ROUTINGKEY_EMAIL="inform_email";
private static final String ROUTINGKEY_SMS="inform_sms";
public static void main(String[] args) {
// Create new connections and mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);// port
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/");
Connection connection = null;
Channel channel = null;
try {
// Build new connections
connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
channel = connection.createChannel();
// Declaration queue , If the queue is in mq If not, create
// Parameters :String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<String, Object> arguments
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_INFORM_EMAIL,true,false,false,null);
channel.queueDeclare(QUEUE_INFORM_SMS,true,false,false,null);
// Declare a switch
// Parameters :String exchange, String type
/**
* Parameter details :
* 1、 Name of switch
* 2、 Type of switch
* fanout: Corresponding rabbitmq The working mode of publish/subscribe
* direct: Corresponding Routing Working mode
* topic: Corresponding Topics Working mode
* headers: Corresponding headers Working mode
*/
channel.exchangeDeclare(EXCHANGE_ROUTING_INFORM, BuiltinExchangeType.DIRECT);
// Switch and queue binding
// Parameters :String queue, String exchange, String routingKey
/**
* Parameter details :
* 1、queue Queue name
* 2、exchange Switch name
* 3、routingKey route key, The function of the switch is based on routing key Forward the message to the specified queue , In the publish subscribe mode, the mediation is an empty string
*/
channel.queueBind(QUEUE_INFORM_EMAIL,EXCHANGE_ROUTING_INFORM,ROUTINGKEY_EMAIL);
//channel.queueBind(QUEUE_INFORM_EMAIL,EXCHANGE_ROUTING_INFORM,"inform");
channel.queueBind(QUEUE_INFORM_SMS,EXCHANGE_ROUTING_INFORM,ROUTINGKEY_SMS);
//channel.queueBind(QUEUE_INFORM_SMS,EXCHANGE_ROUTING_INFORM,"inform");
// Send a message
// Parameters :String exchange, String routingKey, BasicProperties props, byte[] body
/**
* Parameter details :
* 1、exchange, Switch , If not specified mq The default switch for ( Set to "")
* 2、routingKey, route key, Switch according to route key To forward the message to the specified queue , If you use the default switch ,routingKey Set to the name of the queue
* 3、props, The properties of the message
* 4、body, The message content
*/
/* for(int i=0;i<5;i++){
// Specify when sending a message routingKey
String message = "send email inform message to user";
channel.basicPublish(EXCHANGE_ROUTING_INFORM,ROUTINGKEY_EMAIL,null,message.getBytes());
System.out.println("send to mq "+message);
}*/
for(int i=0;i<5;i++){
// Specify when sending a message routingKey
String message = "send sms inform message to user";
channel.basicPublish(EXCHANGE_ROUTING_INFORM,ROUTINGKEY_SMS,null,message.getBytes());
System.out.println("send to mq "+message);
}
// At this point, the specified routing key is inform, So both consumers can consume
/*for(int i=0;i<5;i++){
// Specify when sending a message routingKey
String message = "send inform message to user";
channel.basicPublish(EXCHANGE_ROUTING_INFORM,"inform",null,message.getBytes());
System.out.println("send to mq "+message);
}*/
} catch (Exception e) {
e.printStackTrace();
} finally {
// Close the connection
// Close the channel first
try {
channel.close();
} catch (IOException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
}
try {
connection.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

Message Receiver 1

public class Consumer03_routing_email {
// Queue name
private static final String QUEUE_INFORM_EMAIL = "queue_inform_email";
// Switch name
private static final String EXCHANGE_ROUTING_INFORM="exchange_routing_inform";
// Routing key name
private static final String ROUTINGKEY_EMAIL="inform_email";
public static void main(String[] args) throws IOException, TimeoutException {
// Create new connections and mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);// port
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/");
// Build new connections
Connection connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
Channel channel = connection.createChannel();
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_INFORM_EMAIL,true,false,false,null);
// Declare a switch
// Parameters :String exchange, String type
/**
* Parameter details :
* 1、 Name of switch
* 2、 Type of switch
* fanout: Corresponding rabbitmq The working mode of publish/subscribe
* direct: Corresponding Routing Working mode
* topic: Corresponding Topics Working mode
* headers: Corresponding headers Working mode
*/
channel.exchangeDeclare(EXCHANGE_ROUTING_INFORM, BuiltinExchangeType.DIRECT);
// Switch and queue binding
// Parameters :String queue, String exchange, String routingKey
/**
* Parameter details :
* 1、queue Queue name
* 2、exchange Switch name
* 3、routingKey route key, The function of the switch is based on routing key Forward the message to the specified queue , In the publish subscribe mode, the mediation is an empty string
*/
channel.queueBind(QUEUE_INFORM_EMAIL, EXCHANGE_ROUTING_INFORM,ROUTINGKEY_EMAIL);
// Realize the consumption method
DefaultConsumer defaultConsumer = new DefaultConsumer(channel){
/**
* When the message is received, this method will be called
* @param consumerTag Consumer labels , Used to identify consumers , Set when listening to the queue channel.basicConsume
* @param envelope The envelope , adopt envelope
* @param properties Message properties
* @param body The message content
* @throws IOException
*/
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
// Switch
String exchange = envelope.getExchange();
// news id,mq stay channel Used to identify messages in id, Can be used to confirm that a message has been received
long deliveryTag = envelope.getDeliveryTag();
// The message content
String message= new String(body,"utf-8");
System.out.println("receive message:"+message);
}
};
// Listening to the queue
// Parameters :String queue, boolean autoAck, Consumer callback
/**
* Parameter details :
* 1、queue Queue name
* 2、autoAck Automatic recovery , When the consumer receives the message, he should tell mq Message received , If this parameter is set to tru It means that you will reply automatically mq, If set to false Reply by programming
* 3、callback, Consumption method , When the consumer receives the message, the method to be executed
*/
channel.basicConsume(QUEUE_INFORM_EMAIL,true,defaultConsumer);
}
}
http://www.dtmao.cc/news_show_631033.shtml

Message Receiver 2

public class Consumer03_routing_sms {
// Queue name
private static final String QUEUE_INFORM_SMS = "queue_inform_sms";
private static final String EXCHANGE_ROUTING_INFORM="exchange_routing_inform";
private static final String ROUTINGKEY_SMS="inform_sms";
public static void main(String[] args) throws IOException, TimeoutException {
// Create new connections and mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);// port
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/");
// Build new connections
Connection connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
Channel channel = connection.createChannel();
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_INFORM_SMS,true,false,false,null);
// Declare a switch
// Parameters :String exchange, String type
/**
* Parameter details :
* 1、 Name of switch
* 2、 Type of switch
* fanout: Corresponding rabbitmq The working mode of publish/subscribe
* direct: Corresponding Routing Working mode
* topic: Corresponding Topics Working mode
* headers: Corresponding headers Working mode
*/
channel.exchangeDeclare(EXCHANGE_ROUTING_INFORM, BuiltinExchangeType.DIRECT);
// Switch and queue binding
// Parameters :String queue, String exchange, String routingKey
/**
* Parameter details :
* 1、queue Queue name
* 2、exchange Switch name
* 3、routingKey route key, The function of the switch is based on routing key Forward the message to the specified queue , In the publish subscribe mode, the mediation is an empty string
*/
channel.queueBind(QUEUE_INFORM_SMS, EXCHANGE_ROUTING_INFORM,ROUTINGKEY_SMS);
// Realize the consumption method
DefaultConsumer defaultConsumer = new DefaultConsumer(channel){
/**
* When the message is received, this method will be called
* @param consumerTag Consumer labels , Used to identify consumers , Set when listening to the queue channel.basicConsume
* @param envelope The envelope , adopt envelope
* @param properties Message properties
* @param body The message content
* @throws IOException
*/
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
// Switch
String exchange = envelope.getExchange();
// news id,mq stay channel Used to identify messages in id, Can be used to confirm that a message has been received
long deliveryTag = envelope.getDeliveryTag();
// The message content
String message= new String(body,"utf-8");
System.out.println("receive message:"+message);
}
};
// Listening to the queue
// Parameters :String queue, boolean autoAck, Consumer callback
/**
* Parameter details :
* 1、queue Queue name
* 2、autoAck Automatic recovery , When the consumer receives the message, he should tell mq Message received , If this parameter is set to tru It means that you will reply automatically mq, If set to false Reply by programming
* 3、callback, Consumption method , When the consumer receives the message, the method to be executed
*/
channel.basicConsume(QUEUE_INFORM_SMS,true,defaultConsumer);
}
}

 Insert picture description here

5、 ... and 、Topics

 Insert picture description here

public class Producer04_topics {
// Queue name
private static final String QUEUE_INFORM_EMAIL = "queue_inform_email";
private static final String QUEUE_INFORM_SMS = "queue_inform_sms";
// Declaration switch
private static final String EXCHANGE_TOPICS_INFORM="exchange_topics_inform";
// Use wildcards to , Set the routing key
private static final String ROUTINGKEY_EMAIL="inform.#.email.#";
private static final String ROUTINGKEY_SMS="inform.#.sms.#";
public static void main(String[] args) {
// Create new connections and mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);// port
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/");
Connection connection = null;
Channel channel = null;
try {
// Build new connections
connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
channel = connection.createChannel();
// Declaration queue , If the queue is in mq If not, create
// Parameters :String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<String, Object> arguments
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_INFORM_EMAIL,true,false,false,null);
channel.queueDeclare(QUEUE_INFORM_SMS,true,false,false,null);
// Declare a switch
// Parameters :String exchange, String type
/**
* Parameter details :
* 1、 Name of switch
* 2、 Type of switch
* fanout: Corresponding rabbitmq The working mode of publish/subscribe
* direct: Corresponding Routing Working mode
* topic: Corresponding Topics Working mode
* headers: Corresponding headers Working mode
*/
channel.exchangeDeclare(EXCHANGE_TOPICS_INFORM, BuiltinExchangeType.TOPIC);
// Switch and queue binding
// Parameters :String queue, String exchange, String routingKey
/**
* Parameter details :
* 1、queue Queue name
* 2、exchange Switch name
* 3、routingKey route key, The function of the switch is based on routing key Forward the message to the specified queue , In the publish subscribe mode, the mediation is an empty string
*/
channel.queueBind(QUEUE_INFORM_EMAIL,EXCHANGE_TOPICS_INFORM,ROUTINGKEY_EMAIL);
channel.queueBind(QUEUE_INFORM_SMS,EXCHANGE_TOPICS_INFORM,ROUTINGKEY_SMS);
// Send a message
// Parameters :String exchange, String routingKey, BasicProperties props, byte[] body
/**
* Parameter details :
* 1、exchange, Switch , If not specified mq The default switch for ( Set to "")
* 2、routingKey, route key, Switch according to route key To forward the message to the specified queue , If you use the default switch ,routingKey Set to the name of the queue
* 3、props, The properties of the message
* 4、body, The message content
*/
for(int i=0;i<5;i++){
// Specify when sending a message routingKey
String message = "send email inform message to user";
channel.basicPublish(EXCHANGE_TOPICS_INFORM,"inform.email",null,message.getBytes());
System.out.println("send to mq "+message);
}
for(int i=0;i<5;i++){
// Specify when sending a message routingKey
String message = "send sms inform message to user";
channel.basicPublish(EXCHANGE_TOPICS_INFORM,"inform.sms",null,message.getBytes());
System.out.println("send to mq "+message);
}
for(int i=0;i<5;i++){
// Specify when sending a message routingKey
String message = "send sms and email inform message to user";
channel.basicPublish(EXCHANGE_TOPICS_INFORM,"inform.sms.email",null,message.getBytes());
System.out.println("send to mq "+message);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
// Close the connection
// Close the channel first
try {
channel.close();
} catch (IOException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
}
try {
connection.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

Message Receiver 1

public class Consumer04_topics_email {
// Queue name
private static final String QUEUE_INFORM_EMAIL = "queue_inform_email";
private static final String EXCHANGE_TOPICS_INFORM="exchange_topics_inform";
private static final String ROUTINGKEY_EMAIL="inform.#.email.#";
public static void main(String[] args) throws IOException, TimeoutException {
// Create new connections and mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);// port
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/");
// Build new connections
Connection connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
Channel channel = connection.createChannel();
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_INFORM_EMAIL,true,false,false,null);
// Declare a switch
// Parameters :String exchange, String type
/**
* Parameter details :
* 1、 Name of switch
* 2、 Type of switch
* fanout: Corresponding rabbitmq The working mode of publish/subscribe
* direct: Corresponding Routing Working mode
* topic: Corresponding Topics Working mode
* headers: Corresponding headers Working mode
*/
channel.exchangeDeclare(EXCHANGE_TOPICS_INFORM, BuiltinExchangeType.TOPIC);
// Switch and queue binding
// Parameters :String queue, String exchange, String routingKey
/**
* Parameter details :
* 1、queue Queue name
* 2、exchange Switch name
* 3、routingKey route key, The function of the switch is based on routing key Forward the message to the specified queue , In the publish subscribe mode, the mediation is an empty string
*/
channel.queueBind(QUEUE_INFORM_EMAIL, EXCHANGE_TOPICS_INFORM,ROUTINGKEY_EMAIL);
// Realize the consumption method
DefaultConsumer defaultConsumer = new DefaultConsumer(channel){
/**
* When the message is received, this method will be called
* @param consumerTag Consumer labels , Used to identify consumers , Set when listening to the queue channel.basicConsume
* @param envelope The envelope , adopt envelope
* @param properties Message properties
* @param body The message content
* @throws IOException
*/
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
// Switch
String exchange = envelope.getExchange();
// news id,mq stay channel Used to identify messages in id, Can be used to confirm that a message has been received
long deliveryTag = envelope.getDeliveryTag();
// The message content
String message= new String(body,"utf-8");
System.out.println("receive message:"+message);
}
};
// Listening to the queue
// Parameters :String queue, boolean autoAck, Consumer callback
/**
* Parameter details :
* 1、queue Queue name
* 2、autoAck Automatic recovery , When the consumer receives the message, he should tell mq Message received , If this parameter is set to tru It means that you will reply automatically mq, If set to false Reply by programming
* 3、callback, Consumption method , When the consumer receives the message, the method to be executed
*/
channel.basicConsume(QUEUE_INFORM_EMAIL,true,defaultConsumer);
}
}

Lowercase recipients 2

public class Consumer04_topics_sms {
// Queue name
private static final String QUEUE_INFORM_SMS = "queue_inform_sms";
private static final String EXCHANGE_TOPICS_INFORM="exchange_topics_inform";
private static final String ROUTINGKEY_SMS="inform.#.sms.#";
public static void main(String[] args) throws IOException, TimeoutException {
// Create new connections and mq Establishing a connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);// port
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
// Set up virtual machine , One mq Services can set up multiple virtual machines , Each virtual machine is equivalent to an independent mq
connectionFactory.setVirtualHost("/");
// Build new connections
Connection connection = connectionFactory.newConnection();
// Create a session channel , Producers and mq Service all communications are in channel Done in the channel
Channel channel = connection.createChannel();
/**
* Parameter details
* 1、queue Queue name
* 2、durable Persistent or not , If you persist ,mq After the restart, the queue is still
* 3、exclusive Whether the connection is exclusive , The queue is only allowed access in this connection , If connection When the connection is closed, the queue will be deleted automatically , If you set this parameter true Can be used to create temporary queues
* 4、autoDelete Automatically delete , Whether to automatically delete the queue when it is no longer in use , If you add this parameter to exclusive Parameter set to true The temporary queue can be implemented ( The queue is automatically deleted when it is not in use )
* 5、arguments Parameters , You can set the extension parameters of a queue , such as : The survival time can be set
*/
channel.queueDeclare(QUEUE_INFORM_SMS,true,false,false,null);
// Declare a switch
// Parameters :String exchange, String type
/**
* Parameter details :
* 1、 Name of switch
* 2、 Type of switch
* fanout: Corresponding rabbitmq The working mode of publish/subscribe
* direct: Corresponding Routing Working mode
* topic: Corresponding Topics Working mode
* headers: Corresponding headers Working mode
*/
channel.exchangeDeclare(EXCHANGE_TOPICS_INFORM, BuiltinExchangeType.TOPIC);
// Switch and queue binding
// Parameters :String queue, String exchange, String routingKey
/**
* Parameter details :
* 1、queue Queue name
* 2、exchange Switch name
* 3、routingKey route key, The function of the switch is based on routing key Forward the message to the specified queue , In the publish subscribe mode, the mediation is an empty string
*/
channel.queueBind(QUEUE_INFORM_SMS, EXCHANGE_TOPICS_INFORM,ROUTINGKEY_SMS);
// Realize the consumption method
DefaultConsumer defaultConsumer = new DefaultConsumer(channel){
/**
* When the message is received, this method will be called
* @param consumerTag Consumer labels , Used to identify consumers , Set when listening to the queue channel.basicConsume
* @param envelope The envelope , adopt envelope
* @param properties Message properties
* @param body The message content
* @throws IOException
*/
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
// Switch
String exchange = envelope.getExchange();
// news id,mq stay channel Used to identify messages in id, Can be used to confirm that a message has been received
long deliveryTag = envelope.getDeliveryTag();
// The message content
String message= new String(body,"utf-8");
System.out.println("receive message:"+message);
}
};
// Listening to the queue
// Parameters :String queue, boolean autoAck, Consumer callback
/**
* Parameter details :
* 1、queue Queue name
* 2、autoAck Automatic recovery , When the consumer receives the message, he should tell mq Message received , If this parameter is set to tru It means that you will reply automatically mq, If set to false Reply by programming
* 3、callback, Consumption method , When the consumer receives the message, the method to be executed
*/
channel.basicConsume(QUEUE_INFORM_SMS,true,defaultConsumer);
}
}

6、 ... and 、Header

 Insert picture description here

7、 ... and 、RPC

 Insert picture description here

8、 ... and 、Spring Data Elasticsearch

rabbitmq-producer Message sender

@Configuration
public class RabbitMQConfig {
// Declare two queue constants
public static final String QUEUE_INFORM_EMAIL = "queue_inform_email";
public static final String QUEUE_INFORM_SMS = "queue_inform_sms";
// Declare switch constants
public static final String EXCHANGE_TOPICS_INFORM="exchange_topics_inform";
// Declare two routing key constants
public static final String ROUTINGKEY_EMAIL="inform.#.email.#";
public static final String ROUTINGKEY_SMS="inform.#.sms.#";
// Declaration switch
@Bean(EXCHANGE_TOPICS_INFORM)
public Exchange EXCHANGE_TOPICS_INFORM(){
//durable(true) Persistence ,mq After the restart, the switch is still
return ExchangeBuilder.topicExchange(EXCHANGE_TOPICS_INFORM).durable(true).build();
}
// Declaration queue
// Statement QUEUE_INFORM_EMAIL queue
@Bean(QUEUE_INFORM_EMAIL)
public Queue QUEUE_INFORM_EMAIL(){
return new Queue(QUEUE_INFORM_EMAIL);
}
// Statement QUEUE_INFORM_SMS queue
@Bean(QUEUE_INFORM_SMS)
public Queue QUEUE_INFORM_SMS(){
return new Queue(QUEUE_INFORM_SMS);
}
// Bind switches and queues
//ROUTINGKEY_EMAIL Queue bound switches , Appoint routingKey
@Bean
public Binding BINDING_QUEUE_INFORM_EMAIL(@Qualifier(QUEUE_INFORM_EMAIL) Queue queue,
@Qualifier(EXCHANGE_TOPICS_INFORM) Exchange exchange){
return BindingBuilder.bind(queue).to(exchange).with(ROUTINGKEY_EMAIL).noargs();
}
//ROUTINGKEY_SMS Queue bound switches , Appoint routingKey
@Bean
public Binding BINDING_ROUTINGKEY_SMS(@Qualifier(QUEUE_INFORM_SMS) Queue queue,
@Qualifier(EXCHANGE_TOPICS_INFORM) Exchange exchange){
return BindingBuilder.bind(queue).to(exchange).with(ROUTINGKEY_SMS).noargs();
}
}

rabbitmq-consumer Message Receiver

@Configuration
public class RabbitMQConfig {
public static final String QUEUE_INFORM_EMAIL = "queue_inform_email";
public static final String QUEUE_INFORM_SMS = "queue_inform_sms";
public static final String EXCHANGE_TOPICS_INFORM="exchange_topics_inform";
public static final String ROUTINGKEY_EMAIL="inform.#.email.#";
public static final String ROUTINGKEY_SMS="inform.#.sms.#";
// Declaration switch
@Bean(EXCHANGE_TOPICS_INFORM)
public Exchange EXCHANGE_TOPICS_INFORM(){
//durable(true) Persistence ,mq After the restart, the switch is still
return ExchangeBuilder.topicExchange(EXCHANGE_TOPICS_INFORM).durable(true).build();
}
// Declaration queue
// Statement QUEUE_INFORM_EMAIL queue
@Bean(QUEUE_INFORM_EMAIL)
public Queue QUEUE_INFORM_EMAIL(){
return new Queue(QUEUE_INFORM_EMAIL);
}
// Statement QUEUE_INFORM_SMS queue
@Bean(QUEUE_INFORM_SMS)
public Queue QUEUE_INFORM_SMS(){
return new Queue(QUEUE_INFORM_SMS);
}
// Bind switches and queues
//ROUTINGKEY_EMAIL Queue bound switches , Appoint routingKey
@Bean
public Binding BINDING_QUEUE_INFORM_EMAIL(@Qualifier(QUEUE_INFORM_EMAIL) Queue queue,
@Qualifier(EXCHANGE_TOPICS_INFORM) Exchange exchange){
return BindingBuilder.bind(queue).to(exchange).with(ROUTINGKEY_EMAIL).noargs();
}
//ROUTINGKEY_SMS Queue bound switches , Appoint routingKey
@Bean
public Binding BINDING_ROUTINGKEY_SMS(@Qualifier(QUEUE_INFORM_SMS) Queue queue,
@Qualifier(EXCHANGE_TOPICS_INFORM) Exchange exchange){
return BindingBuilder.bind(queue).to(exchange).with(ROUTINGKEY_SMS).noargs();
}
}
@SpringBootApplication
@EnableRabbit
public class TestRabbitMQApplication {
public static void main(String[] args) {
SpringApplication.run(TestRabbitMQApplication.class, args);
}
}

Listen message queue

@Component
public class ReceiveHandler {
@RabbitListener(queues = {RabbitMQConfig.QUEUE_INFORM_EMAIL})
public void receiveMsg(String msg) {
System.out.println(" The message received was = " + msg);
}
}

stay rabbitmq-provider Medium test

@SpringBootTest
@RunWith(SpringRunner.class)
public class Producer05_topics_springboot {
// Use rabbitTemplate Send a message
@Autowired
private RabbitTemplate rabbitTemplate;
@Test
public void testSendEmail() {
String message = "send email message to user";
/**
* arg1: Switch name
* arg2: Routing key
* arg3: The message content
*/
rabbitTemplate.convertAndSend(RabbitMQConfig.EXCHANGE_TOPICS_INFORM, "inform.email", message);
}
}
版权声明
本文为[What years and things]所创,转载请带上原文链接,感谢
https://javamana.com/2021/01/20210123094202539m.html

  1. 【计算机网络 12(1),尚学堂马士兵Java视频教程
  2. 【程序猿历程,史上最全的Java面试题集锦在这里
  3. 【程序猿历程(1),Javaweb视频教程百度云
  4. Notes on MySQL 45 lectures (1-7)
  5. [computer network 12 (1), Shang Xuetang Ma soldier java video tutorial
  6. The most complete collection of Java interview questions in history is here
  7. [process of program ape (1), JavaWeb video tutorial, baidu cloud
  8. Notes on MySQL 45 lectures (1-7)
  9. 精进 Spring Boot 03:Spring Boot 的配置文件和配置管理,以及用三种方式读取配置文件
  10. Refined spring boot 03: spring boot configuration files and configuration management, and reading configuration files in three ways
  11. 精进 Spring Boot 03:Spring Boot 的配置文件和配置管理,以及用三种方式读取配置文件
  12. Refined spring boot 03: spring boot configuration files and configuration management, and reading configuration files in three ways
  13. 【递归,Java传智播客笔记
  14. [recursion, Java intelligence podcast notes
  15. [adhere to painting for 386 days] the beginning of spring of 24 solar terms
  16. K8S系列第八篇(Service、EndPoints以及高可用kubeadm部署)
  17. K8s Series Part 8 (service, endpoints and high availability kubeadm deployment)
  18. 【重识 HTML (3),350道Java面试真题分享
  19. 【重识 HTML (2),Java并发编程必会的多线程你竟然还不会
  20. 【重识 HTML (1),二本Java小菜鸟4面字节跳动被秒成渣渣
  21. [re recognize HTML (3) and share 350 real Java interview questions
  22. [re recognize HTML (2). Multithreading is a must for Java Concurrent Programming. How dare you not
  23. [re recognize HTML (1), two Java rookies' 4-sided bytes beat and become slag in seconds
  24. 造轮子系列之RPC 1:如何从零开始开发RPC框架
  25. RPC 1: how to develop RPC framework from scratch
  26. 造轮子系列之RPC 1:如何从零开始开发RPC框架
  27. RPC 1: how to develop RPC framework from scratch
  28. 一次性捋清楚吧,对乱糟糟的,Spring事务扩展机制
  29. 一文彻底弄懂如何选择抽象类还是接口,连续四年百度Java岗必问面试题
  30. Redis常用命令
  31. 一双拖鞋引发的血案,狂神说Java系列笔记
  32. 一、mysql基础安装
  33. 一位程序员的独白:尽管我一生坎坷,Java框架面试基础
  34. Clear it all at once. For the messy, spring transaction extension mechanism
  35. A thorough understanding of how to choose abstract classes or interfaces, baidu Java post must ask interview questions for four consecutive years
  36. Redis common commands
  37. A pair of slippers triggered the murder, crazy God said java series notes
  38. 1、 MySQL basic installation
  39. Monologue of a programmer: despite my ups and downs in my life, Java framework is the foundation of interview
  40. 【大厂面试】三面三问Spring循环依赖,请一定要把这篇看完(建议收藏)
  41. 一线互联网企业中,springboot入门项目
  42. 一篇文带你入门SSM框架Spring开发,帮你快速拿Offer
  43. 【面试资料】Java全集、微服务、大数据、数据结构与算法、机器学习知识最全总结,283页pdf
  44. 【leetcode刷题】24.数组中重复的数字——Java版
  45. 【leetcode刷题】23.对称二叉树——Java版
  46. 【leetcode刷题】22.二叉树的中序遍历——Java版
  47. 【leetcode刷题】21.三数之和——Java版
  48. 【leetcode刷题】20.最长回文子串——Java版
  49. 【leetcode刷题】19.回文链表——Java版
  50. 【leetcode刷题】18.反转链表——Java版
  51. 【leetcode刷题】17.相交链表——Java&python版
  52. 【leetcode刷题】16.环形链表——Java版
  53. 【leetcode刷题】15.汉明距离——Java版
  54. 【leetcode刷题】14.找到所有数组中消失的数字——Java版
  55. 【leetcode刷题】13.比特位计数——Java版
  56. oracle控制用户权限命令
  57. 三年Java开发,继阿里,鲁班二期Java架构师
  58. Oracle必须要启动的服务
  59. 万字长文!深入剖析HashMap,Java基础笔试题大全带答案
  60. 一问Kafka就心慌?我却凭着这份,图灵学院vip课程百度云