[jira] [Work logged] (AMQ-8593) Deprecate masterslave discovery agent and add a new leaderfollower discovery agent
[ https://issues.apache.org/jira/browse/AMQ-8593?focusedWorklogId=766435=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-766435 ] ASF GitHub Bot logged work on AMQ-8593: --- Author: ASF GitHub Bot Created on: 05/May/22 05:41 Start Date: 05/May/22 05:41 Worklog Time Spent: 10m Work Description: lucastetreault commented on PR #835: URL: https://github.com/apache/activemq/pull/835#issuecomment-1118189121 Thanks for all the feedback folks. I have updated the PR to use the `staticfailover` as proposed by @gemmellr which seems to be right balance of removing non-inclusive language and convenience for users. I plan to email the mailing list for a formal vote on nomenclature as suggested by @michaelpearce-gain on slack Issue Time Tracking --- Worklog Id: (was: 766435) Time Spent: 2h 20m (was: 2h 10m) > Deprecate masterslave discovery agent and add a new leaderfollower discovery > agent > -- > > Key: AMQ-8593 > URL: https://issues.apache.org/jira/browse/AMQ-8593 > Project: ActiveMQ > Issue Type: Task > Components: Network of Brokers >Affects Versions: 5.17.2 >Reporter: Lucas Tétreault >Priority: Major > Time Spent: 2h 20m > Remaining Estimate: 0h > > This [tweet|https://twitter.com/owenblacker/status/1517156221207212032] > raised the issue of non-inclusive terminology in the [AWS > docs|https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-creating-configuring-network-of-brokers.html#creating-configuring-network-of-brokers-configure-network-connectors] > and suggested that we should replace masterslave with an more inclusive name > for the network connector transport. The AWS docs refer to a feature of > ActiveMQ that is a convenience discovery agent: > [https://activemq.apache.org/networks-of-brokers#masterslave-discovery] > Replacing master/slave nomenclature in ActiveMQ was raised in July 2020 > AMQ-7514 and there have been some attempts at making some changes > ([#679|https://github.com/apache/activemq/pull/679], > [#714|https://github.com/apache/activemq/pull/714], > [#788|https://github.com/apache/activemq/pull/788]) however we have not been > able to come to an agreement on nomenclature so these efforts seem to have > stalled out. > If we are able to come to an agreement on nomenclature in this PR, we can > move forward with removing more non-inclusive terminology on the website (I > will follow up with some PRs to the website), in discussions with the > community and of course in this codebase. This will remove adoption barriers > and make ActiveMQ a more approachable and inclusive project for everyone! > Other Apache projects such as Solr and Kafka have moved from master/slave to > leader/follower. Leader/follower is also recommended by the > [IETF|https://tools.ietf.org/id/draft-knodel-terminology-02.html] and > [inclusivenaming.org|https://inclusivenaming.org/word-lists/tier-1/] which is > supported by companies such as Cisco, Intel, and RedHat. > If we can't come to an agreement on Leader/Follower or some other > nomenclature I will, at the very least, create a follow up PR to remove the > masterslave transport since it is just a convenience method to use > static+failover with ?randomize=false=0. > This change leaves the masterslave: transport in place but provides a new > alias leaderfollower: for now but we can easily remove it in 5.18.0. > PR: https://github.com/apache/activemq/pull/835 -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (ARTEMIS-3759) Allow for Mirroring (Broker Connections) to specify a specific set of addresses to send events, as is done for a cluster connection
[ https://issues.apache.org/jira/browse/ARTEMIS-3759?focusedWorklogId=766377=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-766377 ] ASF GitHub Bot logged work on ARTEMIS-3759: --- Author: ASF GitHub Bot Created on: 05/May/22 01:26 Start Date: 05/May/22 01:26 Worklog Time Spent: 10m Work Description: clebertsuconic merged PR #4054: URL: https://github.com/apache/activemq-artemis/pull/4054 Issue Time Tracking --- Worklog Id: (was: 766377) Time Spent: 3.5h (was: 3h 20m) > Allow for Mirroring (Broker Connections) to specify a specific set of > addresses to send events, as is done for a cluster connection > - > > Key: ARTEMIS-3759 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3759 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: AMQP >Affects Versions: 2.19.1, 2.21.0 >Reporter: Mikhail Lukyanov >Priority: Major > Attachments: ImageAddressSyntax.png, ImageInternalQueues.png > > Time Spent: 3.5h > Remaining Estimate: 0h > > If a target broker of mirroring is in a cluster, then mirroring of the > broker's internal queues also occurs, and often messages accumulate in such > queues. In theory, internal cluster queues should not be mirrored, this does > not make much sense. > Therefore, it would be convenient to allow you to configure for which > addresses and their queues mirroring will be performed, events will be sent > (message-acknowledgements, queue-removal, queue-creation). The syntax that is > used to specify the *_addresses_* of the *_cluster connection_* is well > suited for this. > Mirrored internal cluster queues > !ImageInternalQueues.png! > Address syntax > !ImageAddressSyntax.png! -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (ARTEMIS-3759) Allow for Mirroring (Broker Connections) to specify a specific set of addresses to send events, as is done for a cluster connection
[ https://issues.apache.org/jira/browse/ARTEMIS-3759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531989#comment-17531989 ] ASF subversion and git services commented on ARTEMIS-3759: -- Commit 0b321ab8ff62268d55df56e504cbfc043e2de8eb in activemq-artemis's branch refs/heads/main from iliya [ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=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 > Allow for Mirroring (Broker Connections) to specify a specific set of > addresses to send events, as is done for a cluster connection > - > > Key: ARTEMIS-3759 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3759 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: AMQP >Affects Versions: 2.19.1, 2.21.0 >Reporter: Mikhail Lukyanov >Priority: Major > Attachments: ImageAddressSyntax.png, ImageInternalQueues.png > > Time Spent: 3.5h > Remaining Estimate: 0h > > If a target broker of mirroring is in a cluster, then mirroring of the > broker's internal queues also occurs, and often messages accumulate in such > queues. In theory, internal cluster queues should not be mirrored, this does > not make much sense. > Therefore, it would be convenient to allow you to configure for which > addresses and their queues mirroring will be performed, events will be sent > (message-acknowledgements, queue-removal, queue-creation). The syntax that is > used to specify the *_addresses_* of the *_cluster connection_* is well > suited for this. > Mirrored internal cluster queues > !ImageInternalQueues.png! > Address syntax > !ImageAddressSyntax.png! -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (ARTEMIS-3812) Upgrade Micrometer
[ https://issues.apache.org/jira/browse/ARTEMIS-3812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531990#comment-17531990 ] ASF subversion and git services commented on ARTEMIS-3812: -- Commit dff21ba42cdc0373d4b9e7726614622c3fbe4320 in activemq-artemis's branch refs/heads/main from Justin Bertram [ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=dff21ba42c ] ARTEMIS-3812 upgrade Micrometer > Upgrade Micrometer > -- > > Key: ARTEMIS-3812 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3812 > Project: ActiveMQ Artemis > Issue Type: Dependency upgrade >Reporter: Justin Bertram >Assignee: Justin Bertram >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (ARTEMIS-3812) Upgrade Micrometer
[ https://issues.apache.org/jira/browse/ARTEMIS-3812?focusedWorklogId=766378=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-766378 ] ASF GitHub Bot logged work on ARTEMIS-3812: --- Author: ASF GitHub Bot Created on: 05/May/22 01:26 Start Date: 05/May/22 01:26 Worklog Time Spent: 10m Work Description: clebertsuconic merged PR #4064: URL: https://github.com/apache/activemq-artemis/pull/4064 Issue Time Tracking --- Worklog Id: (was: 766378) Remaining Estimate: 0h Time Spent: 10m > Upgrade Micrometer > -- > > Key: ARTEMIS-3812 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3812 > Project: ActiveMQ Artemis > Issue Type: Dependency upgrade >Reporter: Justin Bertram >Assignee: Justin Bertram >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (ARTEMIS-3759) Allow for Mirroring (Broker Connections) to specify a specific set of addresses to send events, as is done for a cluster connection
[ https://issues.apache.org/jira/browse/ARTEMIS-3759?focusedWorklogId=766376=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-766376 ] ASF GitHub Bot logged work on ARTEMIS-3759: --- Author: ASF GitHub Bot Created on: 05/May/22 01:25 Start Date: 05/May/22 01:25 Worklog Time Spent: 10m Work Description: clebertsuconic commented on PR #4054: URL: https://github.com/apache/activemq-artemis/pull/4054#issuecomment-1118080195 thanks @iliya-gr and @gemmellr Issue Time Tracking --- Worklog Id: (was: 766376) Time Spent: 3h 20m (was: 3h 10m) > Allow for Mirroring (Broker Connections) to specify a specific set of > addresses to send events, as is done for a cluster connection > - > > Key: ARTEMIS-3759 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3759 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: AMQP >Affects Versions: 2.19.1, 2.21.0 >Reporter: Mikhail Lukyanov >Priority: Major > Attachments: ImageAddressSyntax.png, ImageInternalQueues.png > > Time Spent: 3h 20m > Remaining Estimate: 0h > > If a target broker of mirroring is in a cluster, then mirroring of the > broker's internal queues also occurs, and often messages accumulate in such > queues. In theory, internal cluster queues should not be mirrored, this does > not make much sense. > Therefore, it would be convenient to allow you to configure for which > addresses and their queues mirroring will be performed, events will be sent > (message-acknowledgements, queue-removal, queue-creation). The syntax that is > used to specify the *_addresses_* of the *_cluster connection_* is well > suited for this. > Mirrored internal cluster queues > !ImageInternalQueues.png! > Address syntax > !ImageAddressSyntax.png! -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (ARTEMIS-3759) Allow for Mirroring (Broker Connections) to specify a specific set of addresses to send events, as is done for a cluster connection
[ https://issues.apache.org/jira/browse/ARTEMIS-3759?focusedWorklogId=766375=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-766375 ] ASF GitHub Bot logged work on ARTEMIS-3759: --- Author: ASF GitHub Bot Created on: 05/May/22 01:25 Start Date: 05/May/22 01:25 Worklog Time Spent: 10m Work Description: clebertsuconic commented on PR #4054: URL: https://github.com/apache/activemq-artemis/pull/4054#issuecomment-1118080111 this looks awesome.. merging it. Issue Time Tracking --- Worklog Id: (was: 766375) Time Spent: 3h 10m (was: 3h) > Allow for Mirroring (Broker Connections) to specify a specific set of > addresses to send events, as is done for a cluster connection > - > > Key: ARTEMIS-3759 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3759 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: AMQP >Affects Versions: 2.19.1, 2.21.0 >Reporter: Mikhail Lukyanov >Priority: Major > Attachments: ImageAddressSyntax.png, ImageInternalQueues.png > > Time Spent: 3h 10m > Remaining Estimate: 0h > > If a target broker of mirroring is in a cluster, then mirroring of the > broker's internal queues also occurs, and often messages accumulate in such > queues. In theory, internal cluster queues should not be mirrored, this does > not make much sense. > Therefore, it would be convenient to allow you to configure for which > addresses and their queues mirroring will be performed, events will be sent > (message-acknowledgements, queue-removal, queue-creation). The syntax that is > used to specify the *_addresses_* of the *_cluster connection_* is well > suited for this. > Mirrored internal cluster queues > !ImageInternalQueues.png! > Address syntax > !ImageAddressSyntax.png! -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (ARTEMIS-3700) Provide JakartaEE 10 artefacts and support
[ https://issues.apache.org/jira/browse/ARTEMIS-3700?focusedWorklogId=766239=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-766239 ] ASF GitHub Bot logged work on ARTEMIS-3700: --- Author: ASF GitHub Bot Created on: 04/May/22 19:28 Start Date: 04/May/22 19:28 Worklog Time Spent: 10m Work Description: ehsavoie commented on PR #4057: URL: https://github.com/apache/activemq-artemis/pull/4057#issuecomment-1117740110 @clebertsuconic it is not available until the official release (next week should be ok) Issue Time Tracking --- Worklog Id: (was: 766239) Time Spent: 0.5h (was: 20m) > Provide JakartaEE 10 artefacts and support > -- > > Key: ARTEMIS-3700 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3700 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: API >Affects Versions: 2.20.0 >Reporter: Emmanuel Hugonnet >Priority: Major > Time Spent: 0.5h > Remaining Estimate: 0h > > With Jakarta Messaging 3.1 to be released we should plan to provide support > of the new set of APIs. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (ARTEMIS-3700) Provide JakartaEE 10 artefacts and support
[ https://issues.apache.org/jira/browse/ARTEMIS-3700?focusedWorklogId=766232=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-766232 ] ASF GitHub Bot logged work on ARTEMIS-3700: --- Author: ASF GitHub Bot Created on: 04/May/22 19:23 Start Date: 04/May/22 19:23 Worklog Time Spent: 10m Work Description: clebertsuconic commented on PR #4057: URL: https://github.com/apache/activemq-artemis/pull/4057#issuecomment-1117734528 @ehsavoie it seems the API Is not available on maven. Can you rebase and push -f so this gets executed again? Issue Time Tracking --- Worklog Id: (was: 766232) Time Spent: 20m (was: 10m) > Provide JakartaEE 10 artefacts and support > -- > > Key: ARTEMIS-3700 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3700 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: API >Affects Versions: 2.20.0 >Reporter: Emmanuel Hugonnet >Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > With Jakarta Messaging 3.1 to be released we should plan to provide support > of the new set of APIs. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Created] (ARTEMIS-3815) Target mirror controller may commit received message after receiving ACK for it
Iliya Grushevskiy created ARTEMIS-3815: -- Summary: Target mirror controller may commit received message after receiving ACK for it Key: ARTEMIS-3815 URL: https://issues.apache.org/jira/browse/ARTEMIS-3815 Project: ActiveMQ Artemis Issue Type: Bug Components: AMQP Affects Versions: 2.22.0, 2.21.0, 2.19.1 Reporter: Iliya Grushevskiy Given two brokers *A* and {*}B{*}, with configured mirror *A* towards *B* and a queue {*}Q{*}. If disk operations on *B* are slow, and there are active exchanges of messages on queue {*}Q{*}, for example: # Send message 1 # ACK message 1 # Send message 2 # ACK message 2 # ... At the end queue *Q* on *B* will contain some unacknowledged messages, while queue *Q* on *A* will be empty. The issue is that commit in sendMessage may take some time and ref to message will be written to the intermediate store only after receiving an ACK for this message. Test with synthetic delay: https://github.com/iliya-gr/activemq-artemis/tree/mirror-fast-ack -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (AMQ-8322) Implement JMS 2.0 Connection createContext methods
[ https://issues.apache.org/jira/browse/AMQ-8322?focusedWorklogId=766082=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-766082 ] ASF GitHub Bot logged work on AMQ-8322: --- Author: ASF GitHub Bot Created on: 04/May/22 15:12 Start Date: 04/May/22 15:12 Worklog Time Spent: 10m Work Description: mattrpav commented on code in PR #729: URL: https://github.com/apache/activemq/pull/729#discussion_r864960783 ## activemq-client/src/main/java/org/apache/activemq/ActiveMQProducer.java: ## @@ -0,0 +1,547 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import javax.jms.BytesMessage; +import javax.jms.CompletionListener; +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.JMSProducer; +import javax.jms.MapMessage; +import javax.jms.Message; +import javax.jms.MessageFormatRuntimeException; +import javax.jms.MessageProducer; +import javax.jms.ObjectMessage; +import javax.jms.TextMessage; + +import org.apache.activemq.util.JMSExceptionSupport; +import org.apache.activemq.util.TypeConversionSupport; + +public class ActiveMQProducer implements JMSProducer { + +private final ActiveMQContext activemqContext; +private final MessageProducer activemqMessageProducer; + +// QoS override of defaults on a per-JMSProducer instance basis +private String correlationId = null; +private byte[] correlationIdBytes = null; +private Long deliveryDelay = null; +private Integer deliveryMode = null; +private Integer priority = null; +private Destination replyTo = null; +private Long timeToLive = null; +private String type = null; + +// Properties applied to all messages on a per-JMS producer instance basis +private Map messageProperties = null; + +ActiveMQProducer(ActiveMQContext activemqContext, MessageProducer activemqMessageProducer) { +this.activemqContext = activemqContext; +this.activemqMessageProducer = activemqMessageProducer; +} + +@Override +public JMSProducer send(Destination destination, Message message) { +try { +if(this.correlationId != null) { +message.setJMSCorrelationID(this.correlationId); +} + +if(this.correlationIdBytes != null) { +message.setJMSCorrelationIDAsBytes(this.correlationIdBytes); +} + +if(this.replyTo != null) { +message.setJMSReplyTo(this.replyTo); +} + +if(this.type != null) { +message.setJMSType(this.type); +} + +if(!messageProperties.isEmpty()) { +for(Map.Entry propertyEntry : messageProperties.entrySet()) { +message.setObjectProperty(propertyEntry.getKey(), propertyEntry.getValue()); +} +} + +activemqMessageProducer.send(destination, message, getDeliveryMode(), getPriority(), getTimeToLive()); +} catch (JMSException e) { +throw JMSExceptionSupport.convertToJMSRuntimeException(e); +} +return this; +} + +@Override +public JMSProducer send(Destination destination, String body) { +TextMessage textMessage = activemqContext.createTextMessage(body); +send(destination, textMessage); +return this; +} + +@Override +public JMSProducer send(Destination destination, Map body) { +MapMessage mapMessage = activemqContext.createMapMessage(); + +if (body != null) { +try { + for (Map.Entry mapEntry : body.entrySet()) { + final String key = mapEntry.getKey(); + final Object value = mapEntry.getValue(); + final Class valueObject = value.getClass(); + if (String.class.isAssignableFrom(valueObject)) { + mapMessage.setString(key, String.class.cast(value)); + } else if
[jira] [Work logged] (AMQ-8322) Implement JMS 2.0 Connection createContext methods
[ https://issues.apache.org/jira/browse/AMQ-8322?focusedWorklogId=766081=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-766081 ] ASF GitHub Bot logged work on AMQ-8322: --- Author: ASF GitHub Bot Created on: 04/May/22 15:11 Start Date: 04/May/22 15:11 Worklog Time Spent: 10m Work Description: mattrpav commented on code in PR #729: URL: https://github.com/apache/activemq/pull/729#discussion_r864960056 ## activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java: ## @@ -1956,12 +1976,15 @@ protected void send(ActiveMQMessageProducer producer, ActiveMQDestination destin //Set the "JMS" header fields on the original message, see 1.1 spec section 3.4.11 message.setJMSDeliveryMode(deliveryMode); long expiration = 0L; -if (!producer.getDisableMessageTimestamp()) { -long timeStamp = System.currentTimeMillis(); +long timeStamp = System.currentTimeMillis(); Review Comment: This is completed Issue Time Tracking --- Worklog Id: (was: 766081) Time Spent: 12h 10m (was: 12h) > Implement JMS 2.0 Connection createContext methods > -- > > Key: AMQ-8322 > URL: https://issues.apache.org/jira/browse/AMQ-8322 > Project: ActiveMQ > Issue Type: New Feature >Reporter: Matt Pavlovich >Assignee: Matt Pavlovich >Priority: Major > Labels: #jms2 > Fix For: 5.18.0 > > Time Spent: 12h 10m > Remaining Estimate: 0h > > Add support for JMSContext, JMSProducer and JMSConsumer for working with > queues -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (AMQ-8322) Implement JMS 2.0 Connection createContext methods
[ https://issues.apache.org/jira/browse/AMQ-8322?focusedWorklogId=766079=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-766079 ] ASF GitHub Bot logged work on AMQ-8322: --- Author: ASF GitHub Bot Created on: 04/May/22 15:10 Start Date: 04/May/22 15:10 Worklog Time Spent: 10m Work Description: mattrpav commented on code in PR #729: URL: https://github.com/apache/activemq/pull/729#discussion_r864958409 ## activemq-unit-tests/src/test/java/org/apache/activemq/jms2/ActiveMQJMS2ContextTest.java: ## @@ -0,0 +1,302 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.jms2; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.util.Enumeration; + +import javax.jms.CompletionListener; +import javax.jms.Destination; +import javax.jms.JMSConsumer; +import javax.jms.JMSContext; +import javax.jms.JMSException; +import javax.jms.JMSProducer; +import javax.jms.JMSRuntimeException; +import javax.jms.QueueBrowser; +import javax.jms.Session; +import javax.jms.TextMessage; + +import org.apache.activemq.ActiveMQContext; +import org.junit.Test; + +public class ActiveMQJMS2ContextTest extends ActiveMQJMS2TestBase { + +@Test +public void testConnectionFactoryCreateContext() { +try(JMSContext jmsContext = activemqConnectionFactory.createContext()) { +assertNotNull(jmsContext); +jmsContext.start(); + assertTrue(ActiveMQContext.class.isAssignableFrom(jmsContext.getClass())); +sendMessage(jmsContext, methodNameDestinationName); +recvMessage(jmsContext, methodNameDestinationName, "Test-" + methodNameDestinationName); +} catch (JMSException e) { +fail(e.getMessage()); +} +} + +@Test(expected = UnsupportedOperationException.class) +public void testConnectionFactoryCreateContextSession() { +activemqConnectionFactory.createContext(Session.AUTO_ACKNOWLEDGE); +} + +@Test +public void testConnectionFactoryCreateContextUserPass() { +try(JMSContext jmsContext = activemqConnectionFactory.createContext("admin", "admin")) { +assertNotNull(jmsContext); +jmsContext.start(); + assertTrue(ActiveMQContext.class.isAssignableFrom(jmsContext.getClass())); +sendMessage(jmsContext, methodNameDestinationName); +recvMessage(jmsContext, methodNameDestinationName, "Test-" + methodNameDestinationName); +} catch (JMSException e) { +fail(e.getMessage()); +} +} + +@Test +public void testConnectionFactoryCreateContextUserPassSession() { +try(JMSContext jmsContext = activemqConnectionFactory.createContext("admin", "admin", Session.AUTO_ACKNOWLEDGE)) { +assertNotNull(jmsContext); + assertTrue(ActiveMQContext.class.isAssignableFrom(jmsContext.getClass())); +} +} + +@Test +public void testConnectionFactoryCreateContexMultiContext() { +JMSContext secondJMSContext = null; +JMSContext thirdJMSContext = null; + +try(JMSContext jmsContext = activemqConnectionFactory.createContext("admin", "admin")) { +assertNotNull(jmsContext); +jmsContext.start(); + assertTrue(ActiveMQContext.class.isAssignableFrom(jmsContext.getClass())); +sendMessage(jmsContext, methodNameDestinationName); +recvMessage(jmsContext, methodNameDestinationName, "Test-" + methodNameDestinationName); + +secondJMSContext = jmsContext.createContext(Session.AUTO_ACKNOWLEDGE); +} catch (JMSException e) { +fail(e.getMessage()); +} + +// First context closed +String secondTestDestinationName = methodNameDestinationName + ".SECOND"; +try { +sendMessage(secondJMSContext, secondTestDestinationName); +recvMessage(secondJMSContext, secondTestDestinationName, "Test-" +
[jira] [Commented] (ARTEMIS-3809) LargeMessageControllerImpl hangs the message consume
[ https://issues.apache.org/jira/browse/ARTEMIS-3809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531770#comment-17531770 ] David Bennion commented on ARTEMIS-3809: I have still been thinking about this scenario, and your explanation for a resolution to make this system more robust makes total sense. The delivery system being robust and timing out is really important and the possibility of sending a single packet and then vanishing seems like a plausible edge case. So that is all good. The piece of my situation that still doesn't make complete sense to me though is that all of these messages occur within a single JVM and using the InVM transporter. I don't (that I know of) have any kind of error in the log that indicates stuff went wrong. So how did I arrive at this point where a single packet of a large message made it through and it abandoned the send of the rest of it without a trace? With the fix that you are proposing (which I believe is a correct and valuable fix), would it not be true that my situation would simply get a failed message delivery for that message and continue on around it? > LargeMessageControllerImpl hangs the message consume > > > Key: ARTEMIS-3809 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3809 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: Broker >Affects Versions: 2.21.0 > Environment: OS: Windows Server 2019 > JVM: OpenJDK 64-Bit Server VM Temurin-17.0.1+12 > Max Memory (-Xmx): 6GB > Allocated to JVM: 4.168GB > Currently in use: 3.398GB (heap 3.391GB, non-heap 0.123GB) >Reporter: David Bennion >Priority: Major > Labels: test-stability > Attachments: image-2022-05-03-10-51-46-872.png > > > I wondered if this might be a recurrence of issue ARTEMIS-2293 but this > happens on 2.21.0 and I can see the code change in > LargeMessageControllerImpl. > Using the default min-large-message-size of 100K. (defaults) > Many messages are passing through the broker when this happens. I would > anticipate that most of the messages are smaller than 100K, but clearly some > of them must exceed. After some number of messages, a particular consumer > ceases to consume messages. > After the system became "hung" I was able to get a stack trace and I was able > to identify that the system is stuck in an Object.wait() for a notify that > appears to never come. > Here is the trace I was able to capture: > {code:java} > Thread-2 (ActiveMQ-client-global-threads) id=78 state=TIMED_WAITING > - waiting on <0x43523a75> (a > org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl) > - locked <0x43523a75> (a > org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl) > at java.base@17.0.1/java.lang.Object.wait(Native Method) > at > org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl.waitCompletion(LargeMessageControllerImpl.java:294) > at > org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl.saveBuffer(LargeMessageControllerImpl.java:268) > at > org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl.checkBuffer(ClientLargeMessageImpl.java:157) > at > org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl.getBodyBuffer(ClientLargeMessageImpl.java:89) > at mypackage.MessageListener.handleMessage(MessageListener.java:46) > {code} > > The app can run either as a single node using the InVM transporter or as a > cluster using the TCP. To my knowledge, I have only seen this issue occur on > the InVM. > I am not expert in this code, but I can tell from the call stack that 0 must > be the value of timeWait passed into waitCompletion(). But from what I can > discern of the code changes in 2.21.0, it should be adjusting the > readTimeout to the timeout of the message (I think?) such that it causes the > read to eventually give up rather than remaining blocked forever. > We have persistenceEnabled = false, which leads me to believe that the only > disk activity for messages should be related to large messages(?). > On a machine and context where this was consistently happening, I adjusted > the min-large-message-size upwards and the problem went away. This makes > sense for my application, but ultimately if a message goes across the > threshold to become large it appears to hang the consumer indefinitely. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Created] (AMQ-8595) activemq-security.xml not working
Leonardo Reis created AMQ-8595: -- Summary: activemq-security.xml not working Key: AMQ-8595 URL: https://issues.apache.org/jira/browse/AMQ-8595 Project: ActiveMQ Issue Type: Bug Affects Versions: 5.15.13 Reporter: Leonardo Reis Error starting broker "bin/activemq start xbean:conf/activemq-security.xml" no process is spawned, unable to continue. Im respecting the documentation (http://activemq.apache.org/encrypted-passwords.html) inserting the encrypted password in the credential-enc.properties file: --activemq.log-- 2022-05-04 09:51:12,337 | ERROR | Failed to load: class path resource [conf/activemq-security.xml], reason: IOException parsing XML document from class path resource [conf/activemq-security.xml]; nested exception is java.io.FileNotFoundException: class path resource [conf/activemq-security.xml] cannot be opened because it does not exist | org.apache.activemq.xbean.XBeanBrokerFactory | main org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [conf/activemq-security.xml]; nested exception is java.io.FileNotFoundException: class path resource [conf/activemq-security.xml] cannot be opened because it does not exist at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)[spring-beans-4.3.26.RELEASE.jar:4.3.26.RELEASE] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)[spring-beans-4.3.26.RELEASE.jar:4.3.26.RELEASE] at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111)[xbean-spring-4.17.jar:4.17] at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104)[xbean-spring-4.17.jar:4.17] at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)[spring-context-4.3.26.RELEASE.jar:4.3.26.RELEASE] at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:614)[spring-context-4.3.26.RELEASE.jar:4.3.26.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:514)[spring-context-4.3.26.RELEASE.jar:4.3.26.RELEASE] at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64)[xbean-spring-4.17.jar:4.17] at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52)[xbean-spring-4.17.jar:4.17] at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBrokerFactory.java:104)[activemq-spring-5.15.13.jar:5.15.13] at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.15.13.jar:5.15.13] at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.15.13.jar:5.15.13] at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.15.13.jar:5.15.13] at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.15.13.jar:5.15.13] at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.15.13.jar:5.15.13] at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.13.jar:5.15.13] at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)[activemq-console-5.15.13.jar:5.15.13] at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)[activemq-console-5.15.13.jar:5.15.13] at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.15.13.jar:5.15.13] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_301] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_301] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_301] at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_301] at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.15.13] at org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.15.13] ---file configuration activemq-security--
[jira] [Resolved] (ARTEMIS-3814) Update to ActiveMQ 5.17.1
[ https://issues.apache.org/jira/browse/ARTEMIS-3814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robbie Gemmell resolved ARTEMIS-3814. - Resolution: Fixed > Update to ActiveMQ 5.17.1 > - > > Key: ARTEMIS-3814 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3814 > Project: ActiveMQ Artemis > Issue Type: Dependency upgrade > Components: OpenWire >Reporter: Robbie Gemmell >Assignee: Robbie Gemmell >Priority: Major > Fix For: 2.23.0 > > Time Spent: 10m > Remaining Estimate: 0h > > Update ActiveMQ 5 deps to 5.17.1 -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (ARTEMIS-3814) Update to ActiveMQ 5.17.1
[ https://issues.apache.org/jira/browse/ARTEMIS-3814?focusedWorklogId=765949=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-765949 ] ASF GitHub Bot logged work on ARTEMIS-3814: --- Author: ASF GitHub Bot Created on: 04/May/22 12:27 Start Date: 04/May/22 12:27 Worklog Time Spent: 10m Work Description: asfgit merged PR #4065: URL: https://github.com/apache/activemq-artemis/pull/4065 Issue Time Tracking --- Worklog Id: (was: 765949) Remaining Estimate: 0h Time Spent: 10m > Update to ActiveMQ 5.17.1 > - > > Key: ARTEMIS-3814 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3814 > Project: ActiveMQ Artemis > Issue Type: Dependency upgrade > Components: OpenWire >Reporter: Robbie Gemmell >Assignee: Robbie Gemmell >Priority: Major > Fix For: 2.23.0 > > Time Spent: 10m > Remaining Estimate: 0h > > Update ActiveMQ 5 deps to 5.17.1 -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (ARTEMIS-3814) Update to ActiveMQ 5.17.1
[ https://issues.apache.org/jira/browse/ARTEMIS-3814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531703#comment-17531703 ] ASF subversion and git services commented on ARTEMIS-3814: -- Commit 8786bc9e5eb023167990020b8378dcabcf8fc49c in activemq-artemis's branch refs/heads/main from Robbie Gemmell [ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=8786bc9e5e ] ARTEMIS-3814: update activemq deps to 5.17.1 > Update to ActiveMQ 5.17.1 > - > > Key: ARTEMIS-3814 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3814 > Project: ActiveMQ Artemis > Issue Type: Dependency upgrade > Components: OpenWire >Reporter: Robbie Gemmell >Assignee: Robbie Gemmell >Priority: Major > Fix For: 2.23.0 > > > Update ActiveMQ 5 deps to 5.17.1 -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Created] (ARTEMIS-3814) Update to ActiveMQ 5.17.1
Robbie Gemmell created ARTEMIS-3814: --- Summary: Update to ActiveMQ 5.17.1 Key: ARTEMIS-3814 URL: https://issues.apache.org/jira/browse/ARTEMIS-3814 Project: ActiveMQ Artemis Issue Type: Dependency upgrade Components: OpenWire Reporter: Robbie Gemmell Assignee: Robbie Gemmell Fix For: 2.23.0 Update ActiveMQ 5 deps to 5.17.1 -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (ARTEMIS-3759) Allow for Mirroring (Broker Connections) to specify a specific set of addresses to send events, as is done for a cluster connection
[ https://issues.apache.org/jira/browse/ARTEMIS-3759?focusedWorklogId=765923=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-765923 ] ASF GitHub Bot logged work on ARTEMIS-3759: --- Author: ASF GitHub Bot Created on: 04/May/22 11:04 Start Date: 04/May/22 11:04 Worklog Time Spent: 10m Work Description: iliya-gr commented on code in PR #4054: URL: https://github.com/apache/activemq-artemis/pull/4054#discussion_r864707438 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerSource.java: ## @@ -208,6 +232,13 @@ public void sendMessage(Message message, RoutingContext context, List Allow for Mirroring (Broker Connections) to specify a specific set of > addresses to send events, as is done for a cluster connection > - > > Key: ARTEMIS-3759 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3759 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: AMQP >Affects Versions: 2.19.1, 2.21.0 >Reporter: Mikhail Lukyanov >Priority: Major > Attachments: ImageAddressSyntax.png, ImageInternalQueues.png > > Time Spent: 3h > Remaining Estimate: 0h > > If a target broker of mirroring is in a cluster, then mirroring of the > broker's internal queues also occurs, and often messages accumulate in such > queues. In theory, internal cluster queues should not be mirrored, this does > not make much sense. > Therefore, it would be convenient to allow you to configure for which > addresses and their queues mirroring will be performed, events will be sent > (message-acknowledgements, queue-removal, queue-creation). The syntax that is > used to specify the *_addresses_* of the *_cluster connection_* is well > suited for this. > Mirrored internal cluster queues > !ImageInternalQueues.png! > Address syntax > !ImageAddressSyntax.png! -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (ARTEMIS-3759) Allow for Mirroring (Broker Connections) to specify a specific set of addresses to send events, as is done for a cluster connection
[ https://issues.apache.org/jira/browse/ARTEMIS-3759?focusedWorklogId=765905=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-765905 ] ASF GitHub Bot logged work on ARTEMIS-3759: --- Author: ASF GitHub Bot Created on: 04/May/22 09:46 Start Date: 04/May/22 09:46 Worklog Time Spent: 10m Work Description: gemmellr commented on PR #4054: URL: https://github.com/apache/activemq-artemis/pull/4054#issuecomment-1117121572 > > I will spend some time reviewing this tomorrow after I finish the release on 2.22. > > Do I need to squash commits before? It can be reviewed without squashing them but its never going to be merged like this without squashing, so I'd suggest just doing so. Issue Time Tracking --- Worklog Id: (was: 765905) Time Spent: 2h 50m (was: 2h 40m) > Allow for Mirroring (Broker Connections) to specify a specific set of > addresses to send events, as is done for a cluster connection > - > > Key: ARTEMIS-3759 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3759 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: AMQP >Affects Versions: 2.19.1, 2.21.0 >Reporter: Mikhail Lukyanov >Priority: Major > Attachments: ImageAddressSyntax.png, ImageInternalQueues.png > > Time Spent: 2h 50m > Remaining Estimate: 0h > > If a target broker of mirroring is in a cluster, then mirroring of the > broker's internal queues also occurs, and often messages accumulate in such > queues. In theory, internal cluster queues should not be mirrored, this does > not make much sense. > Therefore, it would be convenient to allow you to configure for which > addresses and their queues mirroring will be performed, events will be sent > (message-acknowledgements, queue-removal, queue-creation). The syntax that is > used to specify the *_addresses_* of the *_cluster connection_* is well > suited for this. > Mirrored internal cluster queues > !ImageInternalQueues.png! > Address syntax > !ImageAddressSyntax.png! -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Work logged] (ARTEMIS-3759) Allow for Mirroring (Broker Connections) to specify a specific set of addresses to send events, as is done for a cluster connection
[ https://issues.apache.org/jira/browse/ARTEMIS-3759?focusedWorklogId=765902=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-765902 ] ASF GitHub Bot logged work on ARTEMIS-3759: --- Author: ASF GitHub Bot Created on: 04/May/22 09:44 Start Date: 04/May/22 09:44 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #4054: URL: https://github.com/apache/activemq-artemis/pull/4054#discussion_r864642643 ## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerSource.java: ## @@ -208,6 +232,13 @@ public void sendMessage(Message message, RoutingContext context, List Allow for Mirroring (Broker Connections) to specify a specific set of > addresses to send events, as is done for a cluster connection > - > > Key: ARTEMIS-3759 > URL: https://issues.apache.org/jira/browse/ARTEMIS-3759 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: AMQP >Affects Versions: 2.19.1, 2.21.0 >Reporter: Mikhail Lukyanov >Priority: Major > Attachments: ImageAddressSyntax.png, ImageInternalQueues.png > > Time Spent: 2h 40m > Remaining Estimate: 0h > > If a target broker of mirroring is in a cluster, then mirroring of the > broker's internal queues also occurs, and often messages accumulate in such > queues. In theory, internal cluster queues should not be mirrored, this does > not make much sense. > Therefore, it would be convenient to allow you to configure for which > addresses and their queues mirroring will be performed, events will be sent > (message-acknowledgements, queue-removal, queue-creation). The syntax that is > used to specify the *_addresses_* of the *_cluster connection_* is well > suited for this. > Mirrored internal cluster queues > !ImageInternalQueues.png! > Address syntax > !ImageAddressSyntax.png! -- This message was sent by Atlassian Jira (v8.20.7#820007)