This fixes network subscriptions that are generated on demand when a
consumer uses composite destinations. Before this fix conduit
subscriptions didn't work correctly. This fix now splits up the
composite dest and generates correct demand for each of the individual
destinations.
(cherry picked from commit 901956d4ddb6a0ea9fe5fedf39732117ab68f087)
This isolates the validation on data file length on read and adds unit
tests to verify we properly fallback to the real file length on initial
size check failure
(cherry picked from commit bcc74f93fe6dbbd5c795c35484db8efa29b254b6)
This fixes the rollback after the latest changes by using the
originalDestination property to look up the correct message audit on
rollback
(cherry picked from commit 459388185a3acd3a175d304b08af3c638e870292)
A store directory is created by MessageDatabase#getPageFile which
is called in two cases:
1. KahaDBStore.start() when creating a queue
2. KahaDBStore.size() which is performed when sending any persistent message
If both methods are called concurrently it's possible to get an IOException
thrown from the IOHelper.mkdirs method.
(cherry picked from commit 7de7ba2aa92dd1a98f48175fac5a538bd6e8579b)
This is best practice and will prevent unlock from being attempted
inside of a finally block when the thread doesn't actually own the
lock which can happen when the lock attempt throws an exception
such as calling lockInterruptibly()
(cherry picked from commit ed924cddac90b96bdc47b215852a68155d818bcd)
This should improve test reliability for the unit tests so brokers don't
hang around after the end of a test on error. Also increase the surefire
re-run count to 3 times before failing.
(cherry picked from commit a083ff4d23e9ea0997efa5aa596ed5f1c3c6ee24)
This should help reduce failures from flaky tests and make the build
more reliable
(cherry picked from commit 1b9bd133fd2fe87a4779b7483a339a4fe6dd8c9f)
Properly shutdown broker for each test and speed up tests by sending
less messages
(cherry picked from commit 044f5346e93d9b133fcecccb6000d16967aa0f1e)
(cherry picked from commit 393a696955cbf97b90576e4a85b3ce1a02268ad7)
Scenario on client:
1. Employing RedeliveryPolicy with exponential backoff (keeping maximum
redeliveries at default 6)
2. Enabled non-blocking redelivery
3. Receiving e.g. 100 consecutive poison messages (which eventually
should DLQ after max redeliveries)
This will result in massive redelivery delays due to a logic bug.
The reason is that redeliveryDelay is a field variable kept on the
ActiveMQMessageConsumer, instead of being a property on the message - or
that the redelivery delay was calculated per message based on the
redelivery count.
When consecutive messages rollbacks multiple times, the redeliveryDelay
field is continuously multiplied by the backoff multiplier, resulting in
enormous delays.
Fix: Ditch the field variable, instead calculating the redeliveryDelay
per delivery from the redelivery count. (This happens to be identical to
how it is done in afterRollback() in ActiveMQSession:1004.)
Test is added - which fails with the previous code, and passes with
this. Added a debug log line for the calculated delay.
MemoryTransactionStores
This fixes a NPE when using the messageDelivered advisory and
transactions
(cherry picked from commit f83c5f1ba156ed850acf76dc42f944b4150d21f8)
Topic subscriptions expire a message
This fixes topic subs to send the right advisory type, if enabled, when
the server discards a message on dispatch to a topic sub. Also add some
more expiration tests for other subscription types
(cherry picked from commit 757a712890996d71cf380c56fc2cefbd5a82ec88)