Commit Graph

2413 Commits

Author SHA1 Message Date
Justin Bertram 56c8afe934 ARTEMIS-4405 wrong user logged for authz audits 2023-08-29 15:35:22 +01:00
Andy Taylor 6b053dd290 ARTEMIS-4398 - support configuring database using Broker Properties
https://issues.apache.org/jira/browse/ARTEMIS-4398
2023-08-29 15:23:51 +01:00
Robbie Gemmell c1648d5917 ARTEMIS-4406: update LocalCache persisted entry tracking to use a ConcurrentHashMap 2023-08-29 10:07:32 +01:00
Robbie Gemmell df410da7ae ARTEMIS-4402: add some unit tests exercising the semi-generated log/message bundles to make generation problems more quickly noticable 2023-08-25 15:02:24 +01:00
Gary Tully 84c16f1a0d ARTEMIS-4378 ignore address federation config if connection is configured as pull, consumerWindowSize=0 2023-08-25 11:15:07 +01:00
Justin Bertram 29fafb5fed ARTEMIS-4399 fix disabled authn/z cache 2023-08-24 11:25:29 +01:00
Alexey Markevich 67f9c9d92d ARTEMIS-4391 tests: rework AssertionLoggerHandler 2023-08-17 05:47:24 -04:00
Yashashree Chopada ab3e67a24b ARTEMIS-4389 The word "mesage" should be corrected to "message" 2023-08-16 09:05:55 -04:00
Šmucr Jan 2f2dacdd34 ARTEMIS-4387 Fix empty consumer filter string leak 2023-08-14 10:06:25 +02:00
Clebert Suconic 064018a3e9 ARTEMIS-4384 cluster verify CLI command
ARTEMIS-4385 Expand StatQueue to visualize --clustered
2023-08-11 19:12:44 -04:00
Mike Artz c5f0e3400c ARTEMIS-4159 Support duplicate cache size configuration per address
This commit introduces support for configuring a specific Duplicate ID cache size per address in the Artemis server. Previously, there was only a global setting for the ID cache size, but now each address can have its own cache size.

The changes include the addition of a new configuration property id-cache-size in the Artemis server configuration file. This property can now be specified under each address setting in the configuration file, and its value will determine the Duplicate ID cache size for that particular address. If the id-cache-size property is not specified for an address, it will use the global setting.

The test cases have been updated to cover this new functionality, and integration test have been added to verify that address-specific cache sizes work as expected.

Documentation has been added to address-settings.adoc, configuration-index.adoc and duplicate-detection.adoc
2023-08-04 10:25:08 -05:00
Robbie Gemmell 116274e9ca ARTEMIS-4386: consolidate the used servlet api deps on the jetty one already being shipped 2023-08-04 11:57:01 +01:00
Gary Tully 5e232c25a4 ARTEMIS-4368 ensure predictable order for accurate logging 2023-07-20 22:33:06 +01:00
Justin Bertram 7048d9d4a5 [maven-release-plugin] prepare for next development iteration 2023-07-20 14:39:21 -05:00
Justin Bertram f05b63b8a1 [maven-release-plugin] prepare release 2.30.0 2023-07-20 14:36:44 -05:00
Clebert Suconic 677d71b8e7 ARTEMIS-4366 Missing Mirrored ACKs with MULTICAST and subscriptions 2023-07-17 20:19:06 -04:00
Gary Tully f5251bc5cb ARTEMIS-4356 ensure match regexp expression is anchored on eot to avoid partial matches in error 2023-07-14 20:48:19 +01:00
Justin Bertram cce565e78f ARTEMIS-4353 clean up Maven dependencies
This commit contains the following changes:
 - eliminate used, undeclared dependencies
 - eliminate unused, declared dependencies
 - fix scope for test dependencies
 - eliminate org.hamcrest completely as its use involved deprecated code
   as well as dependencies from multiple versions
2023-07-14 14:03:41 +01:00
a181321 68e400b45c ARTEMIS-4184 Bidges with concurrency not cleared properly on config reload 2023-07-13 16:16:08 -04:00
Clebert Suconic b967e6d940 ARTEMIS-4362 Produce log.warn when the system cannot depage because of pending acks 2023-07-13 16:15:45 -04:00
Domenico Francesco Bruscino 451d03fd75 ARTEMIS-4332 Add management method to close stuck server sessions
In rare cases a store operation could silently fails or starves, blocking the
related server session and all delivering messages. Those server sessions can
be closed adding a management method that cleans their operation context
before closing them.
2023-07-13 10:32:14 -04:00
Domenico Francesco Bruscino b4230c62bf ARTEMIS-4332 Add store operation trackers 2023-07-13 10:32:14 -04:00
Justin Bertram b198a9db7f ARTEMIS-4358 upgrade commons-configuration2
Version 2.9.0 of commons-configuration2 now includes commons-text 1.10.0
so the dependencies can be simplified.
2023-07-11 10:12:37 +01:00
Clebert Suconic 420f386fd2 ARTEMIS-4357 Replacing logger(222188).warn by a logger.debug 2023-07-10 11:30:43 -05:00
Clebert Suconic 6ee27224a5 ARTEMIS-4352 Avod Deadlock in case the SecurityManager is reusing the Netty executor.
If the Security Manager is using Netty, and in particular the same Netty connection,
you could run into a deadlock / starvation.

This is particularly true in the Wildfly case where they reuse the same connection for everything via XNIO.
2023-07-10 11:00:19 -04:00
Justin Bertram 2d1a8661fd ARTEMIS-4338 STOMP inoperable w/resource audit logging
When resource audit logging is enabled STOMP is completely inoperable
due to an NPE during the protocol handshake. Unfortunately the failure
is completely silent. There are no logs to indicate a problem.

