Commit Graph

972 Commits

Author SHA1 Message Date
Martin Devlin 573ae71ec9 AMQ-9187 - Queue Advisory message not sent
- a test case which demonstrates the bug.
  - the first test case sendDelayedMessage_usingNormalProducer works fine because it is using a normal named JMS MessageProducer. Included just for comparison purposes.
  - the 2nd test case sendDelayedMessage_usingAnonymousProducer shows the bug.
- the bug fix: swap the order of the AdvisoryBroker and SchedulerBroker BrokerFilters.
  - make AdvisoryBroker come after SchedulerBroker but before RegionBroker
  - this ensures that when a delayed message gets eventually forwarded to the RegionBroker, the RegionBroker will "see" the AdvisoryBroker when it invokes 'addDestination'. Thus, the AdvisoryBroker gets to send out the advisory message as expected.
2023-10-20 17:39:37 +02:00
JB Onofré dc4b584c7e
Merge pull request #237 from sigee/cleaning
Remove unnecessary boxing / unboxing
2023-10-19 16:03:52 +02:00
JB Onofré 07cce0609b
Merge pull request #160 from emopers/SynchronizedCollection_140_422
TransportConnection does not synchronize iteration on synchronized list
2023-10-17 11:21:36 +02:00
JB Onofré 360a45488a
Merge pull request #1042 from PascalSchumacher/slow_consumer_log_message_superfluous_placeholder
AdvisoryBroker#handleFireFailure: Remove unused placeholder in warn l…
2023-10-15 08:09:13 +02:00
Matt Pavlovich 578d86d726 [AMQ-9315] Add connectedTimestamp to Connection and JMX view 2023-10-03 09:09:48 -05:00
Matt Pavlovich 9f374dfcb5 [AMQ-9301] Add additional fields to o.a.activemq.broker.jmx.Connection 2023-09-16 12:39:17 -05:00
Matt Pavlovich fa7d1347e9 [AMQ-9239] jakarta.jms - activemq-broker changes 2023-08-24 09:45:31 -05:00
PascalSchumacher 97d4f3f6ad AdvisoryBroker#handleFireFailure: Remove unused placeholder in warn log message. All information is already logged at warn level, so remove additional debug log message. 2023-08-24 08:08:16 +02:00
Matt Pavlovich b751428ebb
[AMQ-9288] Fix TransportConnection logger to include exception message on Async Error (#1038) 2023-08-01 08:29:10 -05:00
sigee 3ba93ed957 Remove unnecessary boxing / unboxing 2023-07-23 12:08:23 +02:00
Jean-Baptiste Onofré 95e3c2a1aa [AMQ-9233] Prevent NPE in SubQueueSelectorCacheBroker 2023-06-22 14:16:59 +02:00
Christopher L. Shannon 901956d4dd
AMQ-9262 - Fix network subscriptions for composite consumers (#1014)
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.
2023-06-07 07:18:18 -04:00
Matt Pavlovich 9a5b61f6a2
[AMQ-9257] Disabled expire message checking when pauseDispatch=true (#1005) 2023-05-19 08:06:53 -05:00
JB Onofré c41be2a8d7
[AMQ-8316] Flag deprecated methods in BrokerService (#988)
These methods will be removed or renamed in a future release.

Co-authored-by: Christopher L. Shannon <christopher.l.shannon@gmail.com>
2023-03-14 07:07:56 -04:00
Matt Pavlovich 413dfa9532
[AMQ-5137] make networkConnector decreaseNetworkConsumerPriority="true" the default (#771) 2023-03-13 20:00:36 -06:00
Christopher L. Shannon (cshannon) 459388185a AMQ-9217 - Fix IndividualDeadLetter strategy rollback
This fixes the rollback after the latest changes by using the
originalDestination property to look up the correct message audit on
rollback
2023-02-16 07:21:20 -05:00
Matt Pavlovich 28f7eb7ee8 [AMQ-9217] Fix per-destination audits on IndividualDeadLetterStrategy 2023-02-08 09:56:03 -06:00
JB Onofré c86cd20029
Merge pull request #957 from mjanczykowski/bugfix/AMQ-9199
[AMQ-9199] Fixed race condition in creating store directory
2023-02-02 14:43:40 +01:00
Christopher L. Shannon (cshannon) ed924cddac AMQ-9202 - Make sure Reentrant locks are acquired outside a try block
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()
2023-02-01 11:19:24 -05:00
Michał Janczykowski 7de7ba2aa9 [AMQ-9199] Fixed race condition in creating store directory
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.
2023-01-17 12:20:53 +01:00
Dmytro Chebotarskyi dc55028c00 Added additional logging on BrokerService startup 2022-11-29 07:51:20 +01:00
Christopher L. Shannon (cshannon) f83c5f1ba1 AMQ-9175 - Properly set broker on ConnectionContext inside
MemoryTransactionStores

This fixes a NPE when using the messageDelivered advisory and
transactions
2022-11-21 11:03:08 -05:00
Christopher L. Shannon (cshannon) 757a712890 AMQ-9168 - Send message expired advisory and not discard advisory when
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
2022-11-16 06:43:21 -05:00
Christopher L. Shannon (cshannon) 8554a1464c (AMQ-9156, AMQ-9167) - Update TopicSubscription to use a new counter for
current dispatched count

The previous way of computing the count of using total dispatched minus
total dequeued didn't work in the case of destination removal and
messages were not acked. The counter is needed as the dispatched list is
optional unlike prefetch subs.
2022-11-15 16:59:01 -05:00
Christopher L. Shannon (cshannon) 85502a526d AMQ-9157 - Dispatched advisory should not fire for queue browsers
The dispatched advisory doesn't really make sense to send for queue
browsers, just like we don't send a consumed advisory, as it's more of
an admin type funtion to look at the contents of a queue but it's not a
real consumer that is receiving and acking messages.
2022-11-15 10:13:45 -05:00
Matt Pavlovich c25975389f
[AMQ-9163] Add 'Started' attribute to ConnectorView (#932) 2022-11-14 09:03:44 -06:00
Christopher L. Shannon (cshannon) c140d73fec AMQ-9157 - Include consumer id as part of Dispatched advisory 2022-11-11 13:53:47 -05:00
Christopher L. Shannon (cshannon) 837df23be6 AMQ-9159 - In topic subscriptions only remove nodes from dispatched list if
they match the destination on destination removal
2022-11-10 16:17:02 -05:00
Christopher L. Shannon (cshannon) 76f612600d AMQ-9157 - Add a new optional advisory for dispatched messages 2022-11-03 14:30:33 -04:00
Christopher L. Shannon (cshannon) 2306a26aef AMQ-9156 - fix formatting
(cherry picked from commit 3bd099f469)
2022-11-03 10:45:08 -04:00
Christopher L. Shannon (cshannon) 58666afffd AMQ-9156 - Make sure in flight metrics are properly decremented on
subscription destroys and dispatch failures
2022-11-03 10:38:02 -04:00
Christopher L. Shannon (cshannon) d46b74d674 AMQ-9107 - rework performance improvement for consumer closing in
managed region broker

This new approach just looks matching Subscriptions from the region for the
destination which prevents having to store another map and falls back to
the old approach if something went wrong.
2022-11-03 06:43:55 -04:00
Christopher L. Shannon (cshannon) 596ee31687 AMQ-9153: Fix slow consumer advisory for queue subscriptions
Due to changes with Queues to check if consumers are full before adding
more messages to the subscription, the Queue dispatch logic needed to be
updated to mark subscriptions as slow and send advisories if configured
instead of relying on the subscription itself to do it.
2022-11-01 10:29:53 -04:00
Lucas Tétreault b7f73d4875 remove consumers more efficiently 2022-10-10 13:40:01 -07:00
Matt Pavlovich ead9533d53
[AMQ-8322] JMS2 Implementation - JMSContext, JMSProducer, JMSConsumer first pass (#729) 2022-09-02 08:21:11 -05:00
Jean-Baptiste Onofré 7159b4410b [AMQ-9049] Mention dicarded messages in getTotalDequeueCount operation of BrokerViewMBean 2022-08-17 08:01:04 +02:00
Jean-Baptiste Onofré 2c193ea01d
Merge pull request #840 from zisding/logrefine
[AMQ-8601] Refine the logging messages
2022-08-17 07:48:37 +02:00
Lucas Tétreault 7b3f13feda Clean up remaining Xalan references
Empty
2022-08-05 00:43:02 -07:00
Matt Pavlovich 680717cb95
[AMQ-8976] Add maxConnectionExceededCount metric for connectors (#850) 2022-07-18 16:20:25 -05:00
Zishuo Ding f2c9a6c718 Refine the logging messages 2022-05-11 14:46:31 -04:00
Christopher L. Shannon (cshannon) ae30dce4e2 AMQ-8520: Log4j2 test fixes
Also fixes Log4jConfigView
2022-03-03 15:24:38 -06:00
Jean-Baptiste Onofré e597017200
Merge pull request #662 from jbonofre/AMQ-7426
[AMQ-7426] Upgrade to log4j2
2022-02-27 13:23:53 +01:00
Matt Pavlovich 9956dd602a
[AMQ-8440] Set sendDuplicateFromStoreToDLQ to 'false' by default (#773) 2022-02-24 08:45:35 -06:00
jbonofre 472dcf8497 [AMQ-7426] Upgrade to log4j2 2022-02-24 15:20:51 +01:00
Christopher L. Shannon (cshannon) df354fa023 AMQ-8509: Update TempStore Usage test to verify cleanup
Add a unit test to the previous tests added in AMQ-7085 to verify
TempUsage is cleaned up and stopped on Queue.stop()
2022-02-23 07:41:24 -05:00
Artur Pedroso d1e9ba68b3 AMQ-8509: Fix TempUsage memory leak
If you have an application that creates lots of queues it will eventually
fail with OOM because TempUsage is started on Queue#start but never stopped.

The `systemUsage.getTempUsage().start()` used on the Queue#start
adds elements on a List from TempUsage parent and these elements
are never removed.

To reproduce this issue you need to leave an application
running for a long time creating different queues.

The only way to avoid the leak right now is to stop the BrokerService,
which isn't a solution.
2022-02-23 07:38:58 -05:00
Endre Stølsvik 9167a79b79 StatisticsBrokerPlugin: Add feat: request destination firstMessageTimestamp
Adding a feature (STATS_FIRST_MESSAGE_TIMESTAMP) to the
StatisticsBrokerPlugin's destination-statistics for getting the
timestamp of the first message in the destination(s) being requested: If
you on the query-message set the property
StatisticsBroker.STATS_FIRST_MESSAGE_TIMESTAMP to anything (e.g. boolean
true), a long value "firstMessageTimestamp" will be added to the
statistics reply message(s). Since the reply message has JMSTimestamp
set, which is the broker's now-timestamp, you may also on the query side
calculate the age of the first message in milliseconds. The key name was
chosen since that is the name of the corresponding feature in Artemis.

This extension of the existing feature is implemented to be as
non-intrusive as possible, adding very little runtime cost if not
requested. It also seems like the runtime cost for enabling this
feature, thus finding and adding the firstMessageTimestamp, is small.

While at it, also slightly improving an existing feature
(STATS_DENOTE_END_LIST) where a reply to a destination query can be
"null terminated": After sending the relevant replies, the
StatisticsBroker also sends an empty message. This feature is relevant
if the query is a wildcard query, thus returning multiple messages: The
empty message denotes the end of the replies. However, to activate this
feature, a somewhat complicated query destination had to be constructed.
Adopting the solution for the other StatisticsBroker feature where you
may reset the broker statistics by adding a property to the query
message, this null-termination feature now /also/ checks for the
presence of this query modifier STATS_DENOTE_END_LIST as a property.
(This property based solution was thus also adopted for the present
'firstMessageTimestamp' solution, as it was found much more intuitive).

Added tests for both the STATS_FIRST_MESSAGE_TIMESTAMP query modifier,
and the improved STATS_DENOTE_END_LIST property-based query modifier.

Had to make the Topic.doBrowse(List browseList, int max) public - the
corresponding method for Queue was already public.

Made the evaluation of whether this is a StatisticsBroker-relevant
message a microscopic bit more performant (exiting faster if not
relevant): To the initial test of whether the message is relevant, which
only checked for replyTo being set, a check for 'destination.
startsWith("ActiveMQ.Statistics")' was added. Only if so, the rest of
the evaluations kick in. Also using 'string.startsWith(..)' instead of
the verbose 'string.regionMatches(..)'.

Removed an unused import on PartitionBrokerTest.java, as IntelliJ
complained about not finding it.
2022-01-25 09:45:48 +01:00
Matt Pavlovich 6a944a05d9 [AMQ-8462] Remove double call to listConnectionStates during connection close 2022-01-24 09:21:19 -06:00
Jean-Baptiste Onofré 3d2fb2b609
Merge pull request #707 from AlexejTimonin/sendTextMessageWithProperties-delimiter
[AMQ-8372] Allow custom delimiter when sending TextMessages via MBean
2022-01-22 17:14:03 +01:00
Jean-Baptiste Onofré 0508c22481
Merge pull request #742 from mattrpav/AMQ-8053
[AMQ-8053] Do not override JMSXUserID over network connections
2022-01-15 06:47:48 +01:00