For this test I used text messages with two Long properties, two String properties and one text message, all of them with "normal" sizes. The text message is 80 characters long, while the String properties have 12 characters. I'm using the following activemq configuration:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//ACTIVEMQ//DTD//EN" "http://activemq.org/dtd/activemq.dtd">
<beans>
<!-- ==================================================================== -->
<!-- ActiveMQ Broker Configuration -->
<!-- ==================================================================== -->
<broker>
<connector>
<tcpServerTransport uri="tcp://localhost:61616" backlog="1000" useAsyncSend="false" maxOutstandingMessages="50"/>
</connector>
<persistence>
<cachePersistence>
<journalPersistence directory="../var/journal">
<jdbcPersistence dataSourceRef="derby-ds"/>
</journalPersistence>
</cachePersistence>
</persistence>
<redeliveryPolicy maximumRetryCount="416" backOffMode="true" backOffIncreaseRate="1" initialRedeliveryTimeout="1000"/>
</broker>
<!-- ==================================================================== -->
<!-- JDBC DataSource Configurations -->
<!-- ==================================================================== -->
<!-- The Derby Datasource that will be used by the Broker -->
<bean id="derby-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>org.apache.derby.jdbc.EmbeddedDriver</value>
</property>
<property name="url">
<!-- Use a URL like 'jdbc:hsqldb:hsql://localhost:9001' if you want to connect to a remote hsqldb -->
<value>jdbc:derby:derbydb;create=true</value>
</property>
<property name="username">
<value></value>
</property>
<property name="password">
<value></value>
</property>
<property name="poolPreparedStatements">
<value>true</value>
</property>
</bean>
</beans>
where activemq runs in its own jvm. After I produced about 1000 messages with a producer, I shut it down and then start a consumer jvm. Unfortunately it can only consume about 40 msg/second while I'd like to get about 400/s. The consumer is configured like this:
<?xml version="1.0" encoding="UTF-8"?>
<!-- START SNIPPET: spring -->
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- START SNIPPET: jca -->
<bean id="jencks" class="org.jencks.JCAContainer">
<!-- lets use the default configuration of work manager and transaction manager-->
<property name="bootstrapContext">
<bean class="org.jencks.factory.BootstrapContextFactoryBean">
<property name="threadPoolSize" value="25"/>
</bean>
</property>
<!-- the JCA Resource Adapter -->
<property name="resourceAdapter">
<bean id="activeMQResourceAdapter" class="org.activemq.ra.ActiveMQResourceAdapter">
<property name="serverUrl" value="reliable:tcp://localhost:61616?asyncSend=false©MessageOnSend=false&disableTimeStampsByDefault=true&doMessageCompression=false&doMessageFragmentation=false&prepareMessageBodyOnSend=false&cachingEnabled=false"/>
</bean>
</property>
</bean>
<!-- END SNIPPET: jca -->
<!--
an inbound message connector using a stateless, thread safe MessageListener
-->
<!-- START SNIPPET: inbound -->
<bean id="inboundConnectorA" class="org.jencks.JCAConnector"> |
<property name="jcaContainer" ref="jencks" />
<!-- subscription details -->
<property name="activationSpec">
<bean class="org.activemq.ra.ActiveMQActivationSpec">
<property name="destination" value="InboundQueue"/>
<property name="destinationType" value="javax.jms.Queue"/>
</bean>
</property>
<property name="ref" value="echoBean"/>
</bean>
<bean id="echoBean" class="com.foo.bar.Mdp" singleton="true"/>
<!-- END SNIPPET: inbound -->
</beans>
Mdp only reads the properties and nothing more. I tried varying threadPoolSize from 25 to 250 to no avail. I think 40 msg/second is too slow in this configuration.