Commit Graph

668 Commits

Author SHA1 Message Date
Benjamin Graf 4ae8c7bab3 ARTEMIS-1985: Switch from XA_RDONLY to XA_OK as return value for prepare transaction via OpenWire 2018-07-31 12:41:53 -04:00
Justin Bertram e2bae7856d ARTEMIS-1941 fix failing tests 2018-07-09 17:35:51 -04:00
Timothy Bish a63b0315c4 ARTEMIS-1941 Preserve AMQP body section type on "large" messages
When "large" messages are converted to / from core in order to be stored
in the large message store the type of the AMQP body section is being
lost and reconstituted incorrectly in some cases.  The message needs to
be annotated with the original AMQP type for the body and that used to
manage the conversion back to AMQP from Core.
2018-07-02 13:58:45 -05:00
Clebert Suconic efd966d88d ARTEMIS-1928 Fixing body conversion of LargeMessages to AMQP 2018-06-22 15:48:15 -04:00
Justin Bertram c0d28432ad NO-JIRA STOMP frame logging 2018-06-22 15:47:14 -04:00
Justin Bertram 1ed7a616ee ARTEMIS-1930 require STOMP durable sub name to unsubscribe 2018-06-22 15:47:14 -04:00
Robbie Gemmell ed2a18f1c4 ARTEMIS-1940: restore use of copying send in certain edge cases
Avoids pooling corner cases interacting with ARTEMIS 1843 + ARTEMIS 1861 improvements.

