In ActiveMQ website, it does show the steps of consuming message from ActiveMQ via WGET.
wget --post-file=message.txt http://localhost:8161/demo/message/MyQueue?type=queue
body=the test message you would like to submit.
// shall I write some keywords here to boost search engine ranking?
In ActiveMQ website, it does show the steps of consuming message from ActiveMQ via WGET.
wget --post-file=message.txt http://localhost:8161/demo/message/MyQueue?type=queue
body=the test message you would like to submit.
Apche ActiveMQ is a popular open source JMS Message Broker. As in version 5.0, it support failover transport, and async send. But not both at the same time.
Both connection string below will NOT work:
failover:(tcp://remotehost:61616,tcp://localhost:61616)?jms.useAsyncSend=true
failover:(tcp://remotehost:61616?jms.useAsyncSend=true,tcp://localhost:61616?jms.useAsyncSend=true)
So the dirty trick I use is to write my own ContextFactory that override 'org.apache.activemq.jndi.ActiveMQInitialContextFactory'
package org.apache.activemq.jndi;
import java.net.URISyntaxException;
import java.util.Hashtable;
import org.apache.activemq.ActiveMQConnectionFactory;
public class ActiveMQOptimisedSendInitialContextFactory extends ActiveMQInitialContextFactory{
@Override
protected ActiveMQConnectionFactory createConnectionFactory(
Hashtable environment
) throws URISyntaxException {
ActiveMQConnectionFactory connFactory = super.createConnectionFactory(environment);
connFactory.setUseAsyncSend(true);
return connFactory;
}
@Override
protected ActiveMQConnectionFactory createConnectionFactory(
String name,
Hashtable environment
) throws URISyntaxException {
ActiveMQConnectionFactory connFactory = super.createConnectionFactory(name, environment);
connFactory.setUseAsyncSend(true);
return connFactory;
}
}