List of usage examples for com.rabbitmq.client ConnectionFactory setRequestedHeartbeat
public void setRequestedHeartbeat(int requestedHeartbeat)
From source file:zebrogamq.gamelogic.ChannelsManager.java
License:Open Source License
private ConnectionFactory getConnectionFactory(final GameLogicState state) { ConnectionFactory factory = new ConnectionFactory(); factory.setHost(Util.getRabbitMQProperties().getProperty("gameLogicBrokerHost")); factory.setUsername(state.login);/*www . j av a2 s.co m*/ factory.setPassword(state.password); factory.setVirtualHost(state.virtualHost); factory.setPort(Integer.valueOf(Util.getRabbitMQProperties().getProperty("gameLogicBrokerPort", String.valueOf(factory.getPort())))); factory.setConnectionTimeout(CONNECTION_ESTABLISHMENT_TIMEOUT); // set the heartbeat value for the amqp connections // to avoid the keeping of obsolete consumers factory.setRequestedHeartbeat(Integer.valueOf(Util.getRabbitMQProperties() .getProperty("amqpConnectionHeartbeat", String.valueOf(factory.getRequestedHeartbeat())))); return factory; }