On Fri, Oct 28, 2011 at 11:57 AM, ajay.karthik.nn
<[email protected]> wrote:
> 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);
> }
>

You send non persistent messages which is much faster than persistent.

persistent mode is default in JMS and Camel.
You would need to set deliveryPersistent=false in JMS endpoint in
Camel to use non-persistent as well.

> --
> 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.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to