Commit Graph

1044 Commits

Author SHA1 Message Date
Justin Bertram 6b5a73db8a
ARTEMIS-3913 custom MQTT client ID rejection
Sometimes users want to perform custom client ID validation, and in the
case of an invalid client ID the proper reason code should be returned
in the CONNACK packet.
2022-09-14 11:50:36 -05:00
Timothy Bish 289587f004 ARTEMIS-3990 Ensure that readable buffer string read consumes the bytes
Ensures that when reading a string the readable buffer consumes the
bytes by advancing the read index as defined in the interface API docs.
2022-09-13 17:17:11 -04:00
Clebert Suconic 902c0cb62b NO-JIRA Removing dead code - AmqpReadableBuffer 2022-09-13 17:16:51 -04:00
Clebert Suconic 4ad830fb95 Bumping artemis as 3.0
After removing ActiveMQ Artemis rest (per ARTEMIS-3987), we should start promoting Artemis as 3.0
2022-09-12 15:09:31 -04:00
Clebert Suconic 11eab60584 [maven-release-plugin] prepare for next development iteration 2022-08-30 18:04:06 -04:00
Clebert Suconic fb1b362b47 [maven-release-plugin] prepare release 2.25.0 2022-08-30 18:04:05 -04:00
Justin Bertram 755b987ab1
ARTEMIS-3958 sending LWT may recurse infinitely if disk full
Due to the changes in 682f505e32 we now
send "Last Will & Testament" MQTT messages via ServerSession. This means
sending will fail if the disk is full. For MQTT this triggers a
connection failure which in turns triggers sending an LWT message. This
process will recurse infinitely until it results in a
java.lang.StackOverflowError.

This commit fixes that by tracking whether or not sending a LWT message
is already in progress.
2022-08-26 11:13:01 -05:00
Justin Bertram a0f39a4b28 ARTEMIS-3956 clean up use of RemotingConnection
org.apache.activemq.artemis.spi.core.protocol.RemotingConnection has a
number of implementations most notably an abstract version which
provides many methods shared among the implementations. The sharing
could be improved to eliminate duplicate code.

This commit eliminates more than 700 lines of unnecessary code.

There should be no semantic changes.
2022-08-25 18:12:11 -04:00
Justin Bertram 729fdc4aab ARTEMIS-3955 consolidate Subject on RemotingConnection 2022-08-25 18:12:11 -04:00
Justin Bertram 682f505e32
ARTEMIS-3942 use session instead of direct routing for MQTT LWT messages
Using direct routing skips authorization for "Last Will and Testament"
messages (a.k.a. "will" messages). This commit fixes that problem by
using the internal session that is established for normal message
production and consumption.
2022-08-17 12:29:01 -05:00
Clebert Suconic 568eb70fcd ARTEMIS-3929 Improving OpenWire clientIDSet
I have seen this contention while I was testing ARTEMIS-3928

This does change any semantics and current tests should be enough to validate this change
2022-08-10 19:29:29 -04:00
Clebert Suconic 4a7710918d NO-JIRA Moving HQ Converter into HQ client module 2022-08-02 14:32:48 -04:00
Justin Bertram dd61a651b1 ARTEMIS-3916 fix OpenWire selector with JMSMessageID
The OpenWire JMS client shipped with ActiveMQ "Classic" uses the
client's hostname as part of the `JMSMessageID`. Consumers may use this
data to select messages sent from particular hosts. Although this is
brittle and not recommended it is nonetheless possible.

However, when messages arrive to ActiveMQ Artemis they are converted
to core messages, and the broker doesn't properly map the selector from
`JMSMessageID` to the corresponding property on the underlying core
message. This commit fixes that problem. Changes include:

 - Mapping selector from JMSMessageID to the internal __HDR_MESSAGE_ID
 - Relocating some constant values so that both the protocol and commons
   module can use them
 - Adding a test