This commit fixes this problem via the following changes:
 - Mitigate the original NPE via a check for null
 - Move the logic necessary to set the "protocol connection" on the
   "transport connection" to a class shared by all implementations.
 - Add exception handling to log failures like this in the future.
 - Add tests to ensure the audit logging is correct.
2023-07-06 12:08:16 +01:00
Gary Tully 196e479ae8 NO-JIRA additional test for status json with and without server 2023-07-06 09:39:53 +01:00
Robbie Gemmell cb9e1fedc8 ARTEMIS-4345: update to Error Prone 2.20.0 and fix up new errors 2023-07-05 09:40:24 +01:00
Justin Bertram f60a7d5c04 ARTEMIS-4341 refactor JavaDoc generation
Currently JavaDoc is generated for many classes that don't need it.
JavaDoc should be reserved for user-facing classes (e.g. those used by
client application developers and developers embedding a broker into
their application). This commit narrows down the configuration to just
the classes that are needed. This will save time during release builds,
and save disk space wherever these files are stored (e.g. Apache
website).
2023-07-04 18:00:42 +01:00
Domenico Francesco Bruscino fef7c147eb ARTEMIS-4336 Upgrade mockserver version to 5.15.0 2023-06-27 17:39:41 +01:00
Domenico Francesco Bruscino 247263c12c ARTEMIS-4335 Upgrade bcprov to bcprov-jdk18on:1.75 2023-06-27 17:39:41 +01:00
Justin Bertram b82419634a ARTEMIS-4328 add timeout to test which can hang
`org.apache.activemq.artemis.core.server.embedded.MainTest` expects the
broker to throw a `java.io.IOException` when it is started due to its
inability to find the file app/data/server.lock. However, if that files
just happens to exist then the test will simply hang indefinitely. This
commit adds a timeout to avoid hanging.
2023-06-26 12:12:59 +01:00
Gary Tully a76e9f81d2 Revert "ARTEMIS-4314 Small Tweak: using executor directly if no delay"
This reverts commit c6a82ff95e.
2023-06-22 15:40:45 +01:00
Justin Bertram dc4bf953e3 ARTEMIS-4319 mitigate NPE in paging log statement
Also improves the wording of some several related statements.
2023-06-21 17:42:45 +01:00
Justin Bertram 3db540c61b ARTEMIS-4315 incorrect validation for page-limit settings 2023-06-21 14:08:20 +01:00
Clebert Suconic c6a82ff95e ARTEMIS-4314 Small Tweak: using executor directly if no delay 2023-06-16 17:20:26 -07:00
Gary Tully a8b4ee1992 ARTEMIS-4314 support queue federation batchOnCapacity via consumerWindowSize=0 2023-06-16 15:44:51 +01:00
Clebert Suconic ae554b43db [maven-release-plugin] prepare for next development iteration 2023-06-14 18:20:58 -04:00
Clebert Suconic 2be5c54cd0 [maven-release-plugin] prepare release 2.29.0 2023-06-14 18:20:45 -04:00
Clebert Suconic ef3a91bdfb ARTEMIS-4313 Retry Bridge when destination full and configured to FAIL 2023-06-14 14:06:35 -07:00
Justin Bertram 3ff8419a4b ARTEMIS-4312 dupes w/redistribution and multicast
Multiple multicast queues on the same address can lead to duplicate
messages during redistribution in a cluster.
2023-06-14 11:19:56 -04:00
Justin Bertram c96a074b53 ARTEMIS-4292 support more Micrometer system metrics
This commit exposes Micrometer's system metrics for:
 - file descriptors
 - processor
 - uptime
2023-06-13 04:58:59 -07:00
Clebert Suconic e9b5931227 ARTEMIS-4278 Removing System.out left by accident 2023-06-09 08:50:11 -04:00
Domenico Francesco Bruscino 5553b6264c ARTEMIS-4299 Exclude unused json-smart dependency 2023-06-01 14:20:59 +02:00
Justin Bertram c4501f6793 ARTEMIS-4294 support text-encoded WebSocket frames 2023-05-31 16:34:02 -05:00
clebert c5be8b72c1 ARTEMIS-4298 and ARTEMIS-4215 Fixing duplicated entries on historyFiles on journalRetention during a replication
This is Fixing BackupSyncJournalTest::testReplicationDuringSync

