Commit Graph

1229 Commits

Author SHA1 Message Date
Timothy Bish 1361e29739 ARTEMIS-4919 Handle Exception from proton transport process
Handle any exceptions from the proton transport and set the error on the
transport for processing in the events dispatch cycle by adding in handling
of the transport error event.
2024-07-15 15:34:21 +01:00
Justin Bertram fea2be6a3a ARTEMIS-4921 include protocol name in disconnection log message 2024-07-11 10:31:17 -07:00
Justin Bertram ac5713be81 ARTEMIS-4922 remove spurious warn msg when OpenWire client disconnects 2024-07-11 07:13:49 -07:00
Clebert Suconic 0327fc31d8 ARTEMIS-3509 Concurrent Modification Exception on Stomp Transactions
Co-authored with Anant Sony
2024-07-05 14:30:58 -04: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
Timothy Bish c6f227cbb8 ARTEMIS-4820 Read Header TTL as unsigned integer to set expiration
When setting expiration on the AMQPMessage the AMQP header TTL value
should be read as an unsigned integer and as such should use the longValue
API of UnsignedInteger to get the right value to set expiration.
2024-06-17 13:32:43 -05:00
Timothy Bish a6ff05ecd7 ARTEMIS-4817 Check policy credits before checking parent credits
When checking if address federation can be done the manager needs to look
at the policy level settings before looking at federation or connector
level settings for amqp credits.
2024-06-13 15:35:00 -07:00
Clebert Suconic f4fd259f07 [maven-release-plugin] prepare for next development iteration 2024-06-12 11:58:53 -04:00
Clebert Suconic b4d3a77649 [maven-release-plugin] prepare release 2.35.0 2024-06-12 11:58:52 -04:00
Clebert Suconic 4eb90765a7 ARTEMIS-4813 Large Message in replication / sync could lose part of the body
This is a regressio after ARTEMIS-4784
2024-06-12 00:31:22 -04:00
Justin Bertram 14c564a481 ARTEMIS-4800 simplify QueueConfiguration API
This commit does the following:

 - deprecate all QueueConfiguration ctors
 - add `of` static factory methods for all the deprecated ctors
 - replace any uses of the normal ctors with the `of` counterparts

This makes the code more concise and readable.
2024-06-10 07:58:40 -07:00
Clebert Suconic 5be983392c ARTEMIS-4798 Use original message to calculate the Mirror SNF size in order to start paging 2024-06-07 11:10:12 -04:00
Timothy Bish fad1f5274c ARTEMIS-4799 Fix broker connection receiver attach handling
The receiver attach in broker connection does not wait for the remote
attach to arrive before creating the broker side receiver plumbing which
leads to the broker treating the remote sender as an anonymous relay when
it is not and should not be. Await the remote attach in response to the
attach sent by the broker connection to finish the link setup but use the
locally defined target address vs the remote to route the incoming messages.
2024-06-07 11:21:42 +01:00
Timothy Bish ac1b483cb4 ARTEMIS-4801 Fix issue with caching address query results
When caching address query results the remote session can be blocked forever
from creating links on an address if the "does not exist" value is cached
since it is never updated again and will always report "does not exist" even
if the address is added manually via management later. The cache state can
cause other issues for long running sessions as well and should be removed
to avoid attach failures for cases where the current broker state could allow
the attach to succeed but the cached entry won't allow it.
2024-06-06 21:07:22 -04:00
Justin Bertram 7ca30e9a63 ARTEMIS-4796 simplify SimpleString API
This commit does the following:

 - deprecate the verbosely named `toSimpleString` static factory
   methods
 - add `of` static factory methods for all the ctors
 - replace any uses of the normal ctors with the `of` counterparts

This makes the code more concise and readable.
2024-06-06 11:53:03 -04:00
Robbie Gemmell 4ebb2cd41a ARTEMIS-4790: switch to timeout declarations with default units, tweak a few values 2024-06-05 11:40:33 +01:00
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 362dbd11ac ARTEMIS-4790: use JUnit 5 for the tests 2024-06-03 10:06:37 -05: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 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
Timothy Bish 3244965155 ARTEMIS-4771 AMQP Large Message Writer no-op staged write if already closed
If the writer is closed while flow controlled write attempts are pending in the
connection executor an NPE is thrown which should be avoided as the closed state
should trigger the writes to stop. Add fix and test that checks that this works
as it should.
2024-05-23 17:42:34 +01:00
Justin Bertram 3c058e98f1 ARTEMIS-3622 MQTT can deadlock on client cxn/discxn
This commit fixes the deadlock described on ARTEMIS-3622 by moving the
synchronization "up" a level from the MQTTSession to the
MQTTConnectionManager. It also eliminates the synchronization on the
MQTTSessionState in the MQTTConnectionManager because it's no longer
needed. This change should not only eliminate the deadlock, but improve
performance relatively as well.

