Commit Graph

2695 Commits

Author SHA1 Message Date
Justin Bertram de0f6ac8f5 ARTEMIS-4760 creating MQTT consumer should work if auto-create-queues is false 2024-06-05 09:06:53 +01:00
Timothy Bish 4daefbf138 ARTEMIS-4792 Allow consumer priority to be added to receiver link address
Allow the Source address to provide consumer priority on the address using the
same option value as a core consumer '?consumer-priority=X'. The change parses
any query string appended to an address and uses the address portion as the
actual receiver address and currently only looks at consumer priority values in
the extracted address query parameters and ignores any other options found. The
existing consumer priority taken from link properties takes precedence over the
value placed on the address query options if both are present.
2024-06-04 17:38:52 +01:00
Robbie Gemmell f5ecc5e219 ARTEMIS-4790: un-nest test classes to simplify 2024-06-04 12:55:00 +01:00
Clebert Suconic aade3b35f6 NO-JIRA Fixing intermittent test failures 2024-06-03 14:44:57 -04:00
Robbie Gemmell 362dbd11ac ARTEMIS-4790: use JUnit 5 for the tests 2024-06-03 10:06:37 -05:00
Timothy Bish 0650713b3e NO-JIRA Fix test failed due to missing expectation
Test should add an optional expect close as it is very occasionally able
to hit the wire and the test peer will fail if not expecting it might be.
2024-05-31 13:27:20 -07:00
Timothy Bish 892c1225b0 ARTEMIS-4788 Fix a rare race on broker shutdown in AMQP federation
Race on consumer create and broker shutdown could lead to a deadlocak trying
to access configuration from the policy manager while the federation instance
is trying to shutdown the policy manager.
2024-05-30 19:44:34 -04:00
Clebert Suconic 7fbd1b1a51 NO-JIRA Fixing intermittent failure on LargeMessageTest::testSendServerMessageMetrics
When the Database option is used, the packets on the ServerMessage may still be in transit.
We should sync the file on the Database before we can actually send it, otherwise we would get an assertion error on the send method.
2024-05-29 18:49:46 -04:00
Clebert Suconic 6cd9c9730b [maven-release-plugin] prepare for next development iteration 2024-05-29 12:13:17 -04:00
Clebert Suconic 30ea6eeae0 [maven-release-plugin] prepare release 2.34.0 2024-05-29 12:13:16 -04:00
Justin Bertram 4cd4ecb198
ARTEMIS-4306 fix tests 2024-05-28 21:17:50 -05:00
Clebert Suconic fa06b70134 ARTEMIS-4784 Large Messages should removed from HashMap on ReplicatioEndpoint after being closed 2024-05-28 21:04:33 -04:00
Clebert Suconic 0ca36b7b38 NO-JIRA fixing intermittent test failure on MaxMessagePagingTest 2024-05-28 20:57:53 -04:00
Justin Bertram acc64b184e ARTEMIS-4306 add authn/z cache metrics
This commit includes the following changes:

 - Management operations to get sucess & failure counts for authn and
   authz along with the corresponding audit logging.
 - Export the aforementioned authn & authz metrics.
 - Export metrics for the underlying authn & authz caches including the
   ability to enable/disable them.
 - Update metrics tests to validate tags in addition to keys and values.
 - Update documentation to explain new functionality and clarify
   existing metric tags.