ARTEMIS-4215 introduced a failure on the testsuite.
However the failure is non related to the Buffer itself. it introduced a race that unveiled ARTEMIS-4298.
2023-05-31 11:58:56 -07:00
Justin Bertram e7de2c7001 ARTEMIS-4297 allow regex in no-cache exception config 2023-05-31 11:37:28 -07:00
Roelof Naude 40425d422a ARTEMIS-4291 Add the "broker" tag in a consistent manner to all exported metrics.
Some scrapers, e.g. prometheus, add an "instance" tag. This value may not be the same as
the broker name, which results in these metrics becoming more difficult to match up with
the corresponding broker.
2023-05-31 12:45:32 -05:00
Justin Bertram 15aafe0b70 ARTEMIS-4293 add mngmnt ops to clear authn/z caches 2023-05-26 16:47:33 +02:00
Clebert Suconic 1b9089fc2a NO-JIRA Commandment: don't use this method 2023-05-25 15:46:25 -04:00
Justin Bertram b97d711733 ARTEMIS-4286 sometimes federated consumer won't stop 2023-05-24 18:22:33 +01:00
Gary Tully 587ffb223c ARTEMIS-3042 simple properties based, extensible broker image 2023-05-24 15:22:01 +01:00
Clebert Suconic e719622de5 ARTEMIS-4285 Limit number of redelivery records 2023-05-19 13:59:28 -07:00
Justin Bertram a57c48ec55 ARTEMIS-4275 add ID to consumer notifications 2023-05-19 16:27:36 -04:00
Justin Bertram 3a48258f7d ARTEMIS-2824 clientID not set on some notifications 2023-05-19 16:03:16 -04:00
Clebert Suconic 03afbedfe3 ARTEMIS-4282 Large Header may break the broker 2023-05-17 16:04:54 -07:00
Clebert Suconic ec54576323 ARTEMIS-4281 Queue Reaper should not remove non empty queues on initial check 2023-05-17 15:58:54 -07:00
Gary Tully d2abc56f56 ARTEMIS-4280 - map roles from review group info, optional roles properties file 2023-05-17 15:16:37 +01:00
Clebert Suconic 7434098922 ARTEMIS-4278 Code Improvements after comments from RVais on PR #4472 2023-05-16 09:12:54 -07:00
Stephen Higgs f1f017fb3b ARTEMIS-4279 Shutdown critical analyzer thread if error on broker initialization
The broker process fails to exit if an error is encountered starting the NodeManager.  The issue is resolved by converting the critical analyzer thread to a daemon thread.  As added protection, the thread is manually stopped when this error is encountered.
2023-05-16 01:32:43 -07:00
Clebert Suconic f082b9c5d1 ARTEMIS-4199 Adding test for open transaction on reset call 2023-05-15 07:08:05 -07:00
Clebert Suconic bea39f6692 ARTEMIS-4278 Incorrect Paging Counters with Prepared Transactions 2023-05-11 13:50:00 -07:00
Alexey Markevich 383345a4f6 ARTEMIS-4239 use StandardCharsets.UTF_8 2023-05-08 15:10:23 -05:00
Justin Bertram c2bada6a77 ARTEMIS-4267 original exception lost for NoCacheLoginException
When skipping the authentication cache details for the original
exception are not logged.

This commit ensures these details are logged and adopts the
ExceptionUtils class from Apache Commons Lang in lieu of the previous
custom implementation.
2023-05-08 17:01:35 +02:00
Gary Tully c5d872575e ARTEMIS-4256 - support removal of configuration via properties 2023-05-05 11:58:15 +01:00
Gary Tully cf3afc4096 ARTEMIS-4263 authenticator to delegate to artemis jaas login modules and populate callback handler 2023-05-05 10:00:52 +01:00
Justin Bertram 6254c140e3 ARTEMIS-4212 handful of updates
- fix syntax used for 'addresses' CLI option
 - update release notes
 - enforce new semantics on parsing & add test
2023-05-04 12:25:15 -07:00
Justin Bertram dc0b3ac55a ARTEMIS-4266 mitigate NPE with bad SSL config 2023-05-03 06:26:02 +02:00
Justin Bertram acd6605ebf ARTEMIS-4212 fix tests 2023-04-28 06:54:16 -07:00
Justin Bertram 1fa5c761c6 ARTEMIS-4212 fix management address issues 2023-04-28 06:54:16 -07:00
Domenico Francesco Bruscino 126765decc ARTEMIS-4252 Refine waitForBridges 2023-04-26 17:09:59 -05:00
Domenico Francesco Bruscino cc9db6b2f7 ARTEMIS-4244 Set web config using system properties 2023-04-26 17:07:32 -05:00
Clebert Suconic c2ad54fa91 ARTEMIS-4247 Fixing BrokerInSyncTest::testExpiryNoReaper
Once the context is set to disable mirror, it should stay that way even if reset is called.
2023-04-26 00:28:12 -04:00
Justin Bertram 74fa4ca758 ARTEMIS-4212 fix sending msgs to address w/mismatching routing types
When sending, for example, to a predefined anycast address and queue
from a multicast (JMS topic) producer, the routed count on the address
is incremented, but the message count on the matching queue is not. No
indication is given at the client end that the messages failed to get
routed - the messages are just silently dropped.

Fixing this problem requires a slight semantic change. The broker is now
more strict in what it allows specifically with regards to
auto-creation. If, for example, a JMS application attempts to send a
message to a topic and the corresponding multicast address doesn't exist
already or the broker cannot automatically create it or update it then
sending the message will fail.

Also, part of this commit moves a chunk of auto-create logic into
ServerSession and adds an enum for auto-create results. Aside from
helping fix this specific issue this can serve as a foundation for
de-duplicating the auto-create logic spread across many of the protocol
implementations.
2023-04-25 16:08:31 -05:00
Clebert Suconic fea84e39f5 ARTEMIS-4247 BrokerClustering vs Mirror code improvements 2023-04-25 08:10:58 -07:00
Domenico Francesco Bruscino ef4501292e ARTEMIS-4252 Fix flaky QuorumFailOverTest tests 2023-04-24 06:11:51 -07:00
Clebert Suconic 2a81a0a3c6 ARTEMIS-4247 Inconsistencies between Broker Clustering and AMQP Mirror
- activemq.notifications are being transferred to the target node, unless an ignore is setup
- topics are being duplicated after redistribution
- topics sends are being duplicated when a 2 node cluster mirrors to another 2 node cluster, and both nodes are mirrored.
2023-04-21 10:30:32 -05:00
Justin Bertram 673481369f ARTEMIS-4241 paging + FQQN is broken 2023-04-17 21:51:08 +02:00
Clebert Suconic 4eb978b931 ARTEMIS-4233 Disabling RefCounting debug and error after paged messages 2023-04-12 16:40:26 -07:00
Clebert Suconic e368dacc78 ARTEMIS-4207 Improving redistribution fix over large messages 2023-04-09 17:05:17 -07:00
Alexey Markevich 61c687ec9c ARTEMIS-4195 Auth callback to get Client ID
introduce ClientIDCallback to allow JAAS login module to retrieve Client
ID
2023-04-06 11:23:45 -05:00
Justin Bertram 6851e7d677 ARTEMIS-4204 connectors added via management are not durable 2023-04-06 11:22:18 -05:00
Clebert Suconic 6d3dbc4383 ARTEMIS-4233 Large Message Issues After Failed Clients
- interrupted message breaking reference counting
After the server writing to the client is interrupted in AMQP, the reference counting was broken what would require the server restarted
in order to cleanup the files of any interrupted sends.

