Commit Graph

2499 Commits

Author SHA1 Message Date
Justin Bertram defa911143 ARTEMIS-5028 use a default filter when none is specified for mngmnt ops
This is a small usability improvement for management whereby
invocations of some operations no longer require JSON boilerplate. It
impacts the following operations on the ActiveMQServerControl:

 - listConnections
 - listSessions
 - listAddresses
 - listQueues
 - listConsumers
 - listProducers
2024-09-05 12:04:41 -04:00
Robbie Gemmell 9133cdb466 ARTEMIS-4962: add test, clarify some related comments 2024-09-03 13:52:10 -05:00
Justin Bertram d929c5dd66 ARTEMIS-4962 mitigate NPE in FilterImpl 2024-09-03 13:52:10 -05:00
Justin Bertram 306dfc9327 ARTEMIS-4957 remove unused variables in Redistributor 2024-09-02 14:53:14 +01:00
Justin Bertram 73f18535b5 ARTEMIS-4958 remove unused variable in AddressImpl 2024-09-02 13:00:34 +01:00
Yashashree Chopada f9b912baf0 ARTEMIS-4972 Use Lock in start() for Binding Variables 2024-08-30 10:39:03 -05:00
Clebert Suconic ffafbf350a ARTEMIS-5001 Relax consistency requirement on OperationContext for Mirror send operations.
Send operations should ignore replication, while the ack of the message should wait a round trip in replication.
That will allow us to ack the message faster and still have consistency with its replica.
2024-08-29 14:42:48 -04:00
Justin Bertram d0c83af40e ARTEMIS-5017 bridge leaks ClientSessionFactory instance on reconnect attempt 2024-08-28 19:39:00 -04:00
Clebert Suconic 4352ebae5f ARTEMIS-5010 Addressing comments from PR https://github.com/apache/activemq-artemis/pull/5186 2024-08-28 14:08:49 -04:00
Clebert Suconic 4ba9f67d80 ARTEMIS-5010 AckManager records are not replicated 2024-08-28 11:53:16 -04:00
Justin Bertram f3bcab88dc ARTEMIS-5012 update docs & code to clarify resource-limit-settings 2024-08-28 06:57:19 -07:00
Clebert Suconic 38693370c9 Revert "ARTEMIS-5001 Option to relax sync on journal replication for Mirroring"
This reverts commit d41f01a5aa.
2024-08-26 12:49:42 -04:00
Clebert Suconic d41f01a5aa ARTEMIS-5001 Option to relax sync on journal replication for Mirroring
Say you use Mirroring and journal replication combined.

The target will wait a round trip on replica before sends are done.
It is possible to ignore that rountrip now with an option added into Configuration#mirrorReplicaSync
2024-08-20 16:03:57 -04:00
Clebert Suconic c042fb9e13 [maven-release-plugin] prepare for next development iteration 2024-08-16 10:23:18 -04:00
Clebert Suconic 0ec68a93d3 [maven-release-plugin] prepare release 2.37.0 2024-08-16 10:23:17 -04:00
Howard Gao 1f79341c05 ARTEMIS-4973 pageSizeBytes/pageLimitBytes combination can cause Address full
Update docs/user-manual/paging.adoc

Co-authored-by: Robbie Gemmell <robbie@apache.org>
2024-08-16 09:41:53 -04:00
Clebert Suconic 209f293922 [maven-release-plugin] prepare for next development iteration 2024-08-14 14:39:34 -04:00
Clebert Suconic de6efc82d1 [maven-release-plugin] prepare release 2.37.0 2024-08-14 14:39:21 -04:00
Josh Byster 8b3874d613
ARTEMIS-4809 Allow configuring initial queue buffer size
In some setups, there could be a few hundred thousand queues that are
created due to many consumers that are connecting. However, most of
these are empty and stay empty for the entire day since there aren't
necessarily messages to be sent. The 8K intermediateMessageReferences
instantiates an 64KB buffer (Object[]). This means we have large
allocation and live heap that ultimately remains empty for almost the
entire day.

In this commit, we introduce initial-queue-buffer-size, which defaults
to the current value of 8192. It can be set programmatically via
QueueConfiguration#setInitialQueueBufferSize(int).

Note that this must be a positive power of 2.
2024-08-14 13:18:29 -05:00
Clebert Suconic 537e0023fc ARTEMIS-4986 Compatibility issue on Quorum Voting 2024-08-13 14:45:00 -04:00
Justin Bertram ef3b5fa02c ARTEMIS-4985 message priority occasionally broken
The test in this commit was distilled down from a much more complex
integration test that rarely reproduced the problem. It is short and
sweet and reproduces the problem every time.

