rabbitmq重启一个新的端口

RABBITMQ_NODE_PORT=8932 RABBITMQ_NODENAME=rabpay ./rabbitmq-server -detached


Heartbeat Timeout Interval

The heartbeat timeout value defines after what period of time the peer TCP connection should be considered dead by RabbitMQ and client libraries. This value is negotiated between the client and RabbitMQ server at the time of connection. The client must be configured to request heartbeats. In RabbitMQ versions 3.0 and higher, the broker will attempt to negotiate heartbeats by default (although the client can still veto them). The timeout is in seconds, and default value is 60 (580 prior to release 3.5.5).

Heartbeat frames are sent about every timeout / 2 seconds. After two missed heartbeats, the peer is considered to be unreachable. Different clients manifest this differently but the TCP connection will be closed. When a client detects that RabbitMQ node is unreachable due to a heartbeat, it needs to re-connect.

Heartbeats can be disabled by setting the timeout interval to 0.

Enabling Heartbeats with Java Client

To configure the heartbeat timeout in the Java client, set it withConnectionFactory#setRequestedHeartbeat before creating a connection:

ConnectionFactory cf = new ConnectionFactory();

// set the heartbeat timeout to 60 seconds
cf.setRequestedHeartbeat(60);

Enabling Heartbeats with the .NET Client

To configure the heartbeat timeout in the .NET client, set it with ConnectionFactory.RequestedHeartbeatbefore creating a connection:

var cf = new ConnectionFactory();

// set the heartbeat timeout to 60 seconds
cf.RequestedHeartbeat = 60;

Heartbeats in STOMP

STOMP 1.2 includes heartbeats. In STOMP, heartbeat timeouts can be assymetrical: that is to say, client and server can use different values. RabbitMQ STOMP plugin fully supports this feature.

Heartbeats in STOMP are opt-in. To enable them, use the heart-beat header when connecting. See STOMP specification for an example.


5. 配置 rabbitmq 
cd rabbitmq/sbin 
rabbitmq-server文件中有三个参数修改为本用户可见目录 
#Eralng控制文件 
CONFIG_FILE= 
#日志文件 
LOG_BASE= 
#数据库文件 
MNESIA_BASE= 

6.启动RabbitMQ 
cd rabbitmq/sbin 
./rabbitmq-server start 
或设置后台运行 nohup ./rabbitmq-server start > nohup.out& 

你可能感兴趣的:(rabbitmq)