Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, "tcp://10.58.116.18:61616?daemon=true");
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
InitialContext ic = new InitialContext(env);
QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) ic
                                .lookup("ConnectionFactory");
QueueConnection connection = queueConnectionFactory.createQueueConnection();
session = connection.createQueueSession(false,
QueueSession.AUTO_ACKNOWLEDGE);
queue = session.createQueue("example.A");
connection.start();
QueueSender sender = session.createSender(queue);
for(int i=0;i<50000,i++){
        ObjectMessage objMessage = (ObjectMessage)session.createObjectMessage();
        objMessage.setObject(obj);
        sender.send(objMessage, DeliveryMode.NON_PERSISTENT, 4, 0);
}

--
View this message in context: 
http://camel.465427.n5.nabble.com/Rate-of-messages-sent-to-JMS-tp4935053p4945508.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to