2024-05-28 17:27:54 -04:00
Timothy Bish aab1c484b2 NO-JIRA Fix a few cases of federation test fails on unexpected frames
Add a couple optional flags for performatives that might arrive based on the
timing of connection close or remote detach etc.
2024-05-28 11:52:24 -07:00
Timothy Bish f4d9cfdca8 NO-JIRA Fix random test failures if flow is omitted
If the remote detach arrives fast enough it can suppress the flow from
being sent by the broker so the test should mark that as an optional frame.
2024-05-28 16:32:23 +01:00
Justin Bertram c47713454c ARTEMIS-4726 fix original commit
The original commit (1ee3e884b7) for this
issue wasn't completely correct. This commit fixes those issues so that
both the messageCount and scheduledMessageCount are accurate now when
a scheduled message is removed by its ID.
2024-05-23 12:56:45 -05:00
Justin Bertram 7e151ee1ce ARTEMIS-4768 _AMQ_SCHED_DELIVERY msg prop lost after broker restart 2024-05-22 14:10:37 -05:00
Justin Bertram 1ee3e884b7 ARTEMIS-4726 removing scheduled msg from q via mngmnt can cause negative msg count 2024-05-22 14:10:08 -05:00
Robbie Gemmell 7849e2dcbf ARTEMIS-4778: extract base class and classes from parameterized test with subclass that skips to de-parameterize itself 2024-05-21 16:47:20 +01:00
Robbie Gemmell 3c84f26413 ARTEMIS-4778: split two Nested test classes (one parameterized, other not) into their own class files 2024-05-21 16:47:20 +01:00
m.napieraj f7b15e351e
ARTEMIS-4772 expose broker plugin classes via management 2024-05-20 13:54:33 -05:00
Clebert Suconic 49189cd7e6 ARTEMIS-4776 Pages may leak as open on Replicated Target
PagingStore is supposed to send an event to replica on every file that is closed.
There are a few situation where the sendClose is being missed and that could generate leaks on the target
2024-05-19 22:09:44 -04:00
Clebert Suconic e47d8ea7c1 ARTEMIS-4774 Fixing PageCounters out of sync after AckMnager retries 2024-05-17 09:47:34 -04:00
Clebert Suconic ae5d98337f NO-JIRA Improve a specific QueueControlTest
There is no need to use our own AddressSettings extension here.
This is just simplifying the test.
2024-05-15 11:55:01 -04:00
Gary Tully 23522fd83d NO-JIRA fix intermittent failure, this test failed on local repeat getting a null from immediate 2024-05-11 20:45:13 -04:00
Clebert Suconic cd563b49ad ARTEMIS-4765 DuplicateIDCache on Mirror Target is using 20K elements instead of amqpCredits
in this commit I'm storing a binding record with the address-settings for the correct size
this is also validating eventual merges of the AddressSettings in the same namespace.
2024-05-09 15:02:15 -04:00
Clebert Suconic abb1a7739e Reverting ARTEMIS-4765
I am gettig a few test failures when running the server in soak with Mirroring.
I will reapply the changes after some testing.
2024-05-07 22:09:33 -04:00
Clebert Suconic 355c600ea8 ARTEMIS-4765 DuplicateIDCache on Mirror Target is using 20K elements instead of amqpCredits 2024-05-07 20:42:10 -04:00
Clebert Suconic c523458a9a ARTEMIS-4758 Hardening Mirroring
This is a list of improvements done as part of this commit / task:

* Page Transactions on mirror target are now optional.

If you had an interrupt mirror while the target destination was paging, duplicate detection would be ineffective unless you used paged transactions
Users can now configure the ack manager retries intervals.
Say you need some time to remove a consumer from a target mirror. The delivering references would prevent acks from happening. You can allow bigger retry intervals and number of retries by tinkiering with ack manager retry parameters.

* AckManager restarted independent of incoming acks

