一 代码
package com.rabbitmq.ttl;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.MessageProperties;
import com.rabbitmq.util.ConnectionUtils;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeoutException;
/**
* 队列过期
*/
public class QueueTTL {
private static final String EXCHANGE_NAME = "exchange_demo";
private static final String ROUTING_KEY = "routingkey_demo";
private static final String QUEUE_NAME = "QueueTTL_demo";
private static final String IP_ADDRESS = "127.0.0.1";
private static final int PORT = 5672;//RabbitMQ(AMQP) 服务端默认端口号为 5672
public static void main(String[] args) throws IOException,
TimeoutException, InterruptedException {
ConnectionFac