- Removed consumer during large message delivery damaging large messages
If the consumer failed to deliver messages for any reason, the message on the queue would be duplicated. what would wipe out the body of the message
and other journal errors would happen because of this.

extra debug capabilities added into RefCountMessage as part of ARTEMIS-4206 in order to identify these issues
2023-04-06 07:40:01 -07:00
Clebert Suconic 23bbf76bdf ARTEMIS-4233 Avoiding holder.iter=null with a compile time validation 2023-04-06 07:40:01 -07:00
Justin Bertram 8ba9727b78 ARTEMIS-4210 refactor connection audit logging
This commit fixes the following things:

 - Moves connection audit logging to the resource audit logger instead
   of using a dedicated logger as that would adversely impact upgrading
   users, and arguably didn't make sense in the first place.
 - Mitigates an potential NPE w.r.t. connection ID.
 - Updates the "dummy" management connection to return a valid
   connection ID.
2023-03-30 14:37:17 -07:00
Clebert Suconic a8d828a510 ARTEMIS-4224 cert-users-LARGE.properties is too big for certain CI machines 2023-03-29 15:00:46 -05:00
Justin Bertram d2e5ddfe86 ARTEMIS-4210 audit connection creation & destruction 2023-03-28 16:21:04 -05:00
Clebert Suconic 15d39a14ea ARTEMIS-4207 Improved fix on LargeMessage Redistribution
This fix will delay the message.copy to the redistributor itself.
Meaning no copy would be performed if the redistribution itself failed.

No need to remove a copy any longer
2023-03-27 10:45:07 -07:00
Clebert Suconic 6d9bd71901 NO-JIRA I meant to remove this line 2023-03-18 18:48:07 -04:00
Clebert Suconic d730d1a684 NO-JIRA Testsuite speedup: proper JDBC drop from derby 2023-03-18 15:44:03 -07:00
Domenico Francesco Bruscino aaa8627795 ARTEMIS-4211 Fix record message id for federated queue consumers
The federated queue consumer has to generate a new id for the messages
received from the upstream broker because they have an id generated by
the store manager of the upstream broker.

Co-authored-by: Clebert Suconic <clebertsuconic@apache.org>
2023-03-18 08:52:21 -07:00
Clebert Suconic f43d3c4bde ARTEMIS-4207 Removing logger.info added by accident (temporary debug) 2023-03-15 18:01:03 -04:00
Clebert Suconic 8b2be8ef3b ARTEMIS-4207 Removing logger.info added by accident (temporary debug) 2023-03-15 16:24:25 -04:00
Clebert Suconic 3a5601572e ARTEMIS-4207 Redistribution could leave messages stranded in the folder
- redistribute received the handle call, it then copies the message
- the routing table changes
- the message is left behind

With the new version of the server these messages will be removed. But we should remove these right away
2023-03-15 12:46:50 -07:00
Clebert Suconic 4babdab18c NO-JIRA Cleanup MBeanServer usage in the testsuite as it is leaking
Basically I started the testsuite and attached check leak with "java -jar check-leak.jar --pid <pid> --report testsuite-report --sleep 1000" and saw the allocations of this were pretty high.
2023-03-15 12:42:12 -07:00
Clebert Suconic 2c037386b6 ARTEMIS-4206 Unreferenced AMQP Large Messages not removed right away, requiring a reboot 2023-03-15 05:57:51 -07:00
Justin Bertram 39b0f01ca9 ARTEMIS-4202 expand coverage of noCacheExceptions in LDAPLoginModule 2023-03-10 17:49:13 -06:00
Clebert Suconic 294daa0ff6 ARTEMIS-4162 Remove EMPTY_ROUTING_TYPES from AddressInfo
I have seen a werid intermittent failure in the testsuite
caused by some race where the EMPTY_SET ends up Not Empty! Causing weird failures that were really difficult to be investigated
2023-03-10 09:52:27 -08:00
Clebert Suconic 257dd86ae2 ARTEMIS-4193 Large Message Files orphaned after server killed
This fix is scanning journal and paging for existing large messages. We will remove any large messages that do not have a corresponding record in journals or paging.
2023-03-09 08:35:51 -08:00
Domenico Francesco Bruscino 7a0bf52ed8 ARTEMIS-4190 Fix config-delete-queues when address changes 2023-03-09 09:42:57 -06:00
Domenico Francesco Bruscino bb08a573eb ARTEMIS-3640 Use client connectors for HA 2023-03-09 11:20:51 +00:00
Gary Tully 00cae02ca4 ARTEMIS-4196 - set message routing type in mqtt publish 2023-03-08 14:30:30 -06:00
Clebert Suconic dc93f01542 ARTEMIS-4199 PageCounter could leave a record pending in the journal
This is just an annoying thing. as the functionality would work properly if there was a previous value.
No other harm other than the cannot find TX record on startup for this, hence I'm fixing it.
2023-03-07 17:18:43 -05:00
Clebert Suconic 08a81a7402 I had a mistake reapplying the large message fix. I'm still reworking the commit.
I apologize for this spam