The ackManager was only restarted when new acks were coming in. If you stopped receiving acks on a target server and restarted that server with pending acks, those acks would never be exercised. The AckManager is now restarted as soon as the server is started.
2024-05-02 17:23:28 -04:00
Timothy Bish d7a7116a4c ARTEMIS-4754 Structure the names used for federation internal queues
When creating internal temporary queues for the federation control links and the
events link we should use a structured naming convention to ease in configuring
security for the federation user where all internal names fall under a root prefix
which can be used to grant read and write access for the federation user. This
change allows security on the wildcarded address "$ACTIVEMQ_ARTEMIS_FEDERATION.#".
This change also includes some further restrictions added to federation resources
and adds support for wildcarding '$' prefixed addresses.
2024-05-02 15:54:13 +01:00
Justin Bertram 8b73335b46 ARTEMIS-4752 upgrade ErrorProne to 2.27.0
The upgraded ErrorProne found some new issues so this commit fixes those
as well.
2024-05-02 10:10:17 +01:00
Justin Bertram 614b5cb32f ARTEMIS-1769 return JMS Session's ClientID via JMX 2024-04-27 09:38:54 -05:00
Justin Bertram fc6f0ee9ec ARTEMIS-4740 reduce unnecessary boxing 2024-04-27 09:36:05 -05:00
Timothy Bish 659b17c3a9 ARTEMIS-4745 Allow configuration of the pull consumer batch size
Allow for configuration of the batch size granted to the remote when an
AMQP federation queue receiver is pulling messages only when there is
local capacity to handle them. Some code housekeeping is done here to
make adding future properties a bit simpler and require fewer changes.
2024-04-26 16:29:17 +01:00
Timothy Bish ee7a2c0944 ARTEMIS-4744 Fully support multple host broker connections URIs
Create a new NettyConnector for each connection attempt that is configured from
distinct broker connection URIs which allows for differing TLS configuration
per remote connection configuration.
2024-04-25 18:29:30 +01:00
Clebert Suconic 1e29602158 ARTEMIS-4733 Fixing test as it is now correctly ignoring MQTT internal queue 2024-04-23 22:44:09 -04:00
Justin Bertram f7288c16a6 ARTEMIS-4742 decoding PersistedSecuritySetting fails after upgrade 2024-04-23 10:35:20 +01:00
Clebert Suconic 86f7250d1c ARTEMIS-4733 Fixing test as it is now correctly ignoring MQTT internal queue 2024-04-22 13:29:24 -04:00
Gary Tully 20f345dbe1 ARTEMIS-4709 plugin to enforce connection periodic expiry per acceptor 2024-04-22 10:19:51 -05:00
Clebert Suconic 44e78d42a2 ARTEMIS-4733 Internal queues should not be mirrored 2024-04-22 00:06:07 -04:00
Justin Bertram 791630fa86 ARTEMIS-1921 setting client ID on core JMS should be reflected in broker RemotingConnection 2024-04-18 11:46:13 +01:00
Clebert Suconic c0cf01f914 NO-JIRA Speeding up ReceiverNoWaitTest
This test is using 1000 repetitions, each repetition sending 100 messages, which is not really needed on this case.
2024-04-17 11:07:00 -04:00
Justin Bertram a1db72395c ARTEMIS-1691 JMS bridge can't be manually restarted after failure 2024-04-15 23:49:13 -04:00
Justin Bertram f64e37622e ARTEMIS-1551 validate properties between JMS clients 2024-04-12 12:02:57 -05:00
Clebert Suconic 162c4f6655 ARTEMIS-4498 Making queues always manageable 2024-04-11 10:28:04 -04:00
a181321 51f39fc34d ARTEMIS-4498 Expose internal queues for management and observability 2024-04-11 10:28:04 -04:00
Clebert Suconic 33599f7727 ARTEMIS-4675 fix and improving test 2024-04-10 17:46:25 -04:00
Justin Bertram 6976c075be
ARTEMIS-4675 fix test 2024-04-10 13:27:12 -05:00
AntonRoskvist a723f634a2 ARTEMIS-4718 Diverted messages are not propertly routed on cluster remote bindings 2024-04-08 14:29:59 -04:00
AntonRoskvist 6c02950db3 ARTEMIS-4510 Add auto-create-destination logic to diverts 2024-04-08 10:53:07 -04:00
Timothy Bish 2c3f772645 ARTEMIS-4666 Correctly set queue match when parsing XML confing
Correct the XML parser for core federation queue match policy loading
to call the setQueueMatch instead of setAddressMatch when reading the
queue match element.
2024-04-05 09:00:04 -07:00
Clebert Suconic 04f6424928 ARTEMIS-4694 Redistribution issues with Almost Large Header
Redistribution would add data to the record which would then in turn make the record too large to redistribute.

The Redistributor and Bridges should not be removed.