The problem exists in the iterator's `remove()` method where it uses
`index` instead of `i` when calculating a new highest priority.
2024-08-12 14:55:25 -07:00
Erwin Dondorp 14b6800810 ARTEMIS-4909 use names that match original xml tags 2024-08-06 15:52:31 -05:00
Domenico Francesco Bruscino 4d8ccc4b2f ARTEMIS-4955 Support broker properties from JSON files 2024-08-01 11:16:38 +01:00
Howard Gao 4ce0dfca2d ARTEMIS-4959 moveMessages operation can move more messages than max messageCount 2024-07-30 11:55:53 -04:00
Howard Gao 096a869c1e ARTEMIS-4954 AddressControl.pause() can pause the snf queue 2024-07-25 19:51:30 -04:00
Timothy Bish 284ce80618 ARTEMIS-4952 Use getObjectPropertyForFilter when applying filters
When counting messages with provided filters and grouping use the API
getObjectPropertyForFilter which translates values from AMQP message
annotations that are otherwise missed by the filters.
2024-07-25 19:51:19 -04:00
Clebert Suconic fa917ae3fd [maven-release-plugin] prepare for next development iteration 2024-07-25 13:47:10 -04:00
Clebert Suconic 75f17ba64d [maven-release-plugin] prepare release 2.36.0 2024-07-25 13:47:09 -04:00
Clebert Suconic db0ba73aa4 ARTEMIS-4941 Remove lazy update after application properties only when it's paging
for regular messages it's quite obvious when the message is leaving the queue but for paged messages it becomes a challenge. We should just ignore the update for paged messages.
2024-07-25 13:01:57 -04:00
Clebert Suconic 1a5c2ec51c Revert "ARTEMIS-4941 Remove lazy update after application properties as it's no longer needed"
This reverts commit fb2a57f3ed.
2024-07-25 13:01:57 -04:00
Domenico Francesco Bruscino c50f0e7001 ARTEMIS-4951 Support multiple connection router occurrences with same policy 2024-07-25 11:04:09 +01:00
Justin Bertram 8d1a66fbbd ARTEMIS-4931 fix bridge config encoding
This commit fixes 3 distinct issues with bridge configuration encoding:

 - The encoding size was calculated incorrectly in three ways:
   - Using 0 instead of `DataConstants.SIZE_NULL` when no transformer is
     defined resulting in a calculated size discrepancy of -1.
   - Using `DataConstants.INT` instead of `DataConstants.SIZE_INT` for
     the number of transformer properties resulting in a calculated size
     discrepancy of +2 when using a configuration with a transformer.
   - Using 0 or `sizeOfNullableInteger` instead of
     `DataConstants.SIZE_INT` for the number of static connectors
     resulting in a variable calculated size discrepancy of either -4 or
     +1 respectively.
 - Encoding was using `writeString` instead of `writeNullableString` for
   the name of the transformer class resulting in an actual buffer size
   discrepancy of -1.

Aside from these fixes this commit also adds new tests specifically for
encoding & decoding include a test to verify known bytes during
encoding.

Lastly, it's worth noting that this *won't fix* bad data that was
already stored to disk by an older broker or bad data that comes over
the wire from an older broker (e.g. if a older primary broker paired
with a newer backup).
2024-07-24 14:51:55 +01:00
Andy Taylor 9853211913 ARTEMIS-4950 - MBeanGuard throws an NPE
Although this doesnt affect the current console it does the new so needs addressing
2024-07-24 09:50:03 -04:00
Justin Bertram 10adca5479 ARTEMIS-4923 reduce synchronization in ManagementServiceImpl
The `ManagementService` is used by the broker to register and
unregister components for management as well as send notifications.
When the broker is busy dealing with new sessions and auto-creating
queues, addresses, etc. there is a lot of contention.

To reduce synchronization and improve the service overall this commit
does the following:

 - Remove `synchronized` from most methods. In most cases it's
   completely unnecessary because the methods are already using a
   thread-safe data-structure (e.g. `ConcurrentHashMap`) or more
   specific synchronization is already in place (e.g. on
   `mbeanServer`).
 - Adds new & clarifies existing logging.
 - Synchronizes `start` & `stop` methods and adds gates via `started`.
 - Simplifies the `sendNotification` method by synchronizing once rather
   than twice and performing legitimacy checks sooner.
 - Removing an unnecessary overload of the `registereQueue` method.

To be clear, there are no tests included with this commit as there
should be no semantic changes. Existing tests should be sufficient to
identify any regressions.
2024-07-23 09:19:18 -07:00
Clebert Suconic fb2a57f3ed ARTEMIS-4941 Remove lazy update after application properties as it's no longer needed 2024-07-22 15:31:36 -04:00
Justin Bertram 642a2c79fd ARTEMIS-4913 provide more details on error callbacks 2024-07-22 15:38:25 +01:00
Clebert Suconic 9e8df4cf7a ARTEMIS-4821 OperationContext leaking on SendAckThread
co-authored: nmeylan (test attached to the JIRA)
2024-07-21 22:23:38 -04:00
Justin Bertram 4e1daccfe3 ARTEMIS-4912 filter not enforced when sending msg to q via web console 2024-07-19 15:00:45 -05:00
Robbie Gemmell 59e7a3c01f ARTEMIS-4910: expand output verification tests with transformer + properties variations 2024-07-17 14:12:26 +01:00
Justin Bertram 1a83220711 ARTEMIS-4910 fix divert config encoding
This commit fixes 4 distinct issues with divert configuration encoding:

 - The encoding size was calculated incorrectly in three ways:
   - Using 0 instead of `DataConstants.SIZE_NULL` when no transformer is
     defined resulting in a calculated size discrepancy of -1.
   - Using `DataConstants.INT` instead of `DataConstants.SIZE_INT` for
     the number of transformer properties resulting in a calculated size
     discrepancy of +2 when using a configuration with a transformer.
   - Using `BufferHelper.sizeOfNullableBoolean` instead of
     `DataConstants.SIZE_BOOLEAN` for the `exclusive` property resulting
     in a calculated discrepancy of +1.
 - Encoding was using `writeString` instead of `writeNullableString` for
   the name of the transformer class resulting in an actual buffer size
   discrepancy of -1.

