Commit Graph

1220 Commits

Author SHA1 Message Date
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
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 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
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
Justin Bertram 20840cfdf1 ARTEMIS-4639 NPEs when TopologyMember's primary is null 2024-02-09 10:43:50 +00:00
Clebert Suconic 057709e948 NO-JIRA removing not implemented class
We should add this class back when implemented.
2024-02-07 11:45:28 -05:00