Oh, and this is the java for creating connection
url =
failover:(tcp://mq:61616?wireFormat.cacheEnabled=false&wireFormat.tightEncodingEnabled=false&wireFormat.maxInactivityDuration=0&keepAlive=true)?maxReconnectAttempts=100
factory = new ActiveMQConnectionFactory(getProperties.getMQURL());
factory.setDispatchAsync(false);
factory.setUseAsyncSend(true);
factory.setOptimizeAcknowledge(true);//if true this sends acks in
batches (50% of the pre fetch size)
factory.setWatchTopicAdvisories(false);
factory.setCopyMessageOnSend(false);
ActiveMQPrefetchPolicy pfp = new ActiveMQPrefetchPolicy();
pfp.setAll(5000);
factory.setPrefetchPolicy(pfp);
factory.setAlwaysSessionAsync(true);
factory.setProducerWindowSize(1024*1024);
connection = (ActiveMQConnection) factory.createConnection();
connection.start();
Session
new ActiveMQQueueSession((ActiveMQSession) connection.createSession(false,
Session.AUTO_ACKNOWLEDGE));
or
connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
--
View this message in context:
http://old.nabble.com/Slow-sending-of-messages-tp26849964p26891119.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.