Also a warning should be added to warn users about the situation.
2024-04-01 15:39:41 -04:00
Domenico Francesco Bruscino 3598177734 ARTEMIS-4697 Auto reload SSL PEM config sources on change 2024-03-25 14:26:42 +01:00
Justin Bertram 2cc3704551 [maven-release-plugin] prepare for next development iteration 2024-03-19 15:22:47 -05:00
Justin Bertram 900d217bf9 [maven-release-plugin] prepare release 2.33.0 2024-03-19 15:21:32 -05:00
Clebert Suconic 499a4eab6b ARTEMIS-4691 log.warn on inVM closing 2024-03-18 13:31:48 -05:00
Justin Bertram 50fae08b09 ARTEMIS-4657 support better correlation ID compat b/w JMS clients 2024-03-18 13:19:22 +00:00
Gary Tully 2e17a4a007 ARTEMIS-4582 - view and edit permissions, mops. security-settings for rbac on management apis 2024-03-15 16:40:45 +00:00
Justin Bertram 576622571a ARTEMIS-4559 refactor HA docs & code/module naming
This commit does the following:

 - Updates HA docs including the chapter on network isolation (i.e.
   split brain). The network isolation chapter is now more about
   high-level explanation and the HA doc now has all the configuration
   parameters.
 - Changes references to "pluggable quorum voting" to "pluggable lock
   manager." The pluggable functionality really isn't about voting.
   Conceptually is much more like the functionality you'd get from a
   distributed lock so this naming is more clear. Both the docs and the
   code have been changed.
 - Reorganize lock manager modules as sub-modules. The API and RI
   modules are renamed, but that should be OK based on the
   "experimental" tag that's been on this feature up to this point.
 - Remove the "experimental" tag from the lock manager.

These changes will not break folks using the standalone broker. However,
they will break folks embedding the broker *if* they are using the
artemis-quorum-ri or artemis-quorum-api modules or the
o.a.a.a.c.c.h.DistributedPrimitiveManagerConfiguration class.