There is no test associated with this commit as I wasn't able to
reproduce the deadlock with any kind of straight-forward test. There was
a test linked on the Jira, but it involved intrusive and fragile
scaffolding and wasn't ultimately tenable. That said, I did test this
fix with that test and it was successful. In any case, I think static
analysis should be sufficient here as the changes are pretty
straight-forward.
2024-05-21 15:15:44 +01:00
Clebert Suconic e47d8ea7c1 ARTEMIS-4774 Fixing PageCounters out of sync after AckMnager retries 2024-05-17 09:47:34 -04:00
Clebert Suconic 23ca774f43 NO-JIRA fixing logger.info as logger.debug 2024-05-06 08:59:07 -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
Clebert Suconic 14e83faa1b ARTEMIS-4750 AMQP Large Message flow control to use runAfter
The resume delivery on AMQP Large Message Writer is using runNow.
When a flow control is paused and then resumed, the runNow will make the first read to happen inline to the thread that's resuming other deliveries.
It would be better to not run the delivery within the same call. Hence the change here is simple, being just using a connection.runLater instead of runNow.
I have seen this on a thread dump from a production server.
No semantic issues were encountered but there was a theory that the Netty thread responsible to resume would be busy with a delivery when not supposed to.
Better to be safe on this case.
2024-05-01 13:51:04 -04: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
Justin Bertram 61e52ae0fd ARTEMIS-4705 remove unnecessary field from STOMP HeartBeater 2024-04-23 20:02:00 -05:00
Clebert Suconic 44e78d42a2 ARTEMIS-4733 Internal queues should not be mirrored 2024-04-22 00:06:07 -04:00
Justin Bertram ed59b0ea91 ARTEMIS-4727 fix STOMP durable sub doc and property precedence 2024-04-19 23:42:47 -05:00
Clebert Suconic 6fe53b813a ARTEMIS-4731 OpenWireConnection exception listener should call transport.close();
this is causing a leak for server objects
2024-04-19 00:57:16 -04:00
Timothy Bish 329d963717 ARTEMIS-4725 Fix AMQP outgoing encoding if da encoded before header
Fix the AMQP message scanning to account for the header not being at the
front of the buffer which also accounts for odd case of broker storing
message with delivery annotations ahead of the header.
2024-04-16 14:52:59 -04:00
Clebert Suconic 162c4f6655 ARTEMIS-4498 Making queues always manageable 2024-04-11 10:28:04 -04: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
aslepykh fc13a39c6f
ARTEMIS-4695 DLS_DEAD_LOCAL_STORE in AMQPLargeMessage.java
The local variable constructorPos is initialized with the value of
buffer.position() in line 330, but the variable itself is not used
anywhere else, which may indicate an error.
2024-03-19 13:55:36 -05:00
aslepykh 97a9c690ae
ARTEMIS-4695 BAD_COPY_PASTE in VersionedStompFrameHandler.java
In 1st branch (line 274) of the if() statement, the
Boolean.parseBoolean() method accepts the value
frame.getHeader(Stomp.Headers.Subscribe.NO_LOCAL), which is used in line
273.

In 2nd branch (line 276), the Boolean.parseBoolean() method accepts the
value frame.getHeader(Stomp.Headers.Subscribe.NO_LOCAL), although the
other value frame.hasHeader(Stomp.Headers.Subscribe.ACTIVEMQ_NO_LOCAL)
is used.

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author A. Slepykh.
2024-03-19 13:49:32 -05:00
Justin Bertram 50fae08b09 ARTEMIS-4657 support better correlation ID compat b/w JMS clients 2024-03-18 13:19:22 +00:00
Clebert Suconic 11b7671960 ARTEMIS-4684 Internal Queues should not redistribute
This is particularly true for the Mirrored SNF queue. Redistribution is not meant for internal queues. If an internal queue happens to have the same name on another server, it should not trigger redistribution when consumers are removed.

It would be possible to work around this by adding an address-setting specific to the address with redistribution disabled.

ClusteredMirrorSoakTest was intermittently failing because of this. For a few seconds while the mirror connection is still being made connections could move messages from one node towards another node if both have the same name.
2024-03-13 09:26:47 -04:00
Clebert Suconic c83ed8957d ARTEMIS-4668 Moving AMQP Large Message file handling away from Netty thread 2024-03-06 15:21:01 -05:00
Clebert Suconic 5ce70f9e37 ARTEMIS-4669 Clarify Storage Manager usage around large messages 2024-03-05 17:27:18 -05:00
Clebert Suconic b5791344b4 ARTEIS-4651 Speeding up delivery resume when SNF is paged 2024-03-04 10:47:12 -05: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