This reverts commit 14536bf311.
2023-03-06 20:05:18 -05:00
Clebert Suconic 14536bf311 Revert "I'm temporarily reverting "ARTEMIS-4193 Large Message Files orphaned after server killed""
This reverts commit 7e6ce5a259.
2023-03-06 17:04:18 -08:00
Clebert Suconic 7e6ce5a259 I'm temporarily reverting "ARTEMIS-4193 Large Message Files orphaned after server killed"
while I figure out a better fix

This reverts commit 9f1927d3fa.
2023-03-06 12:31:54 -05:00
Justin Bertram 97c78525da ARTEMIS-4181 make try-with-resources style consistent 2023-03-03 08:40:51 -06:00
Clebert Suconic 9f1927d3fa ARTEMIS-4193 Large Message Files orphaned after server killed 2023-03-02 19:03:37 -08:00
Justin Bertram b76c672305 ARTEMIS-4162 support deleting addresses & queues w/o usage check
There are certain use-cases where addresses will be auto-created and
never have a direct binding created on them. Because of this they will
never be auto-deleted. If a large number of these addresses build up
they will consume a problematic amount of heap space.

One specific example of this use-case is an MQTT subscriber with a
wild-card subscription and a large number of MQTT producers sending one
or two messages a large number of different MQTT topics covered by the
wild-card. Since no bindings are ever created on any of these individual
addresses (e.g. from a subscription queue) they will never be
auto-deleted, but they will eventually consume a large amount of heap.
The only way to deal with these addresses is to manually delete them.

There are also situations  where queues may be created and never have
any messages sent to them or never have a consumer connect. These
queues will never be auto-deleted so they must be deleted manually.

This commit adds the ability to configure the broker to skip the usage
check so that these kinds of addresses and queues can be deleted
automatically.
2023-03-02 19:17:03 -06:00
Gary Tully dc7d1e25cc NO-JIRA - add test for ENC of tls params for broker amqp connection via props 2023-03-02 12:53:30 +00:00
Clebert Suconic 8078dd098c ARTEMIS-4171 Messages leaking thorugh AMQP Delivery
there are two leaks here:

* QueueImpl::delivery might create a new iterator if a delivery happens right after a consumer was removed, and that iterator might belog to a consumer that was already closed
             as a result of that, the iterator may leak messages and hold references until a reboot is done. I have seen scenarios where messages would not be dleivered because of this.

* ProtonTransaction holding references: the last transaction might hold messages in the memory longer than expected. In tests I have performed the messages were accumulating in memory. and I cleared it here.
2023-02-28 14:36:32 -05:00
Justin Bertram fb169bc4af ARTEMIS-4172 sending large msg via core skips plugins & audit log 2023-02-16 13:34:29 -08:00
Justin Bertram 82fc42987a ARTEMIS-4171 potential large message file leak 2023-02-16 13:34:29 -08:00
Clebert Suconic a2ba6ed298 ARTEMIS-4161 AMQP and OpenWire leaking leaking objects in certain conditions
The issue identified with AMQP was under Transaction usage, and while opening and closing sessions.
It seems the leak would be released once the connection is closed.

We added a new testsuite under ./tests/leak-tests To fix and validate these issues
2023-02-16 12:10:54 -08:00
Rakhi Kumari 17c760ab7b ARTEMIS-4157: Fix error setting broker properties for AddressSettings 2023-02-10 09:53:22 +00:00
Gary Tully 94516b8b37 fix mirror test that validates autostart 2023-02-08 16:44:42 +00:00
Clebert Suconic ed5f63538e ARTEMIS-4155 Fixing deadlock on LargeMessage conversion and retention 2023-02-06 09:27:18 -05:00
Justin Bertram 8f30347b18 ARTEMIS-4143 improve mitigation against split-brain with shared-storage
Configurations employing shared-storage with NFS are susceptible to
split-brain in certain scenarios. For example:

  1) Primary loses network connection to NFS.
  2) Backup activates.
  3) Primary reconnects to NFS.
  4) Split-brain.

In reality this situation is pretty unlikely due to the timing involved,
but the possibility still exists. Currently the file lock held by the
primary broker on the NFS share is essentially worthless in this
situation. This commit adds logic by which the timestamp of the lock
file is updated during activation and then routinely checked during
runtime to ensure consistency. This effectively mitigates split-brain in
this situation (and likely others). Here's how it works now.

  1) Primary loses network connection to NFS.
  2) Backup activates.
  3) Primary reconnects to NFS.
  4) Primary detects that the lock file's timestamp has been updated and
     shuts itself down.

When the primary shuts down in step #4 the Topology on the backup can be
damaged. Protections were added for this via ARTEMIS-2868 but only for
the replicated use-case. This commit applies the protection for
removeMember() so that the Topology remains intact.

There are no tests for these changes as I cannot determine how to
properly simulate this use-case. However, there have never been robust,
automated tests for these kinds of NFS use-cases so this is not a
departure from the norm.
2023-02-03 10:40:08 -05:00
Clebert Suconic 2378d187af [maven-release-plugin] prepare for next development iteration 2023-01-31 07:22:48 -05:00
Clebert Suconic 893e1e7916 [maven-release-plugin] prepare release 2.28.0 2023-01-31 07:22:47 -05:00
Robbie Gemmell 031788dbe8 ARTEMIS-3178: remove erroneous comment 2023-01-31 11:48:43 +00:00
Clebert Suconic bbf1baf3b2 ARTEMIS-3178 Fixing validation on PagingStoreImpl for parameters set 2023-01-31 06:40:57 -05:00
Clebert Suconic 764db34e9b ARTEMIS-3178 Page Limitting (max messages and max bytes)
I am adding three attributes to Address-settings:

* page-limit-bytes: Number of bytes. We will convert this metric into max number of pages internally by dividing max-bytes / page-size. It will allow a max based on an estimate.
* page-limit-messages: Number of messages
* page-full-message-policy: fail or drop

We will now allow paging, until these max values and then fail or drop messages.

Once these values are retracted, the address will remain full until a period where cleanup is kicked in by paging. So these values may have a certain delay on being applied, but they should always be cleared once cleanup happened.
2023-01-30 18:19:45 -05:00
Gary Tully b5ae95c376 ARTEMIS-4149 - add watch to login.config dir to trigger periodic update to jass reloadable properties status in the absence of login attempts 2023-01-30 15:25:58 -05:00
Ryan Highley 1c987ff129 ARTEMIS-3139 Anonymous types in Artemis config XSD
Moves embedded XSD element definitions and associated complexTypes
from XSD element definitions to top-level types available for XML
schema validation in IDEs.
2023-01-30 14:15:53 -05:00
Justin Bertram 49f8846861 ARTEMIS-4146 reauthenticated subjects are not cached 2023-01-30 12:02:08 -05:00
Domenico Francesco Bruscino ac7b0e85fb ARTEMIS-4113 Fix NPE for backup brokers with connection routers
The nodeID on backup brokers is available only after they become live.
2023-01-26 09:55:31 -05:00
Clebert Suconic 0d3cd8d880 ARTEMIS-4136 Mirrored sync replica
I am adding an option sync=true or false on mirror. if sync, any client blocking operation will wait a roundtrip to the mirror
acting like a sync replica.
2023-01-23 12:38:11 -05:00
Justin Bertram b0ba8cae24 ARTEMIS-4137 MQTT sub-queue clean-up can fail due to auth 2023-01-23 16:18:03 +01:00
Justin Bertram bd99a11780 ARTEMIS-4135 mitigate NPE when browsing 2023-01-17 12:18:58 -06:00
iliya e68034518d ARTEMIS-4129 Add max-saved-replicated-journals-size parameter to primary and replicated policy configuration
Allow override default max-saved-replicated-journals-size value when the server is configured as primary or replicated.
2023-01-17 12:07:10 -06:00
Andy Taylor b02002fc66 ARTEMIS-3875 - adding consumer and producer metrics
https://issues.apache.org/jira/browse/ARTEMIS-3875
2023-01-13 15:49:44 -05:00
Clebert Suconic 4550fcf47c ARTEMIS-4116 Management lock to avoid multiple long running tasks running from user requests 2023-01-13 09:23:51 -05:00
Clebert Suconic b565a8a7b9 ARTEMIS-4114 Avoiding deadlock during scale down
We will rely on existing tests for this change
2023-01-13 09:23:51 -05:00
Clebert Suconic abd62665ce ARTEMIS-4125 Fixing AutoCreateJmsDestinationTest::testAutoCreateOnSubscribeToTopic 2023-01-12 16:17:28 -05:00
Clebert Suconic c231e6a643 ARTEMIS-4125 Fixing AutoCreate Topics remove of the address
This is fixing AutoCreateJmsDestinationTest::testAutoCreateOnSubscribeToTopic
2023-01-12 11:02:35 -06:00
Justin Bertram 114302a093 ARTEMIS-4125 address can be removed inadvertently
When the last non-durable subscriber on a JMS topic disconnects the
corresponding queue representing the subscription is deleted as
expected. However, the queue's address will also be deleted no matter
what, which is *not* expected.
2023-01-09 10:45:56 -06:00
Justin Bertram 56167b5e13 ARTEMIS-4122 support timed refresh for LegacyLDAPSecuritySettingPlugin
Some LDAP servers (e.g. OpenLDAP) do not support the "persistent search"
feature and therefore the existing "listener" feature does not actually
fetch updates. This commit implements a "pull" feature controlled by a
configurable interval equivalent to what is implemented in the cached
LDAP authorization module from ActiveMQ "Classic."
2023-01-07 22:54:35 -06:00
Justin Bertram c354c8e642 ARTEMIS-4016 fixing tests 2023-01-07 22:54:26 -06:00
Robbie Gemmell 0dcb3aba2e ARTEMIS-4110: update a few more files introduced recently from older PRs being merged 2022-12-20 09:45:52 +00:00
AntonRoskvist 04ddeb647c ARTEMIS-4016 Bridges created by management operations are removed on restart and config reload 2022-12-17 10:10:10 -06:00
AntonRoskvist 6dd7965906
ARTEMIS-3834 include paged messages sending to DLA 2022-12-17 00:03:23 -06:00
Clebert Suconic 51a3c6a351
ARTEMIS-3993 Fix test 2022-12-16 13:02:48 -06:00
clebert 16046b368d ARTEMIS-3993 Fixing test when libaio is loaded 2022-12-16 10:35:48 -05:00
Clebert Suconic f5d9eed9ce ARTEMIS-3085 Fixing test and proper wiring listener 2022-12-16 05:27:18 -05:00
Somdatta 00592d6dd8
ARTEMIS-3085 support custom IOCriticalErrorListener 2022-12-15 16:35:20 -06:00
AntonRoskvist 5c2a0d744c
ARTEMIS-4091 - Make scaleDown target more deterministic 2022-12-15 16:05:26 -06:00
Justin Bertram df81bfa567 ARTEMIS-4103 support journal-lock-acquisition-timeout in broker.xml 2022-12-15 13:44:40 -06:00
Erwin Dondorp 065e4246e1 ARTEMIS-3993 changed some MB style uses to use MiB; added support for MiB/GiB/etc in config 2022-12-15 13:14:24 -06:00
Justin Bertram cbd9f63a9d ARTEMIS-4115 ArrayIndexOutOfBoundsException when dup cache size is 0
Allow setting id-cache-size to 0 from broker.xml and ensure the broker
handles this gracefully. Previously you could only set the cache size to
0 via broker properties or programmatically and it would throw an
ArrayIndexOutOfBoundsException when adding an item to the cache.
2022-12-15 13:01:31 -06:00
Domenico Francesco Bruscino fa8d487ff2 ARTEMIS-3866 Authorize management message sending using context subject 2022-12-15 11:51:39 -05:00
Clebert Suconic af9bd7b84a ARTEMIS-4065 Optimize page counters to not use the journal as often
- From now on we will save snapshots of page-counters on the journal (basically for compatibility with previous verions).
  And we will recount the records on startup.