There are no functional changes here. Renaming these modules is more a
conceptual change to facilitate better documentation and increased
adoption.
2024-03-15 10:18:05 -04:00
Clebert Suconic 82c4df180e ARTEMIS-4690 Remove storageManager.addAddressSettings from the codebase 2024-03-14 13:38:28 -04:00
Justin Bertram 57ed2c30b3 ARTEMIS-4686 reduce number of FilterImpl instances
Whenever we create a queue with a filter we're instantiating 3 different
`org.apache.activemq.artemis.core.filter.impl.FilterImpl` objects. This
is wasteful and entirely avoidable.
2024-03-14 13:27:23 -04:00
Justin Bertram cb2b293810 ARTEMIS-4647 use specified call-timeout on backup connector 2024-03-13 23:22:31 -04:00
Justin Bertram 93e0826a38 ARTEMIS-4687 concurrent use of DocumentBuilder breaking Xpath filtering 2024-03-13 23:22:14 -04:00
Clebert Suconic 32138d64e4 ARTEMIS-4652 Adapting test to not throw XA_RETRY as requested 2024-03-13 20:25:22 -04:00
Clebert Suconic fd1ef367d3 ARTEMIS-4670 Slow processing with Large Messages and JDBC 2024-03-07 13:09:58 -05:00
Jan Šmucr 3c580c9351 ARTEMIS-4579 Add `peekFirstMessage*` and `peekFirstScheduledMessage*` functions 2024-03-07 10:45:14 -06:00
Clebert Suconic 9cd48602ab ARTEMIS-4664 Just fixing a typo on the test method name 2024-03-07 10:51:36 -05:00
AntonRoskvist 45533c38da ARTEMIS-4664 - autoCreatedResource can get removed while receiving batch of messages 2024-03-07 10:45:41 -05:00
Clebert Suconic 5ce70f9e37 ARTEMIS-4669 Clarify Storage Manager usage around large messages 2024-03-05 17:27:18 -05:00
Justin Bertram 661a4e6fdc ARTEMIS-4655 report logging metrics
It may be useful to configure alerts for ERROR or WARN events in the log
which may go unnoticed otherwise.
2024-03-05 09:37:11 +00:00
Timothy Bish f9f5ed373f ARTEMIS-4665 Fix AMQP federation pull consumer test failures
Fix intermittent test failures in pull consumer test by asserting that there
are the expected number of message on the queue before running the JMS consume
cycle to consume credit and trigger federation credit to flow.
2024-03-01 08:12:22 -08:00
Timothy Bish cffc72fd51 ARTEMIS-4665 Add additional state checks to fix test failures in CI
Tests need to ensure federation links are up before sending to and address
or the sent message can get discarded before the federation consumer is there
to receive it.
2024-02-29 13:44:59 -08:00
Timothy Bish fd5d9b9ad0 ARTEMIS-4658 Prevent reflections when using dual address federation
When federation is configured in two directions between nodes for an address
the message can reflect from one node to another if max hops is not set or not
set correctly and in some federation topologies the max hops value can't solve
the issue and still result in a working configuration. This reflection should
be prevented at the federation consumer level for address consumers.
2024-02-28 16:37:18 +00:00
Clebert Suconic db94b18b73 ARTEMIS-4651 Performance improvements on Mirror and Paging 2024-02-26 11:01:04 -05:00
Albertas Vyšniauskas f4b59c9b25 ARTEMIS-4646 Reuse only acknowledged MQTT IDs
Generate MQTT message IDs from full allowed range of 1-65535 and skip
currently used values. Do not use atomic integer for current ID, because
all accesses and modifications are performed in synchronized context.
2024-02-22 10:54:46 -06:00
Timothy Bish 91556729f1 ARTEMIS-4653 Create federation consumers for specific queue consumer filters
When Queue consumers attach with filters use those instead of the Queue
filter to filter the messages that are federated to avoid stranding of
messages on the local broker. This will result in multiple federation
consumers if the various attached local consumers all use different
filters but does keep unwanted messages on the remote so that consumers
there can consume those.
2024-02-21 16:53:49 +00:00
Albertas Vyšniauskas 0d1d88a72a ARTEMIS-4649 Use unique STOMP message ID per subscription
Use combined consumer and message ID as STOMP message ID.
2024-02-19 12:31:17 -06:00
Timothy Bish ddbf357625 ARTEMIS-4645 Update broker connection tests to use unique broker names
Use the test name to create unique names for broker connections in the tests and
the associated test logs
2024-02-16 10:18:08 +00:00
Timothy Bish b8800337df ARTEMIS-4642 Fix tracked federated demand when links are rejected or blocked
Under some scenarios federation demand tracking is losing track of total demand
for a federated resource leading to teardown of federated links before all local
demand has been removed from the resource. This occurs most often if the attempts
to establish a federation link are refused because the resource hasn't yet been
created and an eventual attach succeeds, but can also occur in combination with
a plugin blocking or not blocking federation link creation in some cases.
2024-02-15 17:08:39 +00:00
Robbie Gemmell 42a2e4637f ARTEMIS-4644: convert some broker-connection tests to use the ProtonJ2 test peer
Changes from myself and Tim Bish
2024-02-15 17:02:07 +00:00
Justin Bertram 77d9f10a3d ARTEMIS-4588 30 second pause for large msgs + federation
Large message support was added to
o.a.a.a.c.s.f.FederatedQueueConsumerImpl#onMessage via cf85d35 for
ARTEMIS-3308. The problem with that change is that when onMessage
returns o.a.a.a.c.c.i.ClientConsumerImpl#callOnMessage will eventually
call o.a.a.a.c.c.i.ClientLargeMessageImpl#discardBody which eventually
ends up in o.a.a.a.c.c.i.LargeMessageControllerImpl#popPacket waiting 30
seconds (i.e. the default readTimeout) for more packets to arrive (which
never do). This happens because the FederatedQueueConsumer short-cuts
the "normal" process by using LargeMessageControllerImpl#take.