Aside from these fixes this commit also:

 - Updates the divert storage test to force a reload from disk which
   will also trigger this problem.
 - Adds new tests specifically for encoding & decoding include a test to
   verify known bytes during encoding.

Lastly, it's worth noting that this *won't fix* bad data that was
already stored to disk by an older broker or bad data that comes over
the wire from an older broker (e.g. if a older primary broker paired
with a newer backup).
2024-07-17 14:11:21 +01:00
Clebert Suconic 6c1134388b ARTEMIS-4925 Fixing issue with mirroring and replication
the page writes on replica should include the address where they belong to avoid leaks between the mirrorSNF and the actual addresses.
2024-07-16 17:05:06 -04:00
Justin Bertram 19d8059a4e ARTEMIS-4794 configure pending ack behavior for bridge
When a bridge is stopped it doesn't wait for pending send
acknowledgements to arrive. However, when a bridge is paused it does
wait. The behavior should be consistent and more importantly
configurable. This commit implements these improvements and generally
refactors BridgeImpl to clarify and simplify the code. In total, this
commit includes the follow changes:

 - Removes the hard-coded 60-second timeout for pending acks when
   pausing the bridge and adds a new config parameter (i.e.
   "pending-ack-timeout").
 - Applies the new pending-ack-timeout when the bridge is stopped.
 - Updates existing and adds new logging messages for clarity.
 - De-duplicates code for sending bridge-related notifications.
 - Avoids converting bridge name to/from SimpleString.
 - Removes unnecessary comments.
 - Renames variables & functions for clarity.
 - Replaces the `started`, `stopping`, & `active` booleans with a
   single `state` variable which is an enum.
 - Adds `final` to a few variables that were functionally final.
 - Synchronizes `stop` & `pause` methods to add safety when invoked
   concurrently with `handle` (since both deal with `state` and execute
   runnables on the ordered executor).
 - Reorganizes and removes a few methods for clarity.
 - Relocates `connect` method directly into `ConnectRunnable` (mirroring
   the structure of the `StopRunnable` and `PauseRunnable`).
 - Eliminates unnecessary variables in `ConnectRunnable` and
   `ScheduledConnectRunnable`.
 - Adds test to verify pending ack timeout works as expected with both
   `stop` & `pause` with both regular and large messages.
2024-07-15 18:19:39 +01:00
Justin Bertram 0277c6498e ARTEMIS-4914 clarify docs on core + client ID
This commit also adds a couple of tests to verify the documented
behavior works.
2024-07-12 11:03:04 -07:00
Gary Tully 76877b7fb4 ARTEMIS-4905 fix conversion to millis for periodSeconds comparison in expiry plugin 2024-07-03 16:10:15 +01:00
Robbie Gemmell d45349fa67 ARTEMIS-4872: use explicit annotationProcessorPaths compiler config
Updates artemis-log-annotation-processor to use artemis-project so that
artemis-pom can reference artemis-log-annotation-processor without cycle.

Split out its tests to their own module to faciltate, also exercising the
profile mechanism to enable the processor usage with trigger file.

Simplify disabling processing in the module using maven.compiler.proc prop
available since maven-compiler-plugin 3.13.0

Uses a dummy non-processor path at root to 'disable' processsing on JDK < 23,
accounting for Maven 3 not being able to unset maven.compiler.proc from a
parent, and JDKs < 21 requiring newest builds to support -proc:full value
needed otherwise to reenable processing once explicitly disabled.
2024-06-28 16:49:27 +01:00
Justin Bertram ca73dee630 ARTEMIS-4833 remove redundant type arguments 2024-06-24 10:41:39 -07:00
Justin Bertram d7cf5dfa44 ARTEMIS-4829 use lambdas consistently
This commit uses lambdas or method references wherever possible. There
are still a handful of places that appear like they could be changed but
couldn't mainly because they use "this" and the meaning of "this"
changes when using a lambda.
2024-06-21 12:01:16 -04:00
Clebert Suconic dba753bffc ARTEMIS-4814 Improve synchronization on SimpleAddressManager::getDirectBindings 2024-06-20 11:38:31 -04:00
Justin Bertram 8d3508eaf2 ARTEMIS-4828 remove unused variables 2024-06-19 20:23:33 -04:00
Justin Bertram be1459c939 ARTEMIS-4826 avoid implicit int conversion to long 2024-06-19 20:19:58 -04:00