Spring集成jdbc消息存储性能

时间:2013-04-24 09:30:00

标签: performance jdbc store spring-integration aggregator

我使用SimpleMessageStore(内存)作为聚合器的默认存储,但是我需要 持久存储,我开始使用Mysql 5.5备份的jdbc解决方案

但是我真的很关心它的性能,因为使用PerfTest(databene的contiperf),内存存储实现了高达6000条消息/秒,而使用mysql(或redis或mongo),我无法实现15-20条消息/秒

   <int:aggregator      id="XDRAggegator"
                        input-channel="mqChannel"
                        output-channel="publishChannel"
                        message-store="jdbc-messageStore"
   ....

    <bean id="reaper" class="org.springframework.integration.store.MessageGroupStoreReaper">
        <property name="messageGroupStore" ref="jdbc-messageStore"/>
        <property name="timeout"           value="${msg.timeout}"/>
   </bean>

<task:scheduler id="taskScheduler"/>

<task:scheduled-tasks scheduler="taskScheduler">    
    <task:scheduled ref="reaper" method="run" fixed-rate="${reaper.rate}"/>
</task:scheduled-tasks>


<task:executor id="taskExecutor" pool-size="1"/>
<task:annotation-driven executor="taskExecutor" scheduler="taskScheduler"/>

  <int-jdbc:message-store id="jdbc-messageStore" data-source="dataSource"  />

  <bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource" >
       <property name="driverClass" value="com.mysql.jdbc.Driver" />
       <property name="jdbcUrl" value="jdbc:mysql://${database.host}:3306/XDR?autoReconnect=true&amp;cachePrepStmts=true&amp;prepStmtCacheSize=50" />
       <property name="username" value="${database.username}"/>
       <property name="password" value="${database.password}"/>
       <property name="idleConnectionTestPeriodInMinutes" value="1"/>
       <property name="idleMaxAgeInMinutes" value="2"/>    
       <property name="connectionTimeoutInMs"   value="1000" />             
       <property name="maxConnectionsPerPartition" value="10"/>
       <property name="minConnectionsPerPartition" value="4"/>
       <property name="partitionCount" value="4"/>
       <property name="acquireIncrement" value="2"/>                              
       <property name="statementsCacheSize" value="10"/>
       <property name="closeConnectionWatch" value="false"/>
 </bean>

我错过了什么吗? 我正在使用spring-integration-jdbc库中的默认模式。

0 个答案:

没有答案