Skip to content

Instantly share code, notes, and snippets.

@minostro
Created January 28, 2014 17:45
Show Gist options
  • Save minostro/8672498 to your computer and use it in GitHub Desktop.
Save minostro/8672498 to your computer and use it in GitHub Desktop.
private HornetQJMSConnectionFactory getConnectionFactory() {
Map<String, Object> transportParams = new HashMap<String, Object>(5);
transportParams.put("host", "10.6.81.225");
transportParams.put("port", 10255);
transportParams.put("use-nio", "true");
TransportConfiguration tc = new TransportConfiguration("org.hornetq.core.remoting.impl.netty.NettyConnectorFactory", transportParams);
HornetQJMSConnectionFactory connectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(tc);
connectionFactory.setReconnectAttempts(-1);
connectionFactory.setRetryInterval(1000);
connectionFactory.setConnectionTTL(120000);
connectionFactory.setClientFailureCheckPeriod(2000);
connectionFactory.setCallTimeout(60000);
connectionFactory.setConsumerWindowSize(4194304);
connectionFactory.setInitialConnectAttempts(-1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment