4 Replies Latest reply on Apr 20, 2010 7:00 AM by Tim Fox

    Persisting Large Messages

    Luke McLean Newbie

      I'm having to deal with large multipart emails (mailbox size limited to 15MB!) and persisting them through HornetQ.

       

      I'm not quite following the logic of what is supposed to happen from the user manual.  I can see that paging works as I set

       

              <max-size-bytes>10485760</max-size-bytes>
              <page-size-bytes>1048576</page-size-bytes>
              <address-full-policy>PAGE</address-full-policy>

       

      on my addresses. I look at the paging directory and some files are created so that is cool.

       

      I set the following spring bean for my client connectionFactory (on Mule 2.2.1)

       

      <bean name="transportConfiguration">
              <constructor-arg value="org.hornetq.integration.transports.netty.NettyConnectorFactory"/>

      </bean>

       

      <bean name="connectionFactory">
              <constructor-arg ref="transportConfiguration"/>
              <property name="minLargeMessageSize" value="25000"/>
              <property name="cacheLargeMessagesClient" value="false"/>
              <property name="discoveryAddress" value="${hornetq.broadcast.address}"/> 
              <property name="discoveryPort" value="9876"/>
      </bean>

       

      I don't use JNDI (I just connect to the broadcast) so this should be the alternative to setting <min-large-message-size>25000</min-large-message-size> in the large-message example.

       

      Nothing appears to get written to the large-message directory? I send a heap (10-15) of large messages and ensure that they are not consumed.

       

      I turn the persistentDelivery=true on my client so that mesages are persisted and immediately run into the 'Can't write records bigger than the bufferSize(501760) on the journal' exception. The manual clearly states...

       

      "For large messages, HornetQ persists them outside the message journal. This is discussed         in Chapter 24, Large Messages."

       

      I'm therefore expecting that any message over the minLargeMessageSize shouldn't hit the journal at all. I made the journal-buffer-size larger than the 15MB and it works but not quite what I was expecting to have to do as these are silly sizes!

       

         <journal-type>NIO</journal-type>
         <journal-buffer-size>32505856</journal-buffer-size>
         <journal-file-size>162529280</journal-file-size>

       

      Is this the expected behaviour?

       

      Thank you.