- While the rebuild is being done the value from the previous snapshot is still available with current updates.
2022-12-15 10:30:18 -05:00
Justin Bertram 4924bd6b81
ARTEMIS-4101 fix license syntax 2022-12-13 11:41:27 -06:00
Justin Bertram 499e3c119f ARTEMIS-4101 caching failed authn result on LDAP cxn failures 2022-12-13 09:07:28 -05:00
Gary Tully bd72a4f38d ARTEMIS-3168 - more idomatic usage of mock-server-netty - with hasStarted 2022-12-08 11:31:25 +00:00
Robbie Gemmell f790911c44 ARTEMIS-4110: insert standard ASF licence header comment in various cases, such as to replace a javadoc header 2022-12-07 10:21:25 +00:00
Gary Tully 0004e52355 ARTEMIS-3168 - isolate from leaked login.config system property by seting baseDir option 2022-12-02 17:43:18 +00:00
Gary Tully d95321bf83 ARTEMIS-3168 - fix contention on pem creation and tidy up system properties 2022-12-02 14:33:40 +00:00
Gary Tully 5633de9cb0 ARTEMIS-3168 - fix test dependency on login.config system property being set 2022-12-02 13:21:45 +00:00
Gary Tully 7d537882ca ARTEMIS-3168 - fix test, ref to auto created pem before creation complete 2022-11-25 17:29:05 +00:00
ruromero 3e50014e0d [ARTEMIS-3168] Implement Kubernetes JaaS LoginModule
Signed-off-by: ruromero <rromerom@redhat.com>
2022-11-22 11:44:00 +00:00
Gary Tully eb0aa118b4 NO JIRA - test that shows need for lower case property prefix with existing fluent introspector 2022-11-21 14:13:18 +00:00
Clebert Suconic 0866a2eb88 ARTEMIS-4096 Bridge transfer is broken with AMQP Large messages 2022-11-19 11:57:28 -05:00
Domenico Francesco Bruscino 3a13a7850c ARTEMIS-4077 Add an option to disable XML external entity processing 2022-11-15 10:06:03 -06:00
Clebert Suconic 4f79eb42f5 ARTEMIS-4089 Check on AutoCreation during routing 2022-11-14 15:25:42 -05:00
Šmucr Jan 43824fc494 ARTEMIS-4078 Fix divert reloading
Reloading has been fixed for divert:
* filter
* address
* exclusive

Source address and exclusivity changes require divert redeployment.
2022-11-11 12:00:00 -06:00
Justin Bertram ca580814de ARTEMIS-4085 exclusive LVQ sending all messages to consumer 2022-11-10 13:58:53 -05:00
Domenico Francesco Bruscino 3a5e4ce363 ARTEMIS-4030 Fix SharedStoreLiveActivation race condition
DefaultCriticalErrorListener stops the server while SharedStoreLiveActivation
is initializing it.
2022-11-10 12:09:43 -06:00
Clebert Suconic 03b82142eb ARTEMIS-4084 Fixing addSorted with large transactions
when cancelling a large number of messages, the addSorted could be holding a lock for too long causing the server to crash under CriticalAnalyzer

co-authored: AntonRoskvist <anton.roskvist@volvo.com> (discovering the issue and providing the test ClientCrashMassiveRollbackTest.java)
2022-11-09 15:43:02 -05:00
Justin Bertram dce4ba3c1a [maven-release-plugin] prepare for next development iteration 2022-11-08 13:17:38 -06:00
Justin Bertram 1fd6cb6239 [maven-release-plugin] prepare release 2.27.0 2022-11-08 12:46:20 -06:00
Justin Bertram ccb76c0a2a ARTEMIS-4064 Harden MetricsManager
In order to improve trouble-shooting for the MetricsManager there should
be additional logging and exceptions. In all, this commit contains the
following changes:

 - Additional logging
 - Throw an exception when registering meters if meters already exist
 - Rename a few variables & methods to more clearly identify what they
   are used for
 - Upgrade Micrometer to 1.9.5
 - Simplify/clarify a few blocks of code
 - No longer pass the ManagementServiceImpl when registering the
   metrics, but instead pass the Object the meter is observing (e.g.
   broker, address, or queue)