Also tagging ARTEMIS-1941 to note test needs altered along with it.
2018-06-18 19:30:26 +01:00
Robbie Gemmell 9a3442f0bd ARTEMIS-1934: fix handling/accounting of sent amqp connection data
updates max frame size tests to verify behaviour seen with standalone
brokers rather than non represenative test-only conditions, as well
as more closely validate the recieved messages
2018-06-15 20:27:28 +01:00
Clebert Suconic b360fa6063 ARTEMIS-1935: Close of openwire connection should closes all open sessions
This is my ammending to the last commit
I'm adding some extra verifications to the test
and I fixed a leak that already existed on the previous map
2018-06-15 10:33:55 -04:00
Benjamin Graf 39871157b4 ARTEMIS-1935: Close of openwire connection should closes all open sessions 2018-06-15 10:33:55 -04:00
Keith Wall 89f6350c1c ARTEMIS-1893: Treat the detach of a link with expiry policy of link-detatch as if closed flag were true. 2018-06-12 10:12:19 -04:00
Clebert Suconic cb793e0e98 ARTEMIS-1924 Add amqpIdleTimeout 2018-06-11 18:37:11 -04:00
Clebert Suconic de0747a9a4 ARTEMIS-1920 AMQP throw NPE if can't find a backup server 2018-06-08 17:42:37 -04:00
Justin Bertram dc29a55e1b ARTEMIS-1900 fix race in STOMP auto-create 2018-06-07 11:24:51 -04:00
Justin Bertram 5b7b84a1b3 ARTEMIS-1903 Log STOMP ERROR frames at WARN 2018-06-04 12:01:02 -04:00
Justin Bertram c1b0f1eb85 ARTEMIS-1897 use core session for STOMP authn 2018-06-04 12:01:02 -04:00
Clebert Suconic 1ae2784dc6 ARTEMIS-1858 Expiry messages are not transversing clustering with AMQP 2018-05-30 18:57:38 -04:00
Michael André Pearce 659d23cb28 ARTEMIS-1872 Fixing address security checks
Ensure CREATE_ADDRESS is honored and behavior is consistent across protocols.
2018-05-24 05:23:41 +01:00
Clebert Suconic 3a5971ec81 ARTEMIS-1872 Improving Security Checks on AMQP Protocol
Also improving test coverage on SecureConfigurationTest
This commit will fix JMSConnectionWithSecurityTest.
2018-05-23 15:01:41 -04:00
Michael André Pearce a9d9731f0a ARTEMIS-1872 Check for queue exists before creating shared queue
1. Add tests case to verify issue and fix, tests also tests for same behavior using CORE, OPENWIRE and AMQP JMS Clients.
2. Update Core Client to check for queue before creating, sharedQueue as per createQueue logic.
3. Update ServerSessionPacketHandler to handle packets from old clients to perform to implement the same fix server side for older clients.
4. Correct AMQP protocol so correct error code is returned on security exception so that amqp jms can correctly throw JMSsecurityException
5. Correct AMQP protocol to check for queue exists before create
6. Correct OpenWire protocol to check for address exists before create
2018-05-23 13:11:25 -04:00
Justin Bertram 8d64f741a1 ARTEMIS-1873 STOMP heartbeater left alive on cxn destroy 2018-05-22 17:07:31 -05:00
Francesco Nigro f24d97bfd1 ARTEMIS-1868 Openwire doesn't add delivery count in client ack mode
If a client ack mode consumer receives a message and closes without
acking it, the redelivery of the message won't set the redelivery
flag (JMSRedelivered) because it doesn't increment the delivery count
when message is cancelled back to queue.
(Perf improvement)
2018-05-21 18:02:40 -04:00
Howard Gao 47b31b53d6 ARTEMIS-1868 Openwire doesn't add delivery count in client ack mode
If a client ack mode consumer receives a message and closes without
acking it, the redelivery of the message won't set the redelivery
flag (JMSRedelivered) because it doesn't increment the delivery count
when message is cancelled back to queue.
2018-05-21 18:00:08 -04:00
Clebert Suconic af56b67e38 [maven-release-plugin] prepare for next development iteration 2018-05-16 11:03:26 -04:00
Clebert Suconic bcaa11c2ee [maven-release-plugin] prepare release 2.6.0 2018-05-16 11:03:14 -04:00
Robbie Gemmell f0bac1bf18 ARTEMIS-1862: fix 'amqpLowCredits' XML config, update related code defaults 2018-05-11 21:07:02 +01:00
Timothy Bish 9e008523b5 ARTEMIS-1861 Set a max-frame-size on AMQP connections by default
Configure a value of 128KB for AMQP max frame size by default to improve
overall performance and provide a limit on delivery size before chunking
begins.
2018-05-11 12:57:56 -04:00
Justin Bertram 90a604da20 ARTEMIS-1834 don't alter STOMP 'destination' header when using prefix 2018-05-08 15:28:46 -05:00
Benjamin Graf faec43530d ARTEMIS-1768: Update to fix handling of internalSession for OpenWireConnection 2018-05-05 16:35:39 +02:00
Justin Bertram 3016db699d ARTEMIS-1848 auto-delete auto-created queue for OpenWire 2018-05-03 14:22:20 -05:00
Benjamin Graf 08fd2acb24 ARTEMIS-1768: Fix handling of internalSession for OpenWireConnection 2018-05-03 12:23:57 -04:00
Timothy Bish c1cf9ef12d ARTEMIS-1843 Update Qpid JMS 0.32.0 and Proton-j 0.27.1
Use new no copy variants for the delivery send and receive and make
use of the ReadableBuffer type that is now used to convery tranfer
payloads without a copy.  Also set max outgoing frame size to match
the configured maxFrameSize for the AMQP protocol head to avoid the
case where an overly large frame can be written instead of chunking
a large message.
2018-05-03 12:10:25 -04:00
Clebert Suconic 384e1aa4d5 ARTEMIS-1838 Fixing AMQP->Core Race on durable property 2018-04-30 17:30:22 -04:00
Justin Bertram d773e8f66b ARTEMIS-1794 STOMP clients using same addr w/diff routing types 2018-04-26 21:20:07 -04:00
Francesco Nigro 4d27f2e7d7 ARTEMIS-1816 OpenWire should avoid ByteArrayOutputStream lazy allocation
OpenWireMessageConverter::toAMQMessage on bytes messages is lazy
allocating a write buffer with a default size of 1024 even when
it won't be used to write anything.
It avoid an useless allocation by reducing it to new byte[0].
2018-04-20 10:26:33 -04:00
Justin Bertram 106c52a741 ARTEMIS-1793 fix property detection 2018-04-19 13:28:30 -04:00
Justin Bertram a72046a0e3 ARTEMIS-1793 fix 'destination-type' STOMP header (fix) 2018-04-18 11:53:54 -04:00
Justin Bertram 81d9c74d6f ARTEMIS-1792 race in STOMP unsubscribe 2018-04-17 11:04:44 +08:00
Christopher L. Shannon (cshannon) bddfa4892b ARTEMIS-1803 - Pass ServerConsumer to messageExpired and
messageAcknowledged plugin callback methods

