原先的配置
<!-- 真正可以产生Connection的ConnectionFactory,由对应的 JMS服务厂商提供--> <bean id="targetConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL" value="${jms.brokerURL}"/> </bean> <bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"> <property name="connectionFactory" ref="targetConnectionFactory"/> <property name="maxConnections" value="${jms.maxConnections}"/> </bean> <bean id="connectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory"> <property name="targetConnectionFactory" ref="pooledConnectionFactory"/> </bean>
测试插入一万条数据,耗时290秒,然后测试添加和删除持久化配置,添加和删除事物都没有多大影响
后面修改连接为
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL" value="tcp://10.100.21.201:61616?jms.useAsyncSend=true" /> </bean>
测试插入一万条数据,耗时1.4秒,
本地测试,上传到linux环境测试都是快了200倍,,,,
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/industrynews/13689.html