2022-08-02 09:29:25 -04:00
Clebert Suconic fa002728f2 [maven-release-plugin] prepare for next development iteration 2022-07-26 11:59:21 -04:00
Clebert Suconic 897d9beaef [maven-release-plugin] prepare release 2.24.0 2022-07-26 11:59:19 -04:00
Clebert Suconic 79daf49105 [maven-release-plugin] prepare for next development iteration 2022-07-21 17:44:35 -04:00
Clebert Suconic cc4867ccba [maven-release-plugin] prepare release 2.24.0 2022-07-21 17:44:33 -04:00
Clebert Suconic da38fcce71 NO-JIRA reformat AMQPMirrorControllerTarget 2022-06-30 17:37:27 -04:00
iliya d90179b99c ARTEMIS-3815 proper retry through IOCompletion when message not found on target queue on Mirror
co-authored Clebert Suconic
2022-06-30 17:37:27 -04:00
Clebert Suconic 68f6d8263d ARTEMIS-3743 / ARTEMIS-3766 Use ACKReason on Mirror to determine target operations and fixing Delivering statistics on Mirror
I merged these two JIRAs into one as I was doing an overal check on Mirroring
2022-06-29 19:20:03 -04:00
Clebert Suconic 56e9d9525d ARTEMIS-3864 Removing debug statement 2022-06-21 16:53:17 -04:00
Clebert Suconic c1fd16d66a ARTEMIS-3864 StompTransactions leaking on ActiveMQServer.getSessions()
After a TX in stomp is committed, a session will never be cleared from ActiveMQServer
2022-06-17 16:57:35 -04:00
Clebert Suconic 342565d4c1 ARTEMIS-3850 Eliminate Page Soft Cache. Add Option to read messages based on sizing. 2022-06-14 14:53:14 -04:00
Justin Bertram c9208aafda ARTEMIS-3851 MQTT sub q exists after restart despite CleanSession=1
MQTT 3.1 and 3.1.1 clients using a clean session should have a
*non-durable* subscription queue. If the broker restarts the queue
should be removed. This is due to [MQTT-3.1.2-6] which states that the
session (and any state) must last only as long as the network
connection.
2022-06-14 14:48:45 -04:00
Clebert Suconic 0fab0dae91 [maven-release-plugin] prepare for next development iteration 2022-06-07 12:39:09 -04:00
Clebert Suconic 224ca0d4d7 [maven-release-plugin] prepare release 2.23.0 2022-06-07 12:39:07 -04:00
AntonRoskvist 548747c71d
ARTEMIS-3827 anon OpenWire producer may lose sent msg 2022-05-23 13:11:15 -05:00
Erwin Dondorp cbd8df6459
ARTEMIS-3824 also display replyTo address when available in the message 2022-05-23 12:12:18 -05:00
Clebert Suconic 9b959c2fec ARTEMIS-3837 Adding support for AMQPLargeMessage.getData() 2022-05-18 08:48:08 -04:00
Domenico Francesco Bruscino f632e8104b ARTEMIS-3833 Preserve JMSCorrelationID of distributed AMQP large messages 2022-05-17 10:13:55 -04:00
Justin Bertram 3a0658c202 ARTEMIS-3770 mitigate potential NPE
This was being triggered by
org.apache.activemq.artemis.tests.integration.routing.MQTTRedirectTest.
2022-05-10 18:55:56 -04:00
Justin Bertram 446ff61542
ARTEMIS-3770 refactor MQTT handling of client ID
It would be useful for security manager implementations to be able to
alter the client ID of MQTT connections.

This commit supports this functionality by moving the code which handles
the client ID *ahead* of the authentication code. There it sets the
client ID on the connection and thereafter any component (e.g. security
managers) which needs to inspect or modify it can do so on the
connection.

This commit also refactors the MQTT connection class to extend the
abstract connection class. This greatly simplifies the MQTT connection
class and will make it easier to maintain in the future.
2022-05-09 14:51:06 -05:00
iliya 0b321ab8ff ARTEMIS-3759 Add mirror controller address filter support
Allow replication only certain addresses with mirror controller.
The configuration is similar to cluster address configuration.

