[GitHub] [activemq-artemis] gaohoward commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
gaohoward commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback 
Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523267495
 
 
   The spec doesn't specify what order should be kept after rollback. So the 
best thing to do is that the client should not reply on this behavior.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction 
Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523266935
 
 
   Marking a label DO-NOT-MERGE-YET just to have a discussion on what approach 
is better.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction 
Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523266746
 
 
   I have sent an alternative, in case this violates AMQP specification (in the 
case I was mentioning it could break other clients).
   
   The PR is #2804 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] clebertsuconic opened a new pull request #2804: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering by using a sorted…

2019-08-20 Thread GitBox
clebertsuconic opened a new pull request #2804: ARTEMIS-2458 Fix AMQP 
Transaction Rollback Ordering by using a sorted…
URL: https://github.com/apache/activemq-artemis/pull/2804
 
 
   … add


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2803: ARTEMIS-2458 
Fix AMQP Transaction Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#discussion_r315959479
 
 

 ##
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
 ##
 @@ -405,7 +405,11 @@ public void ack(Transaction transaction, Object 
brokerConsumer, Message message)
public void cancel(Object brokerConsumer, Message message, boolean 
updateCounts) throws Exception {
   OperationContext oldContext = recoverContext();
   try {
- ((ServerConsumer) 
brokerConsumer).individualCancel(message.getMessageID(), updateCounts);
+ try {
+((ServerConsumer) 
brokerConsumer).individualCancel(message.getMessageID(), updateCounts);
+ } catch (IllegalStateException e) {
+//Ignore this silently, can occur if already cancelled.
 
 Review comment:
   added - just pushed


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2803: ARTEMIS-2458 
Fix AMQP Transaction Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#discussion_r315958995
 
 

 ##
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
 ##
 @@ -405,7 +405,11 @@ public void ack(Transaction transaction, Object 
brokerConsumer, Message message)
public void cancel(Object brokerConsumer, Message message, boolean 
updateCounts) throws Exception {
   OperationContext oldContext = recoverContext();
   try {
- ((ServerConsumer) 
brokerConsumer).individualCancel(message.getMessageID(), updateCounts);
+ try {
+((ServerConsumer) 
brokerConsumer).individualCancel(message.getMessageID(), updateCounts);
+ } catch (IllegalStateException e) {
+//Ignore this silently, can occur if already cancelled.
 
 Review comment:
   sure will add
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction 
Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523243655
 
 
   I think this is totally fine. This is just using the exact semantics for 
rollback than any other protocol in Artemis.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
clebertsuconic commented on a change in pull request #2803: ARTEMIS-2458 Fix 
AMQP Transaction Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#discussion_r315954798
 
 

 ##
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
 ##
 @@ -405,7 +405,11 @@ public void ack(Transaction transaction, Object 
brokerConsumer, Message message)
public void cancel(Object brokerConsumer, Message message, boolean 
updateCounts) throws Exception {
   OperationContext oldContext = recoverContext();
   try {
- ((ServerConsumer) 
brokerConsumer).individualCancel(message.getMessageID(), updateCounts);
+ try {
+((ServerConsumer) 
brokerConsumer).individualCancel(message.getMessageID(), updateCounts);
+ } catch (IllegalStateException e) {
+//Ignore this silently, can occur if already cancelled.
 
 Review comment:
   nit-pick: can you log.debug here instead?
   
   Although I could ammend it myself during merging


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2803: ARTEMIS-2458 
Fix AMQP Transaction Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#discussion_r315935652
 
 

 ##
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionHandler.java
 ##
 @@ -165,6 +170,16 @@ public void onError(int errorCode, String errorMessage) {
   }
}
 
+   private void cancelRefs(ProtonTransactionImpl tx) throws Exception {
+  List toCancel = new ArrayList<>();
 
 Review comment:
   actually will be cleaner just to invoke rollback in serversession impl, then 
will have same logic, and will gain from having any other fixes.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2803: ARTEMIS-2458 
Fix AMQP Transaction Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#discussion_r315935652
 
 

 ##
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionHandler.java
 ##
 @@ -165,6 +170,16 @@ public void onError(int errorCode, String errorMessage) {
   }
}
 
+   private void cancelRefs(ProtonTransactionImpl tx) throws Exception {
+  List toCancel = new ArrayList<>();
 
 Review comment:
   actually will be cleaner just to invoke rollback in serversession impl, then 
will have same logic, and will gain from having any other fixes. just updated 
to make to do just that.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2803: ARTEMIS-2458 
Fix AMQP Transaction Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#discussion_r315931315
 
 

 ##
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionHandler.java
 ##
 @@ -165,6 +170,16 @@ public void onError(int errorCode, String errorMessage) {
   }
}
 
+   private void cancelRefs(ProtonTransactionImpl tx) throws Exception {
+  List toCancel = new ArrayList<>();
 
 Review comment:
   The only bit i wonder if we need to add here is the extra logic of stopping 
and restarting the consumer as like in ServerSessionImpl::cancelAndRollback
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
michaelandrepearce commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction 
Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523217501
 
 
   Well i beleive our test suite has a number of non-JMS AMQP tests also right, 
so as long as all pass.
   As said issue was actually found outside of Java land ;) ... just 
re-creatable in it.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] clebertsuconic edited a comment on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
clebertsuconic edited a comment on issue #2803: ARTEMIS-2458 Fix AMQP 
Transaction Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523217012
 
 
   @michaelandrepearce activemq5 is not removing the message from the queue. 
It's a different implementation.
   
   I'm just trying to find if we should either add a method on the LinkedLilst 
such as addBackInPlace. However if this is not breaking other cases.. I'm 100% 
for yourimplementation. I just want to make sure this is not breaking other 
cases. Otherwise we will need to add back in its place based on the mesasgeID.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction 
Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523217012
 
 
   @michaelandrepearce activemq5 is not removing the message from the queue. 
It's a different implementation.
   
   I'm just trying to find if we should either add a method on the LinkedLilst 
such as addBackInPlace. However if this is not breaking other cases.. I'm 100% 
on it. I just want to make sure this is not breaking other cases.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
michaelandrepearce commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction 
Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523216126
 
 
   We found the issue in .NET , and recreated because its easier to show in 
QPID JMS as artemis is Java and we have the integration test capability. 
   The test actually comes from QPID though they test against ActiveMQ5 where 
behaviour is correct, like wise correct behaviour when pointing .net at 
activemq5.
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce edited a comment on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
michaelandrepearce edited a comment on issue #2803: ARTEMIS-2458 Fix AMQP 
Transaction Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523215313
 
 
   The fact a session is rolled back, any inflight must be cancelled. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction 
Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523215692
 
 
   @michaelandrepearce I know that's true for JMS. I'm just asking if that's 
true for other implementations. is there anything on the AMQP spec that 
guarantees that? 
   
   I'm just trying to avoid breaking C++/.NET/ other implementations.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
michaelandrepearce commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction 
Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523215313
 
 
   The fact a session is rolled back, any inflight must be cancelled.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
clebertsuconic commented on issue #2803: ARTEMIS-2458 Fix AMQP Transaction 
Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803#issuecomment-523213179
 
 
   This might be valid on qpid-jms, but I'm not sure this is valid on the spec 
itself.
   
   You may have other cases where a rollback should not issue a server's 
cancellation. I'm not sure this is valid.. as it may break other cases.
   
   
   It's probably ok with qpid-jms, but you would need some soft of annotation 
to make sure this is valid. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315897493
 
 

 ##
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RingQueue.java
 ##
 @@ -0,0 +1,134 @@
+/*
+ * 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.artemis.core.server.impl;
+
+import java.util.concurrent.ScheduledExecutorService;
+
+import org.apache.activemq.artemis.api.core.RoutingType;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.filter.Filter;
+import org.apache.activemq.artemis.core.paging.cursor.PageSubscription;
+import org.apache.activemq.artemis.core.persistence.StorageManager;
+import org.apache.activemq.artemis.core.postoffice.PostOffice;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
+import org.apache.activemq.artemis.core.server.MessageReference;
+import org.apache.activemq.artemis.core.server.QueueFactory;
+import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.utils.actors.ArtemisExecutor;
+import org.jboss.logging.Logger;
+
+public class RingQueue extends QueueImpl {
+
+   private static final Logger logger = Logger.getLogger(RingQueue.class);
+   private final long ringSize;
+
+   public RingQueue(final long persistenceID,
+final SimpleString address,
+final SimpleString name,
+final Filter filter,
+final PageSubscription pageSubscription,
+final SimpleString user,
+final boolean durable,
+final boolean temporary,
+final boolean autoCreated,
+final RoutingType routingType,
+final Integer maxConsumers,
+final Boolean exclusive,
+final Boolean groupRebalance,
+final Integer groupBuckets,
+final SimpleString groupFirstKey,
+final Integer consumersBeforeDispatch,
+final Long delayBeforeDispatch,
+final Boolean purgeOnNoConsumers,
+final Long ringSize,
+final Boolean nonDestructive,
+final Boolean autoDelete,
+final Long autoDeleteDelay,
+final Long autoDeleteMessageCount,
+final boolean configurationManaged,
+final ScheduledExecutorService scheduledExecutor,
+final PostOffice postOffice,
+final StorageManager storageManager,
+final HierarchicalRepository 
addressSettingsRepository,
+final ArtemisExecutor executor,
+final ActiveMQServer server,
+final QueueFactory factory) {
+  super(persistenceID, address, name, filter, pageSubscription, user, 
durable, temporary, autoCreated, routingType, maxConsumers, exclusive, 
groupRebalance, groupBuckets, groupFirstKey, nonDestructive, 
consumersBeforeDispatch, delayBeforeDispatch, purgeOnNoConsumers, autoDelete, 
autoDeleteDelay, autoDeleteMessageCount, configurationManaged, 
scheduledExecutor, postOffice, storageManager, addressSettingsRepository, 
executor, server, factory);
+  this.ringSize = ringSize;
+   }
+
+   @Override
+   public synchronized void addTail(final MessageReference ref, final boolean 
direct) {
+  enforceRing();
+
+  super.addTail(ref, direct);
+   }
+
+   @Override
+   public synchronized void addHead(final MessageReference ref, boolean 
scheduling) {
+  enforceRing(ref, scheduling);
+
+  if (!ref.isAlreadyAcked()) {
+ super.addHead(ref, scheduling);
+  }
+   }
+
+   @Override
+   public boolean allowsReferenceCallback() {
+  return false;
+   }
+
+   private void enforceRing() {
+  enforceRing(null, false);
+   }
+
+   private v

[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315896584
 
 

 ##
 File path: 
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/RingQueueTest.java
 ##
 @@ -0,0 +1,186 @@
+/*
+ * 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.artemis.tests.integration.server;
+
+import javax.jms.Connection;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+
+import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
+import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.api.core.QueueAttributes;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.client.ClientConsumer;
+import org.apache.activemq.artemis.api.core.client.ClientMessage;
+import org.apache.activemq.artemis.api.core.client.ClientProducer;
+import org.apache.activemq.artemis.api.core.client.ClientSession;
+import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
+import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.ActiveMQServers;
+import org.apache.activemq.artemis.core.server.impl.RingQueue;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.tests.util.Wait;
+import org.apache.activemq.artemis.utils.RandomUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+public class RingQueueTest extends ActiveMQTestBase {
 
 Review comment:
   Can we add a test with persistence, also a test with non-destructive ring 
queue (ensure that when non-destructive it sill replaces/acks)


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315896115
 
 

 ##
 File path: docs/user-manual/en/ring-queue.md
 ##
 @@ -0,0 +1,99 @@
+# Ring Queue
+
+Queues operate with first-in, first-out (FIFO) semantics which means that
+messages, in general, are added to the "tail" of the queue and removed from the
+"head." A "ring" queue is a special type of queue with a *fixed* size. The
+fixed size is maintained by removing the message at the head of the queue when
+the number of messages on the queue reaches the configured size.
+
+For example, consider a queue configured with a ring size of 3 and a producer
+which sends the messages `A`, `B`, `C`, & `D` in that order. Once `C` is sent
+the number of messages in the queue will be 3 which is the same as the
+configured ring size. We can visualize the queue growth like this...
+
+After `A` is sent:
+```
+ |---|
+head/tail -> | A |
+ |---|
+```
+
+After `B` is sent:
+
+```
+|---|
+head -> | A |
+|---|
+tail -> | B |
+|---|
+```
+
+After `C` is sent:
+
+```
+|---|
+head -> | A |
+|---|
+| B |
+|---|
+tail -> | C |
+|---|
+```
+
+When `D` is sent it will be added to the tail of the queue and the message at
+the head of the queue (i.e. `A`) will be removed so the queue will look like
+this:
+
+```
+|---|
+head -> | B |
+|---|
+| C |
+|---|
+tail -> | D |
+|---|
+```
+
+This example covers the most basic use case with messages being added to the
+tail of the queue. However, there are a few other important use cases
+involving:
+
+ - Messages in delivery
+ - Rolled back messages
+ - Scheduled messages
+ - Paging
+
+However, before we get to those use cases let's look at the basic configuration
+of a ring queue.
+
+## Configuration
+
+There are 2 parameters related to ring queue configuration.
+
+The `ring-size` parameter can be set directly on the `queue` element. The
+default value is `-1` (i.e. no limit).
+
+```xml
+
+   
+  
+   
+
+```
+
+The `default-ring-size` is an `address-setting` which applies to queues on
+matching addresses which don't have an explicit `ring-size` set. This is
+especially useful for auto-created queues.
 
 Review comment:
   if not set default is -1 at the address setting level


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315895985
 
 

 ##
 File path: docs/user-manual/en/ring-queue.md
 ##
 @@ -0,0 +1,99 @@
+# Ring Queue
+
+Queues operate with first-in, first-out (FIFO) semantics which means that
+messages, in general, are added to the "tail" of the queue and removed from the
+"head." A "ring" queue is a special type of queue with a *fixed* size. The
+fixed size is maintained by removing the message at the head of the queue when
+the number of messages on the queue reaches the configured size.
+
+For example, consider a queue configured with a ring size of 3 and a producer
+which sends the messages `A`, `B`, `C`, & `D` in that order. Once `C` is sent
+the number of messages in the queue will be 3 which is the same as the
+configured ring size. We can visualize the queue growth like this...
+
+After `A` is sent:
+```
+ |---|
+head/tail -> | A |
+ |---|
+```
+
+After `B` is sent:
+
+```
+|---|
+head -> | A |
+|---|
+tail -> | B |
+|---|
+```
+
+After `C` is sent:
+
+```
+|---|
+head -> | A |
+|---|
+| B |
+|---|
+tail -> | C |
+|---|
+```
+
+When `D` is sent it will be added to the tail of the queue and the message at
+the head of the queue (i.e. `A`) will be removed so the queue will look like
+this:
+
+```
+|---|
+head -> | B |
+|---|
+| C |
+|---|
+tail -> | D |
+|---|
+```
+
+This example covers the most basic use case with messages being added to the
+tail of the queue. However, there are a few other important use cases
+involving:
+
+ - Messages in delivery
+ - Rolled back messages
+ - Scheduled messages
+ - Paging
+
+However, before we get to those use cases let's look at the basic configuration
+of a ring queue.
+
+## Configuration
+
+There are 2 parameters related to ring queue configuration.
+
+The `ring-size` parameter can be set directly on the `queue` element. The
+default value is `-1` (i.e. no limit).
 
 Review comment:
   wont the default value come from address setting? 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315895086
 
 

 ##
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RingQueue.java
 ##
 @@ -0,0 +1,134 @@
+/*
+ * 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.artemis.core.server.impl;
+
+import java.util.concurrent.ScheduledExecutorService;
+
+import org.apache.activemq.artemis.api.core.RoutingType;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.filter.Filter;
+import org.apache.activemq.artemis.core.paging.cursor.PageSubscription;
+import org.apache.activemq.artemis.core.persistence.StorageManager;
+import org.apache.activemq.artemis.core.postoffice.PostOffice;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
+import org.apache.activemq.artemis.core.server.MessageReference;
+import org.apache.activemq.artemis.core.server.QueueFactory;
+import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.utils.actors.ArtemisExecutor;
+import org.jboss.logging.Logger;
+
+public class RingQueue extends QueueImpl {
+
+   private static final Logger logger = Logger.getLogger(RingQueue.class);
+   private final long ringSize;
+
+   public RingQueue(final long persistenceID,
+final SimpleString address,
+final SimpleString name,
+final Filter filter,
+final PageSubscription pageSubscription,
+final SimpleString user,
+final boolean durable,
+final boolean temporary,
+final boolean autoCreated,
+final RoutingType routingType,
+final Integer maxConsumers,
+final Boolean exclusive,
+final Boolean groupRebalance,
+final Integer groupBuckets,
+final SimpleString groupFirstKey,
+final Integer consumersBeforeDispatch,
+final Long delayBeforeDispatch,
+final Boolean purgeOnNoConsumers,
+final Long ringSize,
+final Boolean nonDestructive,
+final Boolean autoDelete,
+final Long autoDeleteDelay,
+final Long autoDeleteMessageCount,
+final boolean configurationManaged,
+final ScheduledExecutorService scheduledExecutor,
+final PostOffice postOffice,
+final StorageManager storageManager,
+final HierarchicalRepository 
addressSettingsRepository,
+final ArtemisExecutor executor,
+final ActiveMQServer server,
+final QueueFactory factory) {
+  super(persistenceID, address, name, filter, pageSubscription, user, 
durable, temporary, autoCreated, routingType, maxConsumers, exclusive, 
groupRebalance, groupBuckets, groupFirstKey, nonDestructive, 
consumersBeforeDispatch, delayBeforeDispatch, purgeOnNoConsumers, autoDelete, 
autoDeleteDelay, autoDeleteMessageCount, configurationManaged, 
scheduledExecutor, postOffice, storageManager, addressSettingsRepository, 
executor, server, factory);
+  this.ringSize = ringSize;
+   }
+
+   @Override
+   public synchronized void addTail(final MessageReference ref, final boolean 
direct) {
+  enforceRing();
+
+  super.addTail(ref, direct);
+   }
+
+   @Override
+   public synchronized void addHead(final MessageReference ref, boolean 
scheduling) {
+  enforceRing(ref, scheduling);
+
+  if (!ref.isAlreadyAcked()) {
+ super.addHead(ref, scheduling);
+  }
+   }
+
+   @Override
+   public boolean allowsReferenceCallback() {
+  return false;
+   }
+
+   private void enforceRing() {
+  enforceRing(null, false);
+   }
+
+   private v

[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315894762
 
 

 ##
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RingQueue.java
 ##
 @@ -0,0 +1,134 @@
+/*
+ * 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.artemis.core.server.impl;
+
+import java.util.concurrent.ScheduledExecutorService;
+
+import org.apache.activemq.artemis.api.core.RoutingType;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.filter.Filter;
+import org.apache.activemq.artemis.core.paging.cursor.PageSubscription;
+import org.apache.activemq.artemis.core.persistence.StorageManager;
+import org.apache.activemq.artemis.core.postoffice.PostOffice;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
+import org.apache.activemq.artemis.core.server.MessageReference;
+import org.apache.activemq.artemis.core.server.QueueFactory;
+import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.utils.actors.ArtemisExecutor;
+import org.jboss.logging.Logger;
+
+public class RingQueue extends QueueImpl {
+
+   private static final Logger logger = Logger.getLogger(RingQueue.class);
+   private final long ringSize;
+
+   public RingQueue(final long persistenceID,
+final SimpleString address,
+final SimpleString name,
+final Filter filter,
+final PageSubscription pageSubscription,
+final SimpleString user,
+final boolean durable,
+final boolean temporary,
+final boolean autoCreated,
+final RoutingType routingType,
+final Integer maxConsumers,
+final Boolean exclusive,
+final Boolean groupRebalance,
+final Integer groupBuckets,
+final SimpleString groupFirstKey,
+final Integer consumersBeforeDispatch,
+final Long delayBeforeDispatch,
+final Boolean purgeOnNoConsumers,
+final Long ringSize,
+final Boolean nonDestructive,
+final Boolean autoDelete,
+final Long autoDeleteDelay,
+final Long autoDeleteMessageCount,
+final boolean configurationManaged,
+final ScheduledExecutorService scheduledExecutor,
+final PostOffice postOffice,
+final StorageManager storageManager,
+final HierarchicalRepository 
addressSettingsRepository,
+final ArtemisExecutor executor,
+final ActiveMQServer server,
+final QueueFactory factory) {
+  super(persistenceID, address, name, filter, pageSubscription, user, 
durable, temporary, autoCreated, routingType, maxConsumers, exclusive, 
groupRebalance, groupBuckets, groupFirstKey, nonDestructive, 
consumersBeforeDispatch, delayBeforeDispatch, purgeOnNoConsumers, autoDelete, 
autoDeleteDelay, autoDeleteMessageCount, configurationManaged, 
scheduledExecutor, postOffice, storageManager, addressSettingsRepository, 
executor, server, factory);
+  this.ringSize = ringSize;
+   }
+
+   @Override
+   public synchronized void addTail(final MessageReference ref, final boolean 
direct) {
+  enforceRing();
+
+  super.addTail(ref, direct);
+   }
+
+   @Override
+   public synchronized void addHead(final MessageReference ref, boolean 
scheduling) {
+  enforceRing(ref, scheduling);
+
+  if (!ref.isAlreadyAcked()) {
+ super.addHead(ref, scheduling);
+  }
+   }
+
+   @Override
+   public boolean allowsReferenceCallback() {
+  return false;
+   }
+
+   private void enforceRing() {
+  enforceRing(null, false);
+   }
+
+   private v

[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315894325
 
 

 ##
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueuePendingMessageMetrics.java
 ##
 @@ -67,6 +74,7 @@ public void incrementMetrics(final MessageReference 
reference) {
public void decrementMetrics(final MessageReference reference) {
   long size = -getPersistentSize(reference);
   COUNT_UPDATER.decrementAndGet(this);
+  logger.debugf("%s decrement messageCount to %d: %s", this, messageCount, 
reference);
 
 Review comment:
   can we put inside if debug enabled (as on hot path) so will be removed by 
jit if debug isnt on.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315894255
 
 

 ##
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueuePendingMessageMetrics.java
 ##
 @@ -49,14 +52,18 @@
 
private final Queue queue;
 
-   public QueuePendingMessageMetrics(final Queue queue) {
+   private final String name;
+
+   public QueuePendingMessageMetrics(final Queue queue, final String name) {
   Preconditions.checkNotNull(queue);
   this.queue = queue;
+  this.name = name;
}
 
public void incrementMetrics(final MessageReference reference) {
   long size = getPersistentSize(reference);
   COUNT_UPDATER.incrementAndGet(this);
+  logger.debugf("%s increment messageCount to %d: %s", this, messageCount, 
reference);
 
 Review comment:
   can we put inside if debug enabled (as on hot path) so will be removed by 
jit if debug isnt on.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315893555
 
 

 ##
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
 ##
 @@ -3272,7 +3273,8 @@ public Queue createQueue(final AddressInfo addrInfo,
 final long autoDeleteDelay,
 final long autoDeleteMessageCount,
 final boolean autoCreateAddress,
-final boolean configurationManaged) throws 
Exception {
+final boolean configurationManaged,
+final long ringSize) throws Exception {
 
 Review comment:
   breaking api change, new param needs a new method added (old method 
interface honoured)


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315892892
 
 

 ##
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
 ##
 @@ -449,7 +449,7 @@ Queue createQueue(AddressInfo addressInfo, SimpleString 
queueName, SimpleString
Queue createQueue(AddressInfo addressInfo, SimpleString queueName, 
SimpleString filter,
  SimpleString user, boolean durable, boolean temporary, 
boolean autoCreated, Integer maxConsumers,
  Boolean purgeOnNoConsumers, Boolean exclusive, Boolean 
groupRebalance, Integer groupBuckets, SimpleString groupFirstKey, Boolean 
lastValue, SimpleString lastValueKey, Boolean nonDestructive,
- Integer consumersBeforeDispatch, Long 
delayBeforeDispatch, Boolean autoDelete, Long autoDeleteDelay, Long 
autoDeleteMessageCount, boolean autoCreateAddress) throws Exception;
+ Integer consumersBeforeDispatch, Long 
delayBeforeDispatch, Boolean autoDelete, Long autoDeleteDelay, Long 
autoDeleteMessageCount, boolean autoCreateAddress, Long ringSize) throws 
Exception;
 
 Review comment:
   Breaking api change, since last version, should have an new method with 
extra param


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315892892
 
 

 ##
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
 ##
 @@ -449,7 +449,7 @@ Queue createQueue(AddressInfo addressInfo, SimpleString 
queueName, SimpleString
Queue createQueue(AddressInfo addressInfo, SimpleString queueName, 
SimpleString filter,
  SimpleString user, boolean durable, boolean temporary, 
boolean autoCreated, Integer maxConsumers,
  Boolean purgeOnNoConsumers, Boolean exclusive, Boolean 
groupRebalance, Integer groupBuckets, SimpleString groupFirstKey, Boolean 
lastValue, SimpleString lastValueKey, Boolean nonDestructive,
- Integer consumersBeforeDispatch, Long 
delayBeforeDispatch, Boolean autoDelete, Long autoDeleteDelay, Long 
autoDeleteMessageCount, boolean autoCreateAddress) throws Exception;
+ Integer consumersBeforeDispatch, Long 
delayBeforeDispatch, Boolean autoDelete, Long autoDeleteDelay, Long 
autoDeleteMessageCount, boolean autoCreateAddress, Long ringSize) throws 
Exception;
 
 Review comment:
   Breaking api change, since last version, should have an override method.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315892030
 
 

 ##
 File path: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/QueueQueryImpl.java
 ##
 @@ -95,70 +97,7 @@ public QueueQueryImpl(final boolean durable,
  final SimpleString name,
  final boolean exists,
  final boolean autoCreateQueues) {
-  this(durable, temporary, consumerCount, messageCount, filterString, 
address, name, exists, autoCreateQueues, -1, false, false, 
RoutingType.MULTICAST);
 
 Review comment:
   wont this be a breaking change removing the old api's if anyone is using 
CORE api directly? I appreciate its hidden for JMS users.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on issue #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on issue #2802: ARTEMIS-2457 implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#issuecomment-523184603
 
 
   In QPID both size in message count can be configured / or size in total 
bytes.  I cannot see how we can set the latter?
   
   What's the reason to make this a brand new queue type entirely over just 
making it something configurable, i ask as it means cannot change an existing 
queue into a ring queue without deleting and recreating, where as having it a 
setting in QueueImpl like almost all others would give the dynamic ability. 
   
   On top of the last comment, can we dynamically update the size, e.g. 
increase or decrease its limit, so that if incorrectly sized it can be tuned, 
without need of re-creating.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315889063
 
 

 ##
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueuePendingMessageMetrics.java
 ##
 @@ -67,6 +74,7 @@ public void incrementMetrics(final MessageReference 
reference) {
public void decrementMetrics(final MessageReference reference) {
   long size = -getPersistentSize(reference);
   COUNT_UPDATER.decrementAndGet(this);
+  logger.debugf("%s decrement messageCount to %d: %s", this, messageCount, 
reference);
 
 Review comment:
   can we wrap this in a isDebugEnabled


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2802: ARTEMIS-2457 
implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802#discussion_r315888950
 
 

 ##
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueuePendingMessageMetrics.java
 ##
 @@ -49,14 +52,18 @@
 
private final Queue queue;
 
-   public QueuePendingMessageMetrics(final Queue queue) {
+   private final String name;
+
+   public QueuePendingMessageMetrics(final Queue queue, final String name) {
   Preconditions.checkNotNull(queue);
   this.queue = queue;
+  this.name = name;
}
 
public void incrementMetrics(final MessageReference reference) {
   long size = getPersistentSize(reference);
   COUNT_UPDATER.incrementAndGet(this);
+  logger.debugf("%s increment messageCount to %d: %s", this, messageCount, 
reference);
 
 Review comment:
   can we wrap this in a isDebugEnabled


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce opened a new pull request #2803: ARTEMIS-2458 Fix AMQP Transaction Rollback Ordering

2019-08-20 Thread GitBox
michaelandrepearce opened a new pull request #2803: ARTEMIS-2458 Fix AMQP 
Transaction Rollback Ordering
URL: https://github.com/apache/activemq-artemis/pull/2803
 
 
   Ensure cancel of in-flight message, occurs before rollback, to ensure 
ordering guarantee. As like with Core.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] jbertram opened a new pull request #2802: ARTEMIS-2457 implement ring queue

2019-08-20 Thread GitBox
jbertram opened a new pull request #2802: ARTEMIS-2457 implement ring queue
URL: https://github.com/apache/activemq-artemis/pull/2802
 
 
   Don't merge this yet. I've still got a few tests to add for basic 
configuration stuff, and I also need to finish the docs. I'm putting this up 
now to get reviews/opinions.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2785: ARTEMIS-2442 throw ActiveMQResourceLimitException if session/queue limit is reached

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2785: ARTEMIS-2442 
throw ActiveMQResourceLimitException if session/queue limit is reached
URL: https://github.com/apache/activemq-artemis/pull/2785#discussion_r315756775
 
 

 ##
 File path: 
artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQResourceLimitException.java
 ##
 @@ -0,0 +1,30 @@
+/*
+ * 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.artemis.api.core;
+
+public final class ActiveMQResourceLimitException extends ActiveMQException {
+
 
 Review comment:
   The point here isnt code within the broker but code in end user clients. 
People who are using core api directly. You need to keep compatibility for them 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #2785: ARTEMIS-2442 throw ActiveMQResourceLimitException if session/queue limit is reached

2019-08-20 Thread GitBox
michaelandrepearce commented on a change in pull request #2785: ARTEMIS-2442 
throw ActiveMQResourceLimitException if session/queue limit is reached
URL: https://github.com/apache/activemq-artemis/pull/2785#discussion_r315756775
 
 

 ##
 File path: 
artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQResourceLimitException.java
 ##
 @@ -0,0 +1,30 @@
+/*
+ * 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.artemis.api.core;
+
+public final class ActiveMQResourceLimitException extends ActiveMQException {
+
 
 Review comment:
   The point here isnt code within the broker but code in end user clients. 
People who are using core api directly.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [activemq-artemis] asfgit closed pull request #2800: ARTEMIS-2451 eliminate knownDestinations cache

2019-08-20 Thread GitBox
asfgit closed pull request #2800: ARTEMIS-2451 eliminate knownDestinations cache
URL: https://github.com/apache/activemq-artemis/pull/2800
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services