activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edots <edall...@gmail.com>
Subject Queue Message Persistence
Date Sun, 23 Mar 2008 10:48:07 GMT

I'm still a newbie with activemq and I have been having problem with message
persistence. What I'm trying to do is to have three queues with each queue
being read by a single unique user. I'm trying to use journals and database
(MS SQL) for message persistence. I'm running now two clients one uses php /
stomp to read messages and one use jms to produce messages. Whenever I
create a message by the java client the message is saved in the database
only when it's read by the php client. So if I create 5 messages while the
php client is down, and then I run the php client the 5 message are saved to
the database. However if activemq dies before I read the 5 messages all
messages are lost and to saved to the journal or the database. Can someone
direct me to what I'm doing wrong? 

here is part of my config file:

  <broker xmlns="http://activemq.org/config/1.0" brokerName="localhost"
persistent="true" useJmx="true">
  
    <!-- Destination specific policies using destination names or wildcards
-->
    <destinationPolicy>
      <policyMap>
        <policyEntries>

          <policyEntry queue="FOREX.>" producerFlowControl="false"
memoryLimit="1mb">
            <dispatchPolicy>
              <strictOrderDispatchPolicy/>
            </dispatchPolicy>
            <subscriptionRecoveryPolicy>
              <lastImageSubscriptionRecoveryPolicy/>
            </subscriptionRecoveryPolicy>
          </policyEntry>

        </policyEntries>
      </policyMap>
    </destinationPolicy>


    <!-- The transport connectors ActiveMQ will listen to -->
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
       <transportConnector name="ssl"     uri="ssl://localhost:61617"/>
       <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
       <transportConnector name="xmpp"    uri="xmpp://localhost:61222"/>
    </transportConnectors>

    <!-- The store and forward broker networks ActiveMQ will listen to -->
    <networkConnectors>
      <!-- by default just auto discover the other brokers -->
      <networkConnector name="default-nc" uri="multicast://default"/>
      <!--
      <networkConnector name="host1 and host2"
uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
      -->
    </networkConnectors>


    <!-- Use the following if you wish to configure the journal with JDBC
-->

    <!-- Or if you want to use pure JDBC without a journal -->
    <!--
    <persistenceAdapter>
        <jdbcPersistenceAdapter dataSource="#postgres-ds"/>
    </persistenceAdapter>
    -->
   
    <!--  Use the following to set the broker memory limit
	<systemUsage>
	            <systemUsage>
		            <memoryUsage>
	    	            	<memoryUsage limit="10 mb" percentUsageMinDelta="20"/>
		            </memoryUsage>
		            <tempUsage>
	    	            	<tempUsage limit="100 mb"/>
		            </tempUsage>
		            <storeUsage>
	    	            	<storeUsage limit="1 gb" name="foo"/>
		            </storeUsage>
	            </systemUsage>
	    </systemUsage>
   -->
    
    <!-- Use the following to configure how ActiveMQ is exposed in JMX -->
    <managementContext>
       <managementContext connectorPort="1099"
jmxDomainName="org.apache.activemq"/>
    </managementContext>

    <plugins>
      <simpleAuthenticationPlugin>
	<users>
		<authenticationUser username="forex" password="forex"
			groups="forexusers"/>
		<authenticationUser username="equity" password="equity"
			groups="equityusers"/>
	</users>
      </simpleAuthenticationPlugin>
	<authorizationPlugin>
        <map>
          <authorizationMap>
            <authorizationEntries>
              <authorizationEntry queue="FOREX.>" read="forexusers"
write="forexusers, equityusers" admin="forexusers" />
              <authorizationEntry queue="EQUITY.>" read="equityusers"
write="forexusers, equityusers" admin="equityusers" />
              <authorizationEntry topic=">" read="forexusers,equityusers"
write="forexusers, equityusers" admin="forexusers,equityusers" />
            </authorizationEntries>            
            <tempDestinationAuthorizationEntry>  
              <tempDestinationAuthorizationEntry read="forexusers"
write="forexusers" admin="forexusers"/>
           </tempDestinationAuthorizationEntry>          
	  </authorizationMap>
        </map>
      </authorizationPlugin>
    </plugins>


    <persistenceAdapter>
        <journaledJDBC journalLogFiles="5" dataDirectory="../data" 
dataSource="#mssql-ds" useDatabaseLock="false" />
    </persistenceAdapter>

  </broker>

  <bean id="mssql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
    <property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
    <property name="url"
value="jdbc:sqlserver://172.25.1.14:1433;databaseName=activemq;user=onlinetrader;password=shihab12"/>
    <property name="username" value="onlinetrader"/>
    <property name="password" value="shihab12"/>
  </bean>
-- 
View this message in context: http://www.nabble.com/Queue-Message-Persistence-tp16234078s2354p16234078.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message