This commit fixes that by tracking the number of bytes "taken" and then
looking at that value later when discarding the body effectively
skipping the 30 second wait.
2024-02-14 11:07:11 -06:00
Alexey Markevich 9cd598ebf4 ARTEMIS-1230 Added artemis-bom 2024-02-14 10:33:19 +00:00
Timothy Bish 94b6c0ec6e ARTEMIS-4641 Support events for add of missing federation resources
When an AMQP federation instance attempts to federate an address or queue
it can fail if the remote address or queue is not present or cannot be
created based on broker policy. A federation link can also closed if the
federated resource is removed from the remote broker by management etc.
In those cases the remote broker should note the resources that were
targets of federation and send alerts to the source federation broker to
notify it that these resources become available for federation and the
source should attempt again to create federation links if demand still
exists. This allows an AMQP federation instance to heal itself based on
updates from the remote.
2024-02-12 17:54:05 +00:00
Domenico Francesco Bruscino 29781bd5da ARTEMIS-4586 Auto reload web binding SSL stores on change 2024-02-09 17:20:56 +00:00
a181321 c4c2a9e718 ARTEMIS-4637 - Allow unordered xml conf elements for clusters and bridges 2024-02-06 11:58:59 -05:00
Clebert Suconic a325a795cf NO-JIRA fixing typo 2024-02-06 11:57:52 -05:00
Clebert Suconic b03bcb5247 NO-JIRA Adding Test to validate clustering distribution under paging
No problems reported on this test.
I needed to validate rather if messages were being distributed correctly when either SNF or the final address itself was paged. Rather than throw away the test I decided to keep the validation here.
2024-02-06 10:57:29 -05:00
Timothy Bish 169d6317d9 ARTEMIS-4626 Improve demand tracking for federation consumers
Implement idempotent tracking for tracking demand at start while also
tracking demand as consumer or bindings are added and removed.
2024-02-01 16:13:37 -05:00
Justin Bertram 2952d94554 ARTEMIS-4608 upgrade Derby to 10.15.2.0 2024-02-01 10:07:57 -06:00
Justin Bertram b863bc4ede ARTEMIS-4594 upgrade Error Prone to 2.24.1
This commit also fixes any new problems found with the new version.
2024-02-01 09:14:30 -06:00
Robbie Gemmell 8ad8c9d385 ARTEMIS-4589: consolidate utility code and remove the remaining test-jar creations in tests/ tree 2024-01-30 13:18:18 -05:00
Justin Bertram 513b7826a4 ARTEMIS-4532 MQTT-to-core wildcard conversion is broken
Currently when an MQTT topic filter contains characters from the
configured wildcard syntax the conversion to/from this syntax breaks.

For example, when using the default wildcard syntax if an MQTT topic
filter contains a . the conversion from the MQTT wildcard syntax to the
core wildcard syntax and back will result in the `.` being replaced with
a `/.`.

This commit fixes that plus a few other things...

 - Implements proper conversions to/from one WildcardConfiguration to
   another.
 - Refactors the MQTT code which invokes these conversion methods. This
   includes simplifying a lot of test code.
 - Adds lots of tests for everything.
 - Clarifies some variable naming to better distinguish between core and
   MQTT.
2024-01-29 18:35:43 +00:00
Robbie Gemmell 83eb03c665 ARTEMIS-4583: remove the artemis-server test-jar, do related cleanup
- Move ActiveMQTestBase to artemis-test-support.
- Add reduced parent for current artemis-server tests.
- Add a simpler test case parent class unit tests can use.
- Convert some existing checks into a rule for reuse.
- Move various rules/utils to artemis[-unit]-test-support module from where they can be used instead of from artemis-server.
2024-01-25 16:48:49 +00:00
Clebert Suconic e513e6d2dd [maven-release-plugin] prepare for next development iteration 2024-01-24 14:21:08 -05:00
Clebert Suconic dbaa508d07 [maven-release-plugin] prepare release 2.32.0 2024-01-24 14:21:07 -05:00
Howard Gao 07b02159d2 ARTEMIS-4570 filter not applied to all brokers in cluster 2024-01-23 16:13:13 -05:00
Justin Bertram 44ceeff63c ARTEMIS-4540 validate MQTT session state data 2024-01-22 20:58:13 -06:00
a181321 f56595b89b ARTEMIS-4185 - Revision on sending already compressed messages 2024-01-22 17:23:56 -05:00
Justin Bertram 3dd50f8ff1 ARTEMIS-3831 scale-down w/jgroups fails if using same dg as cluster-connection
If both scale-down and cluster-connection are using the same JGroups
discovery-group then when the cluster-connection stops it will close the
underlying org.jgroups.JChannel and when the scale-down process tries to
use it to find a server it will fail.

This commit ensures that the JGroupsBroadcastEndpoint implementation of
BroadcastEndpoint#openClient initializes the channel if it has been
closed.
2024-01-22 15:02:02 -05:00