activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kalv <k...@kalv.co.uk>
Subject MySql Persistence Problem
Date Thu, 04 May 2006 08:58:25 GMT

Hi all, I'm new to Activemq and i am having quite a few problems, but this is
the main one at the moment that i am trying to fix.

I have both RC2 and the latest Incubator release. Consumption of a queue
works fine when using the default derby and def journal settings. I change
the settings to use a mysql backend. It works fine when producing and
consuming some messages. I then stop the consumer let the queue grow. Then
stop activemq, Start it up again expecting the queue to be still there which
it is but i try to consume it i get an exception:

java.io.EOFException
        at java.io.DataInputStream.readFully(DataInputStream.java:178)
        at java.io.DataInputStream.readFully(DataInputStream.java:152)
        at
org.apache.activemq.openwire.v1.BaseDataStreamMarshaller.looseUnmarshalByteSequence(BaseDataStreamMarshaller.java:599)
        at
org.apache.activemq.openwire.v1.MessageMarshaller.looseUnmarshal(MessageMarshaller.java:204)
        at
org.apache.activemq.openwire.v1.ActiveMQMessageMarshaller.looseUnmarshal(ActiveMQMessageMarshaller.java:100)
        at
org.apache.activemq.openwire.v1.ActiveMQTextMessageMarshaller.looseUnmarshal(ActiveMQTextMessageMarshaller.java:100)
        at
org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:348)
        at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:210)
        at
org.apache.activemq.store.jdbc.JDBCMessageStore$1.recoverMessage(JDBCMessageStore.java:155)
        at
org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doRecover(DefaultJDBCAdapter.java:338)
        at
org.apache.activemq.store.jdbc.JDBCMessageStore.recover(JDBCMessageStore.java:153)
        at
org.apache.activemq.store.journal.JournalMessageStore.recover(JournalMessageStore.java:342)
        at org.apache.activemq.broker.region.Queue.<init>(Queue.java:97)
        at
org.apache.activemq.broker.region.QueueRegion.createDestination(QueueRegion.java:58)
        at
org.apache.activemq.broker.jmx.ManagedQueueRegion.createDestination(ManagedQueueRegion.java:56)
        at
org.apache.activemq.broker.region.AbstractRegion.addDestination(AbstractRegion.java:77)
        at
org.apache.activemq.broker.region.RegionBroker.addDestination(RegionBroker.java:217)
        at
org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:129)
        at
org.apache.activemq.advisory.AdvisoryBroker.addDestination(AdvisoryBroker.java:141)
        at
org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:129)
        at
org.apache.activemq.broker.MutableBrokerFilter.addDestination(MutableBrokerFilter.java:142)
        at
org.apache.activemq.broker.region.AbstractRegion.addConsumer(AbstractRegion.java:161)
        at
org.apache.activemq.broker.region.RegionBroker.addConsumer(RegionBroker.java:293)
        at
org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:73)
        at
org.apache.activemq.advisory.AdvisoryBroker.addConsumer(AdvisoryBroker.java:77)
        at
org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:73)
        at
org.apache.activemq.broker.MutableBrokerFilter.addConsumer(MutableBrokerFilter.java:86)
        at
org.apache.activemq.broker.AbstractConnection.processAddConsumer(AbstractConnection.java:428)
        at
org.apache.activemq.command.ConsumerInfo.visit(ConsumerInfo.java:295)
        at
org.apache.activemq.broker.AbstractConnection.service(AbstractConnection.java:202)
        at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:62)
        at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:97)
        at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
        at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:114)
        at
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
        at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:87)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:143)
        at java.lang.Thread.run(Thread.java:595)

I am using JENCKS/Spring to consume the Queue, Here is the activemq.conf

<!-- START SNIPPET: xbean -->
<beans xmlns="http://activemq.org/config/1.0">

  <broker useJmx="true">

        <!-- In ActiveMQ 4, you can setup destination policies -->

    <persistenceAdapter>
        <journaledJDBC journalLogFiles="20"
dataDirectory="/opt/activemq-data" dataSource="#mysql-ds"/>
        <!-- <memoryPersistenceAdapter/> -->
        <!-- <jdbcPersistenceAdapter dataSource="#mysql-ds"/> -->
        <!-- <jdbcPersistenceAdapter
adapterClass="org.apache.activemq.store.jdbc.store.adapter.BlobJDBCAdapter"/>
-->
      <!-- To use a different datasource, use th following syntax : -->

      <!-- <journaledJDBC journalLogFiles="10"
dataDirectory="/opt/activemq-data" dataSource="#mysql-ds"/> -->
    </persistenceAdapter>

    <transportConnectors>
       <transportConnector name="default" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
       <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
    </transportConnectors>

    <networkConnectors>
      <!-- by default just auto discover the other brokers -->
      <networkConnector name="default" uri="multicast://default"/>
    </networkConnectors>

  </broker>

  <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url"
value="jdbc:mysql://10.10.32.191/activemq?relaxAutoCommit=true"/>
    <property name="username" value="sequoia"/>
    <property name="password" value="w1ck3d"/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>
</beans>

Other information :
Mysql 4.1.11-debian sarge release
tried latest mysql-5 jdbc connector as well latest 3.1

Looking at the database a query is ran just before the exception:
SELECT ID, MSG FROM ACTIVEMQ_MSGS WHERE CONTAINER=? ORDER BY ID
--
View this message in context: http://www.nabble.com/MySql-Persistence-Problem-t1555507.html#a4225339
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message