Co-authored-by: Robbie Gemmell <robbie@apache.org>
2022-05-04 21:25:58 -04:00
Robbie Gemmell 8786bc9e5e ARTEMIS-3814: update activemq deps to 5.17.1 2022-05-04 13:25:17 +01:00
Clebert Suconic 57fa8b8271 [maven-release-plugin] prepare for next development iteration 2022-04-27 17:26:46 -04:00
Clebert Suconic 1a49845628 [maven-release-plugin] prepare release 2.22.0 2022-04-27 17:26:45 -04:00
Justin Bertram 3339ca8b68
ARTEMIS-3801 fix test 2022-04-26 09:54:22 -05:00
Justin Bertram 506d59db03 ARTEMIS-3801 not getting messages on MQTT subscriptions with $ 2022-04-25 21:41:20 -04:00
Marco Roehrs 83afe0e276 ARTEMIS-3798 Allow binary deserialization of message properties AMQ_MSG_MESSAGE_ID, AMQ_MSG_ORIG_DESTINATION, AMQ_MSG_PRODUCER_ID & AMQ_MSG_REPLY_TO from existing messages.
co-authored: Justin Bertram contributed OpenWireMessageConverterTest changes
2022-04-25 09:43:46 -04:00
iliya 99302b1935 ARTEMIS-3753 Prevent sending message to internal queues on mirror
In cluster configuration messages could be routed to internal queues for
further delivering on different broker. We need to check that before
sending to SNF, otherwise message can stuck on target server and will
never receive ACK.

co-author: Clebert Suconic

Discusssions on https://github.com/apache/activemq-artemis/pull/4012 and https://github.com/apache/activemq-artemis/pull/4038
2022-04-23 10:13:21 -04:00
AntonRoskvist 84e68c76e9 ARTEMIS-3771 Avoid not needed lookup for address on OpenWire connections 2022-04-21 16:46:26 -04:00
Justin Bertram 97b4f6a578 ARTEMIS-3788 don't send MQTT will message if will flag = false 2022-04-21 16:38:27 -04:00
Justin Bertram 96fa98fc93 ARTEMIS-3789 respect session expiry interval on MQTT disconnect message 2022-04-21 15:33:56 -04:00
Clebert Suconic d1e1faacc4 ARTEMIS-3791 Openwire failover leaving sessions leaked 2022-04-21 14:43:09 -04:00
AntonRoskvist 32c5f9d268 ARTEMIS-3780 - OpenWire, UTF8Buffer to String before setting properties to avoid exception 2022-04-20 12:22:32 -04:00
Justin Bertram c5f45ee44d ARTEMIS-3781 send PUBREC on duplicate PUBLISH for MQTT QoS 2
The MQTT 5 (and 3.1.1) specification states:

    Until it has received the corresponding PUBREL packet, the receiver
MUST acknowledge any subsequent PUBLISH packet with the same Packet
Identifier by sending a PUBREC. It MUST NOT cause duplicate messages to
be delivered to any onward recipients in this case [MQTT-4.3.3-10].

The broker prevents a duplicate message, but it doesn't respond with a
PUBREC. This commit fixes that.
2022-04-20 12:01:47 -04:00
Justin Bertram b5539b9da4 NO-JIRA Fix MQTT trace logging NPE 2022-04-20 12:01:47 -04:00
Justin Bertram 40a191379b ARTEMIS-3775 don't carry forward MQTT topic aliases to new connection 2022-04-18 21:10:49 -04:00
Justin Bertram 7d11cf81ba ARTEMIS-3777 fix MQTT request/response + nolocal
Removing the connection ID property from the actual *message* breaks the
nolocal functionality. Removing the property isn't necessary in the
first place so this commit reomves that code.
2022-04-18 18:26:05 -04:00
Justin Bertram 1e1397935a NO-JIRA improve MQTT trace logging 2022-04-18 18:26:05 -04:00