-
1. Re: Queue persistence
timfox Mar 23, 2010 3:28 AM (in response to mcleanl)Yes, of course persistent messages are persisted.
Please post a simple test program that replicates the issue and someone will take a look.
-
2. Re: Queue persistence
mcleanl Mar 23, 2010 3:48 AM (in response to timfox)Thanks Tim,
I don't think that the Mule side of things is relevant because I see the messages in the queue before I restart. I didn't consider the changes I made to HornetQ significant enough to have any effect. I'll just show what I've changed in the hornetq-jms.xml configuration. I just placed the 'import' queue in the file, like so...
<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
<connection-factory name="NettyConnectionFactory">
<connectors>
<connector-ref connector-name="netty"/>
</connectors>
<entries>
<entry name="/ConnectionFactory"/>
<entry name="/XAConnectionFactory"/>
</entries>
</connection-factory>
<queue name="DLQ">
<entry name="/queue/DLQ"/>
</queue>
<queue name="import">
<entry name="/queue/import"/>
</queue>
<queue name="ExpiryQueue">
<entry name="/queue/ExpiryQueue"/>
</queue>
<queue name="ExampleQueue">
<entry name="/queue/ExampleQueue"/>
</queue>
<topic name="ExampleTopic">
<entry name="/topic/ExampleTopic"/>
</topic>
</configuration>That is all I did. I changed the run.bat file to start the clustered configuration (when standalone didn't work).
To replicate I just send some messages to the queue. They are there and I see them in Jconsole (screenshot 1). I stop the server and restart and they are gone (screenshot 2). I have replicated this same thing on three different machines so far and that is why I think that I must be missing something. I'm on Windoze, (Tested on both Server2003, XP Prof). I looked at the journal files just now and their timestamps have not updated since I started at 6pm (now it's 9pm here in NZ)... is that unusual?
-
screenshot2.PNG 44.9 KB
-
screenshot1.PNG 45.0 KB
-
-
3. Re: Queue persistence
timfox Mar 23, 2010 3:52 AM (in response to mcleanl)1 of 1 people found this helpfulYou still need to post your code (that sends your messages). For all I know you are sending them as non persistent.
-
4. Re: Queue persistence
mcleanl Mar 23, 2010 4:14 AM (in response to timfox)OK Tim, quite right. Mule configuration (all configuration and no added code for this test). Good lead...I'll check the mule transport for other attributes in case the default is non-persistent.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.2"
xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2"
xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.2"
xmlns:quartz="http://www.mulesource.org/schema/mule/quartz/2.2"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
http://www.mulesource.org/schema/mule/stdio/2.2 http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd
http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd
http://www.mulesource.org/schema/mule/jms/2.2 http://www.mulesource.org/schema/mule/jms/2.2/mule-jms.xsd
http://www.mulesource.org/schema/mule/quartz/2.2 http://www.mulesource.org/schema/mule/quartz/2.2/mule-quartz.xsd">
<stdio:connector name="stdioConnector" promptMessage="Please enter message: " outputMessage="Received message: " messageDelayTime="10"/>
<spring:bean name="transportConfiguration" >
<spring:constructor-arg value="org.hornetq.integration.transports.netty.NettyConnectorFactory"/>
</spring:bean>
<spring:bean name="connectionFactory" >
<spring:constructor-arg ref="transportConfiguration"/>
<spring:property name="cacheLargeMessagesClient" value="false"/>
<!-- <spring:property name="discoveryAddress" value="231.7.7.7"/>
<spring:property name="discoveryPort" value="9876"/>
-->
</spring:bean>
<jms:connector name="jmsConnector"
connectionFactory-ref="connectionFactory"
createMultipleTransactedReceivers="true"
numberOfConcurrentTransactedReceivers="10"
specification="1.1">
</jms:connector><jms:object-to-jmsmessage-transformer name="ObjectToJMSMessageTransformer"/>
<jms:jmsmessage-to-object-transformer name="JMSMessageToObjectTransformer"/><model>
<service name="stdioToQueue">
<inbound>
<stdio:inbound-endpoint system="IN"/>
</inbound>
<outbound>
<pass-through-router>
<jms:outbound-endpoint queue="import"/>
</pass-through-router>
</outbound>
</service></model>
</mule>
-
5. Re: Queue persistence
timfox Mar 23, 2010 4:16 AM (in response to mcleanl)One thing that might help.
When you view your messages in jconsole, you should be able to see whether they are durable or not (it's an attribute on the message).
Also take a look whether your queue is durable, this can be done via JMX too. Durable messages in a non durable queue will behave as non durable.
-
6. Re: Queue persistence
mcleanl Mar 23, 2010 4:19 AM (in response to timfox)Hey Tim, could you please glance your eye over http://www.mulesoft.org/display/MULE2USER/JMS+Transport
There is nothing specific to HornetQ yet but I'm guessing that the default persistentDelivery might be false. I'll set to true and see what happens. Would be good to update the Mule dudes.
-
7. Re: Queue persistence
mcleanl Mar 23, 2010 4:29 AM (in response to timfox)Tim, YOU THE MAN!
Without persistentDelivery set (must be default false)
{MULE_SESSION=SUQ9ZThmZDJiYWYtMzY1NS0xMWRmLTk2MTYtODk4OThiMDIzZjFm, JMSCorrelationID=e8fd2bae-3655-11df-9616-89898b023f1f, JMSExpiration=0, JMSMessageID=ID:e8fd2bc1-3655-11df-945b-0015c507a7c8:0000000000000000, address=jms.queue.import, JMSDeliveryMode=NON_PERSISTENT, MULE_ENCODING=UTF-8, MULE_CORRELATION_ID=e8fd2bae-3655-11df-9616-89898b023f1f, JMSPriority=4, MULE_ENDPOINT=jms://import, MULE_ORIGINATING_ENDPOINT=endpoint.stdio.system.in, JMSTimestamp=1269332845343}
With persistentDelivery=true
{MULE_SESSION=SUQ9NDQ5YzU0MjItMzY1NS0xMWRmLWJmODMtZjE5ODgxNWExNjNk, JMSCorrelationID=449c5421-3655-11df-bf83-f198815a163d, JMSExpiration=0, JMSMessageID=ID:44a38076-3655-11df-8c4a-0015c507a7c8:0000000000000000, address=jms.queue.import, JMSDeliveryMode=PERSISTENT, MULE_ENCODING=UTF-8, MULE_CORRELATION_ID=449c5421-3655-11df-bf83-f198815a163d, JMSPriority=4, MULE_ENDPOINT=jms://import, MULE_ORIGINATING_ENDPOINT=endpoint.stdio.system.in, JMSTimestamp=1269332569640}
One happy man here!
Thanks mate.