2022-10-31 09:04:20 -04:00
Robbie Gemmell 92a87b0912 ARTEMIS-4060: temporarily make commons-text an explicit dep of artemis-server for now so dependent projects get the updated dep version 2022-10-26 14:16:12 +01:00
Clebert Suconic 0da14a303d ARTEMIS-4073 Relaxing some locks that were not necessary and were causing dead locks on the testsuite 2022-10-26 07:55:57 -04:00
Clebert Suconic d185735e55 ARTEMIS-4073 Page Counters can go off sync when multiple producers are used in the same address 2022-10-25 21:26:14 -04:00
Justin Bertram 9138cc86ca ARTEMIS-4049 user add fails w/space in broker path
This problem was originally discovered on Windows, but the problem
occurs on *nix as well.
2022-10-19 10:09:33 +01:00
Clebert Suconic 51c50d8546 ARTEMIS-4056 Fixing compatibility with getFirstMessage()
if Empty the previous method was returning new Map[1] and the JSON output would be slightly different and I am playing safe here just in case.
2022-10-18 13:49:32 -04:00
Clebert Suconic 77ad2b0bc0 ARTEMIS-4056 Expanding nextPage check into isDeleted 2022-10-18 11:51:47 -04:00
Clebert Suconic b388a24b26 ARTEMIS-4056 Paging Management optimizations
- optimize startup time on paging (check-depage on startup)
- otpimize getNextPage() on complete pages
- optimize getFirstMessage() and paging. (avoid iterator usage)
2022-10-18 10:45:55 -04:00
Robbie Gemmell 8c209adc99 ARTEMIS 4007: tweak javadoc to stop build failure with newer javadoc plugin 2022-10-17 11:06:48 +01:00
Clebert Suconic e1e728a28e NO-JIRA Debug statement on paging manager 2022-10-16 02:02:19 -04:00
Clebert Suconic 52c45f5aec ARTEMIS-4025 Fixing JSon transient attribute after serialization copy 2022-10-14 15:42:42 -04:00
Gary Tully 3b981b3920 ARTEMIS-4028 - add alder32 checksum to the status of properties files read by the broker 2022-10-13 18:23:09 +01:00
Gary Tully 03ef286cc8 ARTEMIS-4025 - trap failure to apply properties as errors and report via the broker status in a configuration/properties/errors status field 2022-10-13 18:23:09 +01:00
Timothy Bish b900a1e4bd ARTEMIS-4020 Standardize the naming of Logger types for consistency
Attempt to standardize all Logger declaration to a singular variable name
which makes the code more consistent and make finding usages of loggers in
the code a bit easier.
2022-10-13 12:40:45 -04:00
Justin Bertram 0ab098e456
ARTEMIS-4035 all consumers of federated queue drop if only one consumer drops 2022-10-13 10:36:38 -05:00
Clebert Suconic 7b2f7e1707 ARTEMIS-4041 Fixing NPE on SequentialFileFactory after the CriticalIO change 2022-10-12 17:03:13 -04:00
Clebert Suconic 49d33470f9 ARTEMIS-4041 Improve critical IO reporting 2022-10-12 10:50:33 -04:00
Justin Bertram 5343c97c7d ARTEMIS-4022 add auto-delete queue attribute to management 2022-10-11 13:16:46 -04:00
Clebert Suconic 33438c2e44 ARTEMIS-4029 Avoid OME When too many pages are cleared all at once
this is the second part of the fix (I missed the first part) where I am clearig midstream records as well.
2022-10-11 00:26:41 -04:00
Timothy Bish 617269319a ARTEMIS-4020: Remove string appends and various isXEnabled logger checks (add some where useful)
Logger statements should use formatting syntax and let the normal framework checks take care of
checking if a logger is enabled instead of string concats and isXEnabled logger checks except
in cases there is known expense to the specifc logging message/arg preparation or passing.

Changes from myself and Robbie Gemmell.

Co-authored-by: Robbie Gemmell <robbie@apache.org>
2022-10-07 15:40:53 -04:00
Clebert Suconic 42d07458e9 ARTEMIS-4029 Avoid OME When too many pages are cleared all at once
The issue is that depage should not put pages on the used pages as they were not actually intended to read.
instead I should create a newPageObject and not use the RefCounts caching.
2022-10-06 07:53:38 -04:00
Clebert Suconic 18cfdb7049 ARTEMIS-4024 Avoid excessive NativeMemory allocation when sending OpenWire Multi mega sized messages in openwire 2022-10-04 13:35:50 -04:00
Robbie Gemmell f465073744 ARTEMIS-4026: correct connection-router related log statement value and/or level 2022-10-03 15:11:06 +01:00
Clebert Suconic 9647e6555f NO-JIRA small tweak on comment 2022-09-30 11:04:22 -04:00
Robbie Gemmell bd85a3eab7 ARTEMIS-4020: consolidate loggers in ActiveMQTestBase, use placeholders in messages 2022-09-30 11:41:33 +01:00
Robbie Gemmell 1ad1128db2 ARTEMIS-4020: have the concrete classes provide logger to the shared abstract impl instead of using getClass() in parent
followup to 12cc70c5bf PR discussion
2022-09-30 11:38:32 +01:00
Clebert Suconic 2ba6452b83 ARTEMIS-4020 removing ActiveMQTestBase::instanceLog 2022-09-29 17:46:51 -04:00
Clebert Suconic 12cc70c5bf ARTEMIS-4020 Using a little trick to create the Loggers
Trick provided by Tim Bish
2022-09-29 17:46:51 -04:00
Robbie Gemmell 9873fccf74 ARTEMIS-4020: switch to using SLF4J API for logging, use Log4J 2 as impl for broker distribution and tests
PR includes work from myself and Clebert Suconic, squashed from the new-logging branch.
2022-09-28 14:01:54 -04:00