Durable messages and MDB with selector
dfisher May 11, 2010 6:10 PMTesting JBoss 5.1.0 + Hornetq 2.1.0Beta3.
I have a topic with a durable subscription (MDB) that uses a message selector.
Shutting down JBoss with messages waiting to be ACK'd in the topic results in the messages being lost when the server starts.
If I remove the message selector from the MDB the messages are processed as expected when the server starts.
(Without the appropriate selecting....)
hornetq-configuration.xml:
<address-settings>
<address-setting match="#">
<dead-letter-address>jms.queue.DLQ</dead-letter-address>
<expiry-address>jms.queue.ExpiryQueue</expiry-address>
<redelivery-delay>5000</redelivery-delay>
<max-delivery-attempts>-1</max-delivery-attempts>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
</address-setting>
<address-setting match="jms.topic.DurableTopic">
<max-size-bytes>104857600</max-size-bytes>
<page-size-bytes>10485760</page-size-bytes>
<address-full-policy>PAGE</address-full-policy>
</address-setting>
</address-settings>
hornetq-jms.xml:
<topic name="DurableTopic">
<entry name="/topic/DurableTopic"/></topic>
MDB:
@MessageDriven(
messageListenerInterface = MessageListener.class,
activationConfig = {
@ActivationConfigProperty(
propertyName = "destination",
propertyValue = "topic/DurableTopic"
),
@ActivationConfigProperty(
propertyName = "destinationType",
propertyValue = "javax.jms.Topic"
),
@ActivationConfigProperty(
propertyName = "acknowledgeMode",
propertyValue = "AUTO_ACKNOWLEDGE"
),
@ActivationConfigProperty(
propertyName = "subscriptionDurability",
propertyValue = "Durable"
),
@ActivationConfigProperty(
propertyName = "maxMessages",
propertyValue = "1"
),
@ActivationConfigProperty(
propertyName = "maxSession",
propertyValue = "1"
),
@ActivationConfigProperty(
propertyName = "useDLQ",
propertyValue = "true"
),
@ActivationConfigProperty(
propertyName = "subscriptionName",
propertyValue = "Test-Durable"
),
@ActivationConfigProperty(
propertyName = "clientID",
propertyValue = "durable-1"
),
@ActivationConfigProperty(
propertyName = "messageSelector",
propertyValue = "DurableSelector = 'test-durable'"
)
}
)
@TransactionManagement(value = TransactionManagementType.CONTAINER)
@TransactionAttribute(value = TransactionAttributeType.REQUIRED)
@ResourceAdapter("hornetq-ra.rar")
public class TestDurableBean implements MessageListener
Am I missing something from my configuration?
Anyone else seen this problem?
Thanks.