camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Speed of Messages with WebSphereMQ
Date Mon, 22 Dec 2008 09:29:23 GMT
2008/12/19 lreju1 <lreju1@gmail.com>:
>
> I am using camel 1.5 with WebSphereMQ 6. I configued a connectionFactory:
>
> <bean id="qcf" class="org.springframework.jndi.JndiObjectFactoryBean">
>
>                          <property name="jndiTemplate">
>                            <ref bean="jndiTemplate" />
>                          </property>
>                          <property name="jndiName">
>                            <value>ehr_qcf</value>
>                          </property>
>
>    </bean>
>
>    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>    <property name="environment">
>      <props>
>        <prop key="java.naming.factory.initial">
>            com.sun.jndi.fscontext.RefFSContextFactory
>        </prop>
>        <prop key="java.naming.provider.url">
>            file:/c:/usr/local/JNDI-Directory
>        </prop>
>      </props>
>    </property>
>  </bean>
>
> Then set up my camel to receive messages this way:
>
> ConnectionFactory connectionFactory = (ConnectionFactory)ctx.getBean("qcf")
>        context.addComponent("jms",
> JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
>
>        context.addRoutes(new RouteBuilder() {
>
>            public void configure() {
>                from("jms:queue:queue_receiver").process(new Processor() {
>                    public void process(Exchange e) {
>                        log.info("Message Picked up: " + e.getIn());
>                    }
>                });
>            }
>        });
>         context.start();
>
> It takes like 45 seconds to receive a response....Anybody experiencing
> similar response time?

Things are certainly snappy when using ActiveMQ. I wonder if it'll
help if you add caching to avoid creating a
connection/session/producer/consumer for each message you send or
receive? e.g. wrap your MQ ConnectionFactory in a Spring
SingleConnectionFactory?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Mime
View raw message