Knowing the consumer that expired or acked a message (if available) is
useful and right now a message reference only contains a consumer id
which by itself is not unique so the actual consumer needs to be passed
2018-04-14 10:34:09 -04:00
Stanislav Knot 5063488b21 ARTEMIS-1798 DEBUG message bad write method arg count - fix 2018-04-10 13:23:30 -04:00
Clebert Suconic 396056ce04 ARTEMIS-1796 AMQP flush during handshake can break SASL 2018-04-09 13:11:41 -04:00
Timothy Bish fc32bc0b07 ARTEMIS-1780 Handle conversion of large ObjectMessage types
Make sure the correct buffer is used when decoding the stored Core
message that originated from the conversion of an AMQP message sent and
annotated as a JMS ObjectMessage which trips the large message boundary.
2018-04-03 22:27:43 -04:00
Francesco Nigro f6e8345dbe ARTEMIS-1772 Reduce memory footprint and allocations of QueueImpl
It includes:
- Message References: no longer uses boxed primitives and AtomicInteger
- Node: intrusive nodes no longer need a reference field holding itself
- RefCountMessage: no longer uses AtomicInteger, but AtomicIntegerFieldUpdater
2018-04-03 11:01:38 -04:00
Clebert Suconic e86acd4824 ARTEMIS-1765 Fixing Large Message Compression and Conversion 2018-03-22 16:11:11 -04:00
Ulf Lilleengen be6cb7a22f ARTEMIS-1748: Cleanup connections when client connector is destroyed 2018-03-22 10:46:40 -05:00
gtully 72ec6c8e0b [ARTEMIS-1758] support SASL EXTERNAL with TextCertLoginModule
- rework proton handler to use saslListener
2018-03-22 10:09:58 -04:00
Clebert Suconic a7333bcf9d ARTEMIS-1286 Fixing MQTT Bytes message encode 2018-03-14 18:39:58 -04:00
Clebert Suconic 920af19adb [maven-release-plugin] prepare for next development iteration 2018-03-12 12:46:27 -04:00
Clebert Suconic 5f5b1dcf8f [maven-release-plugin] prepare release 2.5.0 2018-03-12 12:46:16 -04:00
Timothy Bish 169d0b7fa7 ARTEMIS-1722 Don't copy message bytes unless needed
Alternate patch that doesn't copy the message bytes unless doing a
redelivery or skipping delivery annotations in the original version of
the message.  Proton-J will copy the bytes provided to the Sender's send
method so a copy isn't necessary on most common sends.
2018-03-06 18:44:22 -05:00
Christopher L. Shannon (cshannon) 29250466ae ARTEMIS-1727 - Make sure transport is stopped on failed OpenWire
connection

To prevent a socket from hanging open by a bad client the broker should
make sure to stop the transport if a connection attempt fails by an
OpenWire client
2018-03-05 07:45:42 -05:00
Christopher L. Shannon (cshannon) da3dd29101 ARTEMIS-1726 - check proper permissions when using OpenWire
Ensure that on queue creation and deletion that the proper permissions
are checked
2018-03-02 16:47:23 -05:00
Timothy Bish 79674ca5db ARTEMIS-1504 Update Qpid JMS to 0.30.0 and proton-j to 0.26.0
Updates to latest Qpid JMS and the latest Proton-J release
2018-03-02 08:57:20 -05:00
Christopher L. Shannon (cshannon) 8e9ee80892 ARTEMIS-1711 - Fix openwire exlusive divert
Fixing the failure on send from an OpenWire producer when an exclusive
divert exists
2018-02-28 17:35:56 -05:00
Christopher L. Shannon (cshannon) d4041b5a72 ARTEMIS-1713 - Fix NPE inside OpenWireConnection
fix NPE inside getClientId() in OpenWireConnection
2018-02-28 14:06:36 -05:00
Timothy Bish 8fc1e00d88 ARTEMIS-1712 Add additional null check in TX rollback handler
Check for AMQSession being null before handling various TX state checks
in order to ensure the correct errors are thrown and TX rollback is
handled properly.
2018-02-28 10:46:31 -05:00
Timothy Bish 38fb17703b ARTEMIS-1707 Check for already exists exceptions and ignore
For address and queue create check for the already exists exceptions and
ignore as another client might have just created the same
2018-02-27 16:30:45 -05:00
Francesco Nigro b5fa5ed3b7 ARTEMIS-1656 OpenWire scalability improvements
OpenWireFormat instances are shared between OpenWire connections/sessions/consumers, preventing the clients to scale due to the synchronized marshal/unmarshal on it.

It includes:
- direct transport buffer pooling
- groupId SimpleString pooling
- clientId SimpleString pooling
- reduced ActiveMQDestination[] and AtomicLong allocations on AMQSession:send
- reduced ActiveMQDestination allocations
- refactored shouldBlockProducer path of AMQPSession::send to reduce method size
- exclusive OpenWireFormat per session and connection (in/out) to avoid contention
- refactored trace log to favour inlining
- changed lastSent volatile set into lazy set to avoid full barrier cost on x86
- stateless OpenWireMessageConverter
- send's lock removal thanks to thread-safe NettyConnection
2018-02-27 20:41:24 +08:00
Christopher L. Shannon (cshannon) 2ea0dce6c7 ARTEMIS-1695 - Improve STOMP compatiblity with 5.x clients
Also make sure on authentication error in version 1.0 a client will
disconnect
2018-02-22 16:22:40 -05:00
Dejan Bosanac 1f06ec07e6 ARTEMIS-1685 Set MQTT connection clientID before session creation 2018-02-20 23:54:08 -05:00
Clebert Suconic 5480d7bc5b NO-JIRA Fixing Deadlock on MQTTConnection
Found during a testsuite run
2018-02-14 10:59:23 -05:00
Clebert Suconic 996871e37c ARTEMIS-1675 Adding --safe option on print-data
This is good when you are a customer and an artemis engineer (e.g. me) asks your journal print-data but you can't do it because that would expose your user's data. If you do artemis data print --safe, that will only expose the journal structure without exposing user's data and eliminate any liability between the engineer and users.
2018-02-12 16:01:09 -05:00
Christopher L. Shannon (cshannon) ea70af15a3 ARTEMIS-1663 - Add new message count and size metrics
Adding new metrics for tracking message counts and sizes on a Queue.
This includes tracking metrics for pending, delivering and scheduled
messages.  The paging store also tracks message size now.
2018-02-08 11:35:12 -05:00
Michael André Pearce dc41f3ca49 ARTEMIS-853 Support for exclusive consumers
Support exlusive consumer
Allow default address level settings for exclusive consumer
Allow queue level setting in broker.xml
Add the ability to set queue settings via Core JMS using address. Similar to ActiveMQ 5.X
Allow for Core JMS client to define exclusive consumer using address parameters
Add tests
2018-02-07 15:27:29 +00:00
Stanislav Knot a259b6972c ARTEMIS-1646 fix for browsing messages sent via JS client 2018-02-05 16:10:02 +00:00
Justin Bertram 9c8bf2f2ca ARTEMIS-1644 legacy clients can't access resources with old prefixes 2018-01-31 18:13:29 -05:00
Clebert Suconic 5653ec9980 ARTEMIS-1639 Simplifying/fixing test and improving update topology 2018-01-31 18:05:32 -05:00
Howard Gao 1693db0177 ARTEMIS-1639 HornetQClientProtocolManager sending unsupported packet
HornetQClientProtocolManager is used to connect HornteQ servers.
During reconnect, it sends a CheckFailoverMessage packet to the
server as part of reconnection. This packet is not supported by
HornetQ server (existing release), so it will break the backward
compatibility.

Also fixed a failover issue where a hornetq NettyConnector's
ConnectorFactory is serialized to the clients who cannot
instantiate it because class not found exception.
2018-01-31 18:05:32 -05:00
jostbg 6483f139f3 ARTEMIS-1629 Set cxn clientID before validating 2018-01-23 16:37:03 -06:00
Justin Bertram 439761d6b8 ARTEMIS-1408 document synchronization 2018-01-23 17:07:33 +00:00
Francesco Nigro 56d68f0b72 ARTEMIS-1607 OpenWire is sending responses too early with durable messages
AMQSession is sending response back without waiting past I/O tasks on StorageManager to be finished
2018-01-23 11:51:41 -05:00
Francesco Nigro 0387b1a842 ARTEMIS-1616 OpenWire improvements
Refactored OpenWireMessageConverter::inbound into a private static method
2018-01-22 18:02:03 -05:00
Francesco Nigro c6b6dd95d1 ARTEMIS-1616 OpenWire improvements
Refactored OpenWireMessageConverter::toAMQMessage into smaller methods
2018-01-22 18:02:03 -05:00
Francesco Nigro e7a1dca7b5 ARTEMIS-1616 OpenWire improvements
Used SimpleString on AMQSession with HDR_DUPLICATE_DETECTION_ID and CONNECTION_ID_PROPERTY_NAME
2018-01-22 18:02:03 -05:00
Francesco Nigro 9650c80ba7 ARTEMIS-1616 OpenWire improvements
Cached Notification Destination check on AMQConsumer to avoid expensive ActiveMQDestination::toString
2018-01-22 18:02:03 -05:00
Francesco Nigro 64724c3520 ARTEMIS-1616 OpenWire improvements
Used SimpleString on OpenWireMessageConverter to avoid translations on CoreMessage
2018-01-22 18:02:03 -05:00
Francesco Nigro 17c0a331ac ARTEMIS-1616 OpenWire improvements
Added existing queues cache to avoid multiple expensive AMQSession::checkAutoCreateQueue calls
2018-01-22 18:02:03 -05:00
Francesco Nigro 54d0161850 ARTEMIS-1616 OpenWire improvements
Refactored OpenWireMessageConverter::inbound into smaller methods
2018-01-22 18:02:03 -05:00
Francesco Nigro 2db4eafc4d ARTEMIS-1616 OpenWire improvements
Avoided copy of CoreMessage when not needed and cached lambda on hot path
2018-01-22 18:02:03 -05:00
gtully 82e4f465ee [ARTEMIS-1030] add support for auto mapping openwire virtual topic consumer destinations to FQQN 2018-01-22 11:10:46 +00:00
gtully b6612c9505 [ARTEMIS-1552] differenciate empty frame from no frame such that a null response is accepted when valid 2018-01-19 14:19:54 +00:00
Christopher L. Shannon (cshannon) 3aef7caac6 ARTEMIS-1617 - Properly set autoCreated flag on address
Flag needs to be set when auto creating an address so that the address
can be removed later if auto delete is configured when creating a
subscription with MQTT
2018-01-18 08:59:35 -06:00
jostbg 3334863e81 ARTEMIS-1589 ActiveMQProtonRemotingConnection#getClientID() now returns remote client Id instead of server client Id 2018-01-17 16:54:43 -05:00
gtully ea266cd74b [ARTEMIS-1241] check for FQQN to parse out address and queue for auto creation 2018-01-17 13:23:23 -05:00
Michael André Pearce 98028cdecc ARTEMIS-1586 Refactor to make more generic
* Move byte util code into ByteUtil
* Re-use the new equals method in SimpleString
* Apply same pools/interners to client decode
* Create String to SimpleString pools/interners for property access via String keys (producer and consumer benefits)
* Lazy init the pools on withing the get methods of CoreMessageObjectPools to get the specific pool, to avoid having this scattered every where.
* reduce SimpleString creation in conversion to/from core message methods with JMS wrapper.
* reduce SimpleString creation in conversion to/from Core in OpenWire, AMQP, MQTT.
2018-01-17 09:33:41 +01:00
Justin Bertram 6b033b5b8d ARTEMIS-1602 avoid potential NPE if property is null 2018-01-16 10:04:37 -05:00
jostbg dffc66496e ARTEMIS-1596 wrong routing-type for STOMP autocreated address/queue 2018-01-12 15:12:03 -06:00
jostbg b8f591b6b9 ARTEMIS-1601 deal with race in Stomp sendMessage
If the Stomp consumer was closed at or near the same time a message was
dispatched then an NPE might result. Throwing an exception is a
relatively expensive operation in the JVM because of the stacktrace
information that needs to be generated, so in cases where it is known
that a null value could be returned one should check and handle it
appropriately.
2018-01-11 11:42:56 -06:00
Justin Bertram 14d6c30852 ARTEMIS-1576 anon AMQP producer creates address w/wrong routing-type 2018-01-05 12:47:01 +00:00
Howard Gao 6792dcdf27 ARTEMIS-1566 Openwire client can't receive compressed messages
When openwire client uses compressed option to send messages
(jms.useCompression=true) openwire client failed to receive them.
The reason is in OpenwireMessageConverter.toAMQMessage():

1. message.setContent() should be called after setting properties
 (It will cause the compressed content to decompressed before delivering to clients)
2. message.onSend() should not be called here (it should be used
by producers. If used here it changes the internal flags of the
message and cause receive to fail).
2017-12-20 16:00:14 -05:00
Stanislav Knot 45b25d6847 ARTEMIS-1329 fix openwire noLocal flag 2017-12-20 15:59:36 -05:00
Michael André Pearce 3ef98044f8 ARTEMIS-1516 - Ensure JNDI via Tomcat Resource works
Apply fix so that when using JNDI via tomcat resource it works. 
Replace original extract of JNDIStorable taken from Qpid, and use ActiveMQ5's as fits better to address this issue. (which primary use case is users migrating from 5.x)
Refactored ActiveMQConnectionFactory to externalise and turn into reference by StringRefAddr's instead of custom RefAddr which isnt standard.
Refactored ActiveMQDestinations similar
Refactored ActiveMQDestination to remove redundent and duplicated name field and ensured getters still behave the same
2017-12-19 09:20:35 -05:00
Stanislav Knot 04f74425c9 ARTEMIS-1329 testNoLocalReconnect was failing with OpenWire protocol 2017-12-18 22:24:43 -05:00
raul.valdoleiros bbf5e4ebd2 [ARTEMIS-1555] Close core consumer on MQTT unsub
Unsubscribe topic in clustered environment left open references to the core consumer.  This patch properly closes the consumer which results in correct removal of the consumer reference on a remote queue.
2017-12-15 14:48:21 +00:00
Howard Gao 1c156e0d47 ARTEMIS-1558 Message Grouping Openwire Interoperability Issue
Openwire message grouping doesn't work because the groupID of
a message is not passed correctly.
2017-12-14 20:30:53 -06:00
gtully b62e9875fe [ARTEMIS-1552] ensure gssapi sasl mech can deal with empty receive buffer 2017-12-14 19:45:04 -06:00
Todd Baert fcfa4a5e63 ARTEMIS-1542 - AMQP message cluster-bridging fix
Fixing and issue where AMQP messages would lose their address when being sent accross a cluster-bridge.
2017-12-11 11:06:36 -05:00
Michael André Pearce fa80536615 ARTEMIS-1550 - Support LVQ for OpenWire
Add support for LVQ, using the same property key as core "_AMQ_LVQ_NAME"
Update current LVQ test case to correctly test OpenWire LVQ.
2017-12-09 15:07:21 +00:00
Timothy Bish 4c04666421 ARTEMIS-1544 Use the proper types when accessing ApplicationProperties
Use Map<String, Object> to access the ApplicationProperties section
which is the spec defined type for that section.  This will prevent
breakage should proton-j be updated to reflect that in the definition of
that class.
2017-12-07 13:30:53 -05:00
Andy Taylor 34a912b644 ARTEMIS-1535 - settle delivery in same lock as sending the disposition
https://issues.apache.org/jira/browse/ARTEMIS-1535
2017-12-05 22:54:08 -05:00