[qpid-broker-j] branch 7.1.x updated (d100cdc -> 0d8fd3e)

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git.


from d100cdc  QPID-8376 : Fix earlier change to work on JDK 11 as well as 
JDK 8
 new faad55d  QPID-8379: [Broker-J] Upgrade jackson dependecies to version 
2.10.1
 new 0d8fd3e  QPID-8379: [Broker-J] Update dependecy files

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../dependency-verification/DEPENDENCIES_REFERENCE|  6 +++---
 .../dependency-verification/DEPENDENCIES_REFERENCE|  6 +++---
 pom.xml   |  4 ++--
 .../java/org/apache/qpid/tests/http/HttpTestHelper.java   | 15 +++
 4 files changed, 15 insertions(+), 16 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] 01/02: QPID-8379: [Broker-J] Upgrade jackson dependecies to version 2.10.1

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit faad55dfe0ff72fbc93774090b062b707ed1ec6e
Author: Alex Rudyy 
AuthorDate: Mon Nov 18 16:08:42 2019 +

QPID-8379: [Broker-J] Upgrade jackson dependecies to version 2.10.1

This closes #40

(cherry picked from commit 45d10564ad5ac1c6a5aca2f90e59215ba39bb0da)
---
 pom.xml   |  4 ++--
 .../java/org/apache/qpid/tests/http/HttpTestHelper.java   | 15 +++
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/pom.xml b/pom.xml
index a655c9f..69d9279 100644
--- a/pom.xml
+++ b/pom.xml
@@ -105,8 +105,8 @@
 10.13.1.1
 1.2.3
 27.0-jre
-2.9.10
-
2.9.10
+2.10.1
+
2.10.1
 1.7.26
 9.4.19.v20190610
 
diff --git 
a/systests/qpid-systests-http-management/src/main/java/org/apache/qpid/tests/http/HttpTestHelper.java
 
b/systests/qpid-systests-http-management/src/main/java/org/apache/qpid/tests/http/HttpTestHelper.java
index 5efc3aa..a2b94ad 100644
--- 
a/systests/qpid-systests-http-management/src/main/java/org/apache/qpid/tests/http/HttpTestHelper.java
+++ 
b/systests/qpid-systests-http-management/src/main/java/org/apache/qpid/tests/http/HttpTestHelper.java
@@ -38,7 +38,6 @@ import java.security.UnrecoverableKeyException;
 import java.security.cert.X509Certificate;
 import java.util.Base64;
 import java.util.HashMap;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -64,11 +63,11 @@ public class HttpTestHelper
 {
 private static final Logger LOGGER = 
LoggerFactory.getLogger(HttpTestHelper.class);
 
-private static final TypeReference>> 
TYPE_LIST_OF_LINKED_HASH_MAPS = new TypeReference>>()
+private static final TypeReference>> 
TYPE_LIST_OF_MAPS = new TypeReference>>()
 {
 };
 
-private static final TypeReference> 
TYPE_LINKED_HASH_MAPS = new TypeReference>()
+private static final TypeReference> TYPE_MAP = new 
TypeReference>()
 {
 };
 
@@ -191,7 +190,7 @@ public class HttpTestHelper
 byte[] data = readConnectionInputStream(connection);
 
 ObjectMapper mapper = new ObjectMapper();
-Map providedObject = mapper.readValue(new 
ByteArrayInputStream(data), TYPE_LINKED_HASH_MAPS);
+Map providedObject = mapper.readValue(new 
ByteArrayInputStream(data), TYPE_MAP);
 return providedObject;
 }
 
@@ -225,15 +224,15 @@ public class HttpTestHelper
 
 public List> getJsonAsList(String path) throws 
IOException
 {
-return getJson(path, TYPE_LIST_OF_LINKED_HASH_MAPS, 
HttpServletResponse.SC_OK);
+return getJson(path, TYPE_LIST_OF_MAPS, HttpServletResponse.SC_OK);
 }
 
 public Map getJsonAsMap(String path) throws IOException
 {
-return getJson(path, TYPE_LINKED_HASH_MAPS, HttpServletResponse.SC_OK);
+return getJson(path, TYPE_MAP, HttpServletResponse.SC_OK);
 }
 
-public  T getJson(String path, final TypeReference valueTypeRef, int 
expectedResponseCode) throws IOException
+public  T getJson(String path, final TypeReference valueTypeRef, int 
expectedResponseCode) throws IOException
 {
 int responseCode = -1;
 HttpURLConnection connection = openManagementConnection(path, "GET");
@@ -255,7 +254,7 @@ public class HttpTestHelper
 }
 }
 
-public  T postJson(String path, final Object data, final TypeReference 
valueTypeRef, int expectedResponseCode) throws IOException
+public  T postJson(String path, final Object data, final 
TypeReference valueTypeRef, int expectedResponseCode) throws IOException
 {
 int responseCode = -1;
 HttpURLConnection connection = openManagementConnection(path, "POST");


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] 02/02: QPID-8379: [Broker-J] Update dependecy files

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit 0d8fd3ec8c51990d4eec7893b8f9db11f8c8a594
Author: Alex Rudyy 
AuthorDate: Mon Nov 18 17:40:28 2019 +

QPID-8379: [Broker-J] Update dependecy files

(cherry picked from commit e994de9b4232a69c77f5669641a918a5468502a7)
---
 .../main/assembly/dependency-verification/DEPENDENCIES_REFERENCE| 6 +++---
 .../main/assembly/dependency-verification/DEPENDENCIES_REFERENCE| 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/apache-qpid-broker-j/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
 
b/apache-qpid-broker-j/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
index 1597f55..1ac33fd 100644
--- 
a/apache-qpid-broker-j/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
+++ 
b/apache-qpid-broker-j/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
@@ -37,11 +37,11 @@ From: 'Apache Software Foundation' (http://db.apache.org/)
 License: Apache 2  (http://www.apache.org/licenses/LICENSE-2.0.txt)
 
 From: 'FasterXML' (http://fasterxml.com/)
-  - Jackson-annotations (http://github.com/FasterXML/jackson) 
com.fasterxml.jackson.core:jackson-annotations:bundle:2.9.10
+  - Jackson-annotations (http://github.com/FasterXML/jackson) 
com.fasterxml.jackson.core:jackson-annotations:bundle:2.10.1
 License: The Apache Software License, Version 2.0  
(http://www.apache.org/licenses/LICENSE-2.0.txt)
-  - Jackson-core (https://github.com/FasterXML/jackson-core) 
com.fasterxml.jackson.core:jackson-core:bundle:2.9.10
+  - Jackson-core (https://github.com/FasterXML/jackson-core) 
com.fasterxml.jackson.core:jackson-core:bundle:2.10.1
 License: The Apache Software License, Version 2.0  
(http://www.apache.org/licenses/LICENSE-2.0.txt)
-  - jackson-databind (http://github.com/FasterXML/jackson) 
com.fasterxml.jackson.core:jackson-databind:bundle:2.9.10
+  - jackson-databind (http://github.com/FasterXML/jackson) 
com.fasterxml.jackson.core:jackson-databind:bundle:2.10.1
 License: The Apache Software License, Version 2.0  
(http://www.apache.org/licenses/LICENSE-2.0.txt)
 
 From: 'GlassFish Community' (https://glassfish.dev.java.net)
diff --git 
a/perftests/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE 
b/perftests/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
index f85ec1c..df17878 100644
--- a/perftests/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
+++ b/perftests/src/main/assembly/dependency-verification/DEPENDENCIES_REFERENCE
@@ -33,11 +33,11 @@ From: 'Apache Software Foundation' (http://www.apache.org)
 License: The Apache Software License, Version 2.0  
(http://www.apache.org/licenses/LICENSE-2.0.txt)
 
 From: 'FasterXML' (http://fasterxml.com/)
-  - Jackson-annotations (http://github.com/FasterXML/jackson) 
com.fasterxml.jackson.core:jackson-annotations:bundle:2.9.10
+  - Jackson-annotations (http://github.com/FasterXML/jackson) 
com.fasterxml.jackson.core:jackson-annotations:bundle:2.10.1
 License: The Apache Software License, Version 2.0  
(http://www.apache.org/licenses/LICENSE-2.0.txt)
-  - Jackson-core (https://github.com/FasterXML/jackson-core) 
com.fasterxml.jackson.core:jackson-core:bundle:2.9.10
+  - Jackson-core (https://github.com/FasterXML/jackson-core) 
com.fasterxml.jackson.core:jackson-core:bundle:2.10.1
 License: The Apache Software License, Version 2.0  
(http://www.apache.org/licenses/LICENSE-2.0.txt)
-  - jackson-databind (http://github.com/FasterXML/jackson) 
com.fasterxml.jackson.core:jackson-databind:bundle:2.9.10
+  - jackson-databind (http://github.com/FasterXML/jackson) 
com.fasterxml.jackson.core:jackson-databind:bundle:2.10.1
 License: The Apache Software License, Version 2.0  
(http://www.apache.org/licenses/LICENSE-2.0.txt)
 
 From: 'QOS.ch' (http://www.qos.ch)


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] branch 7.1.x updated (cdde19c -> d100cdc)

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git.


from cdde19c  QPID-8377 : add test to verify IGNORE behaviour
 new d238eae  QPID-8376 : Report Process CPU usage in Broker Stats
 new d100cdc  QPID-8376 : Fix earlier change to work on JDK 11 as well as 
JDK 8

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../qpid/server/model/BrokerAttributeInjector.java | 138 -
 1 file changed, 135 insertions(+), 3 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] 02/02: QPID-8376 : Fix earlier change to work on JDK 11 as well as JDK 8

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit d100cdcac4d29f7ec3be82b55f7cbea193715eb4
Author: Robert Godfrey 
AuthorDate: Fri Nov 22 21:34:31 2019 +0100

QPID-8376 : Fix earlier change to work on JDK 11 as well as JDK 8

(cherry picked from commit 039e34899c229164a557c8e6debec3e11f5db6bc)
---
 .../qpid/server/model/BrokerAttributeInjector.java | 183 -
 1 file changed, 105 insertions(+), 78 deletions(-)

diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
 
b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
index a2d5278..61be55f 100644
--- 
a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
+++ 
b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
@@ -62,14 +62,16 @@ public class BrokerAttributeInjector implements 
ConfiguredObjectAttributeInjecto
 
 private final Class _hotSpotDiagnosticMXBeanClass;
 private final PlatformManagedObject _hotSpotDiagnosticMXBean;
+private final Class _operatingSystemMXBeanClass;
+private final OperatingSystemMXBean _operatingSystemMXBean;
 
 public BrokerAttributeInjector()
 {
+ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
 Class hotSpotDiagnosticMXBeanClass = null;
 PlatformManagedObject hotSpotDiagnosticMXBean = null;
 try
 {
-ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
 hotSpotDiagnosticMXBeanClass =
 
Class.forName("com.sun.management.HotSpotDiagnosticMXBean", true, 
systemClassLoader);
 hotSpotDiagnosticMXBean =
@@ -83,6 +85,26 @@ public class BrokerAttributeInjector implements 
ConfiguredObjectAttributeInjecto
 
 _hotSpotDiagnosticMXBeanClass = hotSpotDiagnosticMXBeanClass;
 _hotSpotDiagnosticMXBean = hotSpotDiagnosticMXBean;
+
+
+Class operatingSystemMXBeanClass = null;
+PlatformManagedObject operatingSystemMXBean = null;
+try
+{
+operatingSystemMXBeanClass =
+Class.forName("com.sun.management.OperatingSystemMXBean", 
true, systemClassLoader);
+operatingSystemMXBean =
+ManagementFactory.getPlatformMXBean((Class) operatingSystemMXBeanClass);
+
+}
+catch (IllegalArgumentException | ClassNotFoundException e)
+{
+LOGGER.debug("com.sun.management.OperatingSystemMXBean MXBean: " + 
e);
+}
+
+_operatingSystemMXBeanClass = operatingSystemMXBeanClass;
+_operatingSystemMXBean = (OperatingSystemMXBean) operatingSystemMXBean;
+
 }
 
 @Override
@@ -167,7 +189,8 @@ public class BrokerAttributeInjector implements 
ConfiguredObjectAttributeInjecto
 new 
ConfiguredObjectInjectedStatistic<>(jvmGCCollectionTimeStatisticName,
 
getGCCollectionTime,
 new 
Object[]{garbageCollectorMXBean},
-"Cumulative 
time in ms taken to perform collections for GC " + 
garbageCollectorMXBean.getName(),
+"Cumulative 
time in ms taken to perform collections for GC "
++ 
garbageCollectorMXBean.getName(),
 _typeValidator,
 
StatisticUnit.COUNT,
 
StatisticType.CUMULATIVE,
@@ -189,7 +212,8 @@ public class BrokerAttributeInjector implements 
ConfiguredObjectAttributeInjecto
 new 
ConfiguredObjectInjectedStatistic<>(jvmGCCollectionCountStatisticName,
 
getGCCollectionCount,
 new 
Object[]{garbageCollectorMXBean},
-"Cumulative 
number of collections for GC " + garbageCollectorMXBean.getName(),
+"Cumulative 
number of collections for GC "
++ 
garbageCollectorMXBean.getName(),
 _typeValidator,
 
StatisticUnit.COUNT,
 
StatisticType.CUMULATIVE,
@@ -203,94 +227,97 @@ public class BrokerAttributeInjector 

[qpid-broker-j] 01/02: QPID-8376 : Report Process CPU usage in Broker Stats

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit d238eae169f5a543163111cce1aaa6676cbda793
Author: Robert Godfrey 
AuthorDate: Sun Nov 17 13:14:50 2019 +0100

QPID-8376 : Report Process CPU usage in Broker Stats

(cherry picked from commit b8d24fc93ba41d3a4b4b5b74c04ea444a78e7943)
---
 .../qpid/server/model/BrokerAttributeInjector.java | 105 +
 1 file changed, 105 insertions(+)

diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
 
b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
index 42d108e..a2d5278 100644
--- 
a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
+++ 
b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
@@ -23,13 +23,18 @@ package org.apache.qpid.server.model;
 import java.lang.management.GarbageCollectorMXBean;
 import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryPoolMXBean;
+import java.lang.management.OperatingSystemMXBean;
 import java.lang.management.PlatformManagedObject;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
+import java.util.function.ToLongFunction;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -197,6 +202,95 @@ public class BrokerAttributeInjector implements 
ConfiguredObjectAttributeInjecto
 LOGGER.warn("Failed to inject statistic '{}'", 
jvmGCCollectionCountStatisticName, e);
 }
 }
+
+OperatingSystemMXBean osMXBean = 
ManagementFactory.getOperatingSystemMXBean();
+try
+{
+Method method = 
osMXBean.getClass().getDeclaredMethod("getProcessCpuTime");
+method.setAccessible(true);
+ToLongFunction supplier  = broker -> {
+try
+{
+final Object returnValue = method.invoke(osMXBean);
+
+if(returnValue instanceof Number)
+{
+return ((Number)returnValue).longValue();
+}
+}
+catch (IllegalAccessException | InvocationTargetException e)
+{
+LOGGER.warn("Unable to get cumulative process CPU time");
+}
+return -1L;
+};
+
+Method getLongValue = 
BrokerAttributeInjector.class.getDeclaredMethod("getLongValue",
+   
   Broker.class,
+   
   ToLongFunction.class);
+
+final ConfiguredObjectInjectedStatistic injectedStatistic =
+new ConfiguredObjectInjectedStatistic<>("processCpuTime",
+getLongValue,
+new 
Object[]{supplier},
+"Cumulative 
process CPU time",
+_typeValidator,
+
StatisticUnit.TIME_DURATION,
+
StatisticType.CUMULATIVE,
+osMXBean.getName()
++ " Process CPU 
Time");
+statistics.add(injectedStatistic);
+
+}
+catch (NoSuchMethodException e)
+{
+LOGGER.warn("Failed to inject statistic 'getProcessCpuTime'", e);
+}
+
+try
+{
+Method method = 
osMXBean.getClass().getDeclaredMethod("getProcessCpuLoad");
+method.setAccessible(true);
+Function supplier  = broker -> {
+try
+{
+final Object returnValue = method.invoke(osMXBean);
+
+if(returnValue instanceof Number)
+{
+return BigDecimal.valueOf(((Number) 
returnValue).doubleValue()).setScale(4,
+   
  RoundingMode.HALF_UP);
+}
+}
+catch (IllegalAccessException | InvocationTargetException e)
+{
+LOGGER.warn("Unable to get current process CPU load");
+}
+return BigDecimal.valueOf(Double.NaN);
+};
+
+ 

[qpid-broker-j] 01/04: QPID-8381: [Broker-J] Upgrade Oracle BDB JE dependency to version 7.5.11

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit 8a31ba33cc913417efdf18dfaf2d3df2409b9180
Author: Alex Rudyy 
AuthorDate: Sat Nov 23 23:35:57 2019 +

QPID-8381: [Broker-J] Upgrade Oracle BDB JE dependency to version 7.5.11

(cherry picked from commit d5ae00b256914fb8af0ead9a2362f9476c59218c)
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 7717184..a655c9f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -101,7 +101,7 @@
 $
 @
 
-7.4.5
+7.5.11
 10.13.1.1
 1.2.3
 27.0-jre


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] 03/04: QPID-8377 : Allow configuration of behaviour with unknown exchange declare arguments

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit a7d5b793bf35d1b3638c694753aa3ed76aa0838c
Author: Robert Godfrey 
AuthorDate: Sun Nov 17 23:12:30 2019 +0100

QPID-8377 : Allow configuration of behaviour with unknown exchange declare 
arguments

(cherry picked from commit 03b751e1467f7482c825f6c5f09a89bb0157b057)
---
 .../org/apache/qpid/server/model/Exchange.java | 11 ++
 .../protocol/v0_10/ServerSessionDelegate.java  | 24 +-
 .../qpid/server/protocol/v0_8/AMQChannel.java  | 22 
 3 files changed, 48 insertions(+), 9 deletions(-)

diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java 
b/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java
index eb54c75..800f57c 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/Exchange.java
@@ -52,6 +52,17 @@ public interface Exchange> extends 
ConfiguredObject, Me
 REJECT, DISCARD
 }
 
+enum BehaviourOnUnknownDeclareArgument
+{
+IGNORE, LOG, FAIL
+}
+
+String UNKNOWN_EXCHANGE_DECLARE_ARGUMENT_BEHAVIOUR_NAME = 
"exchange.behaviourOnUnknownDeclareArgument";
+@ManagedContextDefault(name= 
UNKNOWN_EXCHANGE_DECLARE_ARGUMENT_BEHAVIOUR_NAME)
+BehaviourOnUnknownDeclareArgument
+ON_UNKNOWN_EXCHANGE_DECLARE_OPTION = 
BehaviourOnUnknownDeclareArgument.FAIL;
+
+
 // Attributes
 
 @ManagedAttribute(description = "Provides an alternate destination that, 
depending on behaviour requested by the "
diff --git 
a/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
 
b/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
index d97f1c6..06c1690 100644
--- 
a/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
+++ 
b/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
@@ -938,7 +938,7 @@ public class ServerSessionDelegate extends 
MethodDelegate impleme
 
attributes.put(org.apache.qpid.server.model.Exchange.ALTERNATE_BINDING,

Collections.singletonMap(AlternateBinding.DESTINATION, alternateExchangeName));
 }
-validateExchangeDeclareArguments(attributes, 
session.getAMQPConnection().getModel());
+validateAndSanitizeExchangeDeclareArguments(attributes, 
session.getAMQPConnection());
 addressSpace.createMessageDestination(Exchange.class, 
attributes);;
 }
 catch(ReservedExchangeNameException e)
@@ -997,8 +997,9 @@ public class ServerSessionDelegate extends 
MethodDelegate impleme
 }
 }
 
-private void validateExchangeDeclareArguments(final Map 
attributes, final Model model)
+private void validateAndSanitizeExchangeDeclareArguments(final Map attributes, final AMQPConnection_0_10 connection)
 {
+final Model model = connection.getModel();
 final ConfiguredObjectTypeRegistry typeRegistry = 
model.getTypeRegistry();
 final List> types = new 
ArrayList<>(typeRegistry.getAttributeTypes(Exchange.class).values());
 typeRegistry.getTypeSpecialisations(Exchange.class).forEach(type -> 
types.addAll(typeRegistry.getTypeSpecificAttributes(type)));
@@ -1007,11 +1008,24 @@ public class ServerSessionDelegate extends 
MethodDelegate impleme
   .filter(name -> 
types.stream().noneMatch(a -> Objects.equals(name, a.getName())

 && !a.isDerived()))
   .collect(Collectors.toSet());
-
 if (!unsupported.isEmpty())
 {
-throw new IllegalArgumentException(String.format(
-"Unsupported exchange declare arguments : %s", 
String.join(",", unsupported)));
+Exchange.BehaviourOnUnknownDeclareArgument 
unknownArgumentBehaviour =
+
connection.getContextValue(Exchange.BehaviourOnUnknownDeclareArgument.class,
+   
Exchange.UNKNOWN_EXCHANGE_DECLARE_ARGUMENT_BEHAVIOUR_NAME);
+switch(unknownArgumentBehaviour)
+{
+case LOG:
+LOGGER.warn("Unsupported exchange declare arguments : {}", 
String.join(",", unsupported));
+// fall through
+case IGNORE:
+attributes.keySet().removeAll(unsupported);
+break;
+case FAIL:
+ 

[qpid-broker-j] branch 7.1.x updated (99237c7 -> cdde19c)

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git.


from 99237c7  QPID-8373: Modify test to use synchrnous publishing and 
preconfigured receive interval
 new 8a31ba3  QPID-8381: [Broker-J] Upgrade Oracle BDB JE dependency to 
version 7.5.11
 new f1742d3  QPID-8378: [Broker-J] Make sure that message reference is 
released for deleted node
 new a7d5b79  QPID-8377 : Allow configuration of behaviour with unknown 
exchange declare arguments
 new cdde19c  QPID-8377 : add test to verify IGNORE behaviour

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/qpid/server/model/Exchange.java | 11 +
 .../apache/qpid/server/queue/AbstractQueue.java|  8 +---
 .../qpid/server/queue/AbstractQueueTestBase.java   | 53 ++
 .../protocol/v0_10/ServerSessionDelegate.java  | 24 --
 .../qpid/server/protocol/v0_8/AMQChannel.java  | 22 +++--
 pom.xml|  2 +-
 ...ExchangeDeclareInvalidOptionBehaviourTest.java} | 50 
 7 files changed, 113 insertions(+), 57 deletions(-)
 copy 
systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/extension/exchange/{ExchangeTest.java
 => ExchangeDeclareInvalidOptionBehaviourTest.java} (51%)


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] 04/04: QPID-8377 : add test to verify IGNORE behaviour

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit cdde19cafecca628ff9d12063eb28d362431235b
Author: Robert Godfrey 
AuthorDate: Tue Nov 19 11:57:11 2019 +0100

QPID-8377 : add test to verify IGNORE behaviour

(cherry picked from commit 8a2a02521a76f889e23d89f67ff025e73b578df5)
---
 .../ExchangeDeclareInvalidOptionBehaviourTest.java | 68 ++
 1 file changed, 68 insertions(+)

diff --git 
a/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/extension/exchange/ExchangeDeclareInvalidOptionBehaviourTest.java
 
b/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/extension/exchange/ExchangeDeclareInvalidOptionBehaviourTest.java
new file mode 100644
index 000..71de695
--- /dev/null
+++ 
b/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/extension/exchange/ExchangeDeclareInvalidOptionBehaviourTest.java
@@ -0,0 +1,68 @@
+/*
+ * 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.qpid.tests.protocol.v0_8.extension.exchange;
+
+import static org.apache.qpid.tests.utils.BrokerAdmin.KIND_BROKER_J;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.Collections;
+
+import org.junit.Test;
+
+import org.apache.qpid.server.protocol.ErrorCodes;
+import org.apache.qpid.server.protocol.v0_8.transport.ChannelOpenOkBody;
+import org.apache.qpid.server.protocol.v0_8.transport.ConnectionCloseBody;
+import org.apache.qpid.server.protocol.v0_8.transport.ExchangeBoundOkBody;
+import org.apache.qpid.server.protocol.v0_8.transport.ExchangeDeclareOkBody;
+import org.apache.qpid.tests.protocol.v0_8.FrameTransport;
+import org.apache.qpid.tests.protocol.v0_8.Interaction;
+import org.apache.qpid.tests.utils.BrokerAdmin;
+import org.apache.qpid.tests.utils.BrokerAdminUsingTestBase;
+import org.apache.qpid.tests.utils.BrokerSpecific;
+import org.apache.qpid.tests.utils.ConfigItem;
+
+@BrokerSpecific(kind = KIND_BROKER_J)
+@ConfigItem(name = "exchange.behaviourOnUnknownDeclareArgument", value = 
"IGNORE")
+public class ExchangeDeclareInvalidOptionBehaviourTest extends 
BrokerAdminUsingTestBase
+{
+private static final String TEST_EXCHANGE = "testExchange";
+
+@Test
+public void exchangeDeclareInvalidWireArguments() throws Exception
+{
+try (FrameTransport transport = new 
FrameTransport(getBrokerAdmin().getBrokerAddress(BrokerAdmin.PortType.ANONYMOUS_AMQP)).connect())
+{
+final Interaction interaction = transport.newInteraction();
+interaction.openAnonymousConnection()
+   .channel()
+   .open()
+   .consumeResponse(ChannelOpenOkBody.class)
+   .exchange()
+   .declareName(TEST_EXCHANGE)
+   .declareArguments(Collections.singletonMap("foo", 
"bar"))
+   .declare()
+   .consumeResponse(ExchangeDeclareOkBody.class);
+
+
+}
+}
+}


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] 02/04: QPID-8378: [Broker-J] Make sure that message reference is released for deleted node

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit f1742d3e9a0c58720a333be944f91be5f68ae0ce
Author: Alex Rudyy 
AuthorDate: Thu Nov 14 23:13:46 2019 +

QPID-8378: [Broker-J] Make sure that message reference is released for 
deleted node

(cherry picked from commit f17f16aded492953984ece42d90afd52ab44408a)
---
 .../apache/qpid/server/queue/AbstractQueue.java|  8 +---
 .../qpid/server/queue/AbstractQueueTestBase.java   | 53 ++
 2 files changed, 55 insertions(+), 6 deletions(-)

diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java 
b/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
index 22e42d4..cc6608d 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
@@ -1714,15 +1714,11 @@ public abstract class AbstractQueue>
 {
 QueueEntry node = queueListIterator.getNode();
 MessageReference reference = node.newMessageReference();
-if(reference != null && !node.isDeleted())
+if(reference != null)
 {
 try
 {
-if (!reference.getMessage().checkValid())
-{
-malformedEntry(node);
-}
-else if (visitor.visit(node))
+if (!node.isDeleted() && 
reference.getMessage().checkValid() && visitor.visit(node))
 {
 break;
 }
diff --git 
a/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
 
b/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
index 4fcea19..0a4f987 100644
--- 
a/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
+++ 
b/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
@@ -34,6 +34,7 @@ import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
 
@@ -1257,6 +1258,58 @@ abstract class AbstractQueueTestBase extends UnitTestBase
  _queue.getQueueDepthMessages());
 }
 
+@Test
+public void testVisit()
+{
+final ServerMessage message = createMessage(1L, 2, 3);
+_queue.enqueue(message, null, null);
+
+final QueueEntryVisitor visitor = mock(QueueEntryVisitor.class);
+_queue.visit(visitor);
+
+final ArgumentCaptor argument = 
ArgumentCaptor.forClass(QueueEntry.class);
+verify(visitor).visit(argument.capture());
+
+final QueueEntry queueEntry = argument.getValue();
+assertEquals(message, queueEntry.getMessage());
+verify(message.newReference()).release();
+}
+
+@Test
+public void testVisitWhenNodeDeletedAfterAdvance()
+{
+final QueueEntryList list = mock(QueueEntryList.class);
+
+final Map attributes = new HashMap<>();
+attributes.put(Queue.NAME, _qname);
+attributes.put(Queue.OWNER, _owner);
+
+@SuppressWarnings("unchecked")
+final Queue queue = new AbstractQueue(attributes, _virtualHost)
+{
+@Override
+QueueEntryList getEntries()
+{
+return list;
+}
+
+};
+
+final MessageReference reference = mock(MessageReference.class);
+final QueueEntry entry = mock(QueueEntry.class);
+when(entry.isDeleted()).thenReturn(true);
+when(entry.newMessageReference()).thenReturn(reference);
+final QueueEntryIterator iterator = mock(QueueEntryIterator.class);
+when(iterator.advance()).thenReturn(true, false);
+when(iterator.getNode()).thenReturn(entry);
+when(list.iterator()).thenReturn(iterator);
+
+final QueueEntryVisitor visitor = mock(QueueEntryVisitor.class);
+queue.visit(visitor);
+verifyNoMoreInteractions(visitor);
+verify(reference).release();
+}
+
 private void makeVirtualHostTargetSizeExceeded()
 {
 final InternalMessage message = 
InternalMessage.createMessage(_virtualHost.getMessageStore(),


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] branch master updated: QPID-8381: [Broker-J] Upgrade Oracle BDB JE dependency to version 7.5.11

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git


The following commit(s) were added to refs/heads/master by this push:
 new d5ae00b  QPID-8381: [Broker-J] Upgrade Oracle BDB JE dependency to 
version 7.5.11
d5ae00b is described below

commit d5ae00b256914fb8af0ead9a2362f9476c59218c
Author: Alex Rudyy 
AuthorDate: Sat Nov 23 23:35:57 2019 +

QPID-8381: [Broker-J] Upgrade Oracle BDB JE dependency to version 7.5.11
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index a71fe16..702ae7d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -101,7 +101,7 @@
 $
 @
 
-7.4.5
+7.5.11
 10.14.2.0
 1.2.3
 27.0-jre


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] 02/04: QPID-8373 : Add deliveredToConsumerId to MessageInfo

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit 9698710d315620bd496f3ec9f231c02de3c5afdc
Author: Robert Godfrey 
AuthorDate: Wed Nov 20 10:42:41 2019 +0100

QPID-8373 : Add deliveredToConsumerId to MessageInfo

(cherry picked from commit 5ef97289cea7b797e0c50fbeb6f2c91361da0b00)
---
 .../apache/qpid/server/message/MessageInfo.java|  1 +
 .../qpid/server/message/MessageInfoImpl.java   | 10 +
 .../tests/http/endtoend/message/MessageTest.java   | 49 --
 3 files changed, 57 insertions(+), 3 deletions(-)

diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java 
b/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java
index b0e720b..d0fdce5 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java
@@ -36,6 +36,7 @@ public interface MessageInfo extends ManagedAttributeValue
 int getDeliveryCount();
 String getState();
 String getDeliveredTo();
+String getDeliveredToConsumerId();
 Date getArrivalTime();
 boolean isPersistent();
 String getMessageId();
diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java 
b/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java
index f495361..252950e 100644
--- 
a/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java
+++ 
b/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java
@@ -25,6 +25,8 @@ import java.util.Date;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
+import org.apache.qpid.server.model.Consumer;
+
 public class MessageInfoImpl implements MessageInfo
 {
 private final String _deliveredTo;
@@ -52,6 +54,7 @@ public class MessageInfoImpl implements MessageInfo
 private final Date _notValidBefore;
 private final String _messageType;
 private final String _groupId;
+private final String _deliveredToConsumerId;
 
 public MessageInfoImpl(final MessageInstance instance, final boolean 
includeHeaders)
 {
@@ -60,6 +63,7 @@ public class MessageInfoImpl implements MessageInfo
 
 MessageInstanceConsumer acquiringConsumer = 
instance.getAcquiringConsumer();
 _deliveredTo = acquiringConsumer == null ? null : 
String.valueOf(acquiringConsumer.getIdentifier());
+_deliveredToConsumerId = (acquiringConsumer instanceof Consumer) ?  
String.valueOf(((Consumer)acquiringConsumer).getId()) : null;
 _arrivalTime = message.getArrivalTime() == 0L ? null : new 
Date(message.getArrivalTime());
 _messageType = message.getMessageType();
 _persistent = message.isPersistent();
@@ -150,6 +154,12 @@ public class MessageInfoImpl implements MessageInfo
 }
 
 @Override
+public String getDeliveredToConsumerId()
+{
+return _deliveredToConsumerId;
+}
+
+@Override
 public Date getArrivalTime()
 {
 return _arrivalTime == null ? null : new Date(_arrivalTime.getTime());
diff --git 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
index d1661e6..36afeed 100644
--- 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
+++ 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
@@ -32,8 +32,6 @@ import static org.hamcrest.Matchers.typeCompatibleWith;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assume.assumeThat;
 
-import java.io.InputStream;
-import java.net.HttpURLConnection;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -57,7 +55,6 @@ import javax.jms.TextMessage;
 
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.google.common.base.Strings;
-import com.google.common.io.ByteStreams;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -153,6 +150,52 @@ public class MessageTest extends HttpTestBase
 
 
 @Test
+public void getAcquiredMessage() throws Exception
+{
+
+Connection connection = getConnection();
+try
+{
+Session session = connection.createSession(false, 
Session.CLIENT_ACKNOWLEDGE);
+Queue queue = session.createQueue(QUEUE_NAME);
+
+MessageProducer producer = session.createProducer(queue);
+Message jmsMessage = session.createMessage();
+producer.send(jmsMessage);
+
+List> messages = 
getHelper().postJson("queue/myqueue/getMessageInfo",
+   

[qpid-broker-j] 03/04: QPID-8373 : Modify test to encourage synchronous send

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit 443bfd3298500c75088b6739e233909cc0e8c57a
Author: Robert Godfrey 
AuthorDate: Sat Nov 23 15:04:15 2019 +0100

QPID-8373 : Modify test to encourage synchronous send

(cherry picked from commit c59342a4eb53fccfc6f7476e7321938f5bd9ac50)
---
 .../java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java   | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
index 36afeed..2be0603 100644
--- 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
+++ 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
@@ -44,6 +44,7 @@ import java.util.stream.IntStream;
 
 import javax.jms.BytesMessage;
 import javax.jms.Connection;
+import javax.jms.DeliveryMode;
 import javax.jms.MapMessage;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
@@ -160,6 +161,7 @@ public class MessageTest extends HttpTestBase
 Queue queue = session.createQueue(QUEUE_NAME);
 
 MessageProducer producer = session.createProducer(queue);
+producer.setDeliveryMode(DeliveryMode.PERSISTENT);
 Message jmsMessage = session.createMessage();
 producer.send(jmsMessage);
 


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] branch 7.1.x updated (432e1f5 -> 99237c7)

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git.


from 432e1f5  NO-JIRA: Fix failing test with Java11 and TLS 1.3
 new 47844e4  QPID-8380 : Add groupId to MessageInfo
 new 9698710  QPID-8373 : Add deliveredToConsumerId to MessageInfo
 new 443bfd3  QPID-8373 : Modify test to encourage synchronous send
 new 99237c7  QPID-8373: Modify test to use synchrnous publishing and 
preconfigured receive interval

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/qpid/server/message/MessageInfo.java|  2 +
 .../qpid/server/message/MessageInfoImpl.java   | 18 +
 .../tests/http/endtoend/message/MessageTest.java   | 80 --
 3 files changed, 96 insertions(+), 4 deletions(-)


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] 04/04: QPID-8373: Modify test to use synchrnous publishing and preconfigured receive interval

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit 99237c7c10e556afb4724736ac6e85e1f991a91e
Author: Alex Rudyy 
AuthorDate: Sat Nov 23 22:41:31 2019 +

QPID-8373: Modify test to use synchrnous publishing and preconfigured 
receive interval

(cherry picked from commit 55cc0b9e83a7e15c1b7aa990413b882836e11894)
---
 .../org/apache/qpid/tests/http/endtoend/message/MessageTest.java  | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
index 2be0603..bbe6ba7 100644
--- 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
+++ 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
@@ -153,8 +153,7 @@ public class MessageTest extends HttpTestBase
 @Test
 public void getAcquiredMessage() throws Exception
 {
-
-Connection connection = getConnection();
+Connection connection = 
getConnectionBuilder().setSyncPublish(true).build();
 try
 {
 Session session = connection.createSession(false, 
Session.CLIENT_ACKNOWLEDGE);
@@ -175,7 +174,7 @@ public class MessageTest extends HttpTestBase
 assertThat(message.get("deliveredToConsumerId"), is(nullValue()));
 connection.start();
 MessageConsumer consumer = session.createConsumer(queue);
-jmsMessage = consumer.receive(5000);
+jmsMessage = consumer.receive(getReceiveTimeout());
 assertThat(jmsMessage, is(notNullValue()));
 
 messages = getHelper().postJson("queue/myqueue/getMessageInfo",
@@ -192,11 +191,8 @@ public class MessageTest extends HttpTestBase
 {
 connection.close();
 }
-
 }
 
-
-
 @Test
 public void getJmsMapMessage() throws Exception
 {


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] 01/04: QPID-8380 : Add groupId to MessageInfo

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit 47844e4ea483538fb157cb5b6473e3a6d214df3c
Author: Robert Godfrey 
AuthorDate: Tue Nov 19 11:39:15 2019 +0100

QPID-8380 : Add groupId to MessageInfo

(cherry picked from commit 1ffacb65710a9d1f46350b5361e337a76bd924ca)
---
 .../apache/qpid/server/message/MessageInfo.java|  1 +
 .../qpid/server/message/MessageInfoImpl.java   |  8 ++
 .../tests/http/endtoend/message/MessageTest.java   | 33 +-
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java 
b/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java
index 055ec23..b0e720b 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java
@@ -49,6 +49,7 @@ public interface MessageInfo extends ManagedAttributeValue
 Date getTimestamp();
 String getType();
 String getUserId();
+String getGroupId();
 Map getHeaders();
 Date getNotValidBefore();
 String getInitialRoutingAddress();
diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java 
b/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java
index 7626dc6..f495361 100644
--- 
a/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java
+++ 
b/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java
@@ -51,6 +51,7 @@ public class MessageInfoImpl implements MessageInfo
 private final String _to;
 private final Date _notValidBefore;
 private final String _messageType;
+private final String _groupId;
 
 public MessageInfoImpl(final MessageInstance instance, final boolean 
includeHeaders)
 {
@@ -73,6 +74,7 @@ public class MessageInfoImpl implements MessageInfo
 _timestamp = messageHeader.getTimestamp() == 0L ? null : new 
Date(messageHeader.getTimestamp());
 _type = messageHeader.getType();
 _userId = messageHeader.getUserId();
+_groupId = messageHeader.getGroupId();
 if (instance.isAvailable())
 {
 _state = instance.isHeld() ? "Held" : "Available";
@@ -226,6 +228,12 @@ public class MessageInfoImpl implements MessageInfo
 }
 
 @Override
+public String getGroupId()
+{
+return _groupId;
+}
+
+@Override
 public Map getHeaders()
 {
 return _headers;
diff --git 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
index 4c525e3..d1661e6 100644
--- 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
+++ 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
@@ -90,7 +90,7 @@ public class MessageTest extends HttpTestBase
 }
 
 @Test
-public void getJmsMessage() throws Exception
+public void getJmsMessageWithProperty() throws Exception
 {
 final String messageProperty = "myProp";
 final String messagePropertyValue = "myValue";
@@ -122,6 +122,37 @@ public class MessageTest extends HttpTestBase
 }
 
 @Test
+public void getJmsMessageWithGroupId() throws Exception
+{
+final String groupIdValue = "mygroup";
+
+Connection connection = getConnection();
+try
+{
+Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+MessageProducer producer = 
session.createProducer(session.createQueue(QUEUE_NAME));
+Message message = session.createMessage();
+message.setStringProperty("JMSXGroupID", groupIdValue);
+producer.send(message);
+}
+finally
+{
+connection.close();
+}
+
+List> messages = 
getHelper().postJson("queue/myqueue/getMessageInfo",
+  
Collections.singletonMap("includeHeaders",
+   
Boolean.FALSE),
+  
LIST_MAP_TYPE_REF, SC_OK);
+assertThat(messages.size(), is(equalTo(1)));
+
+Map message = messages.get(0);
+
+assertThat(message.get("groupId"), is(groupIdValue));
+}
+
+
+@Test
 public void getJmsMapMessage() throws Exception
 {
 final String mapKey = "key";


-
To unsubscribe, e-mail: 

[qpid-broker-j] branch master updated: QPID-8373: Modify test to use synchrnous publishing and preconfigured receive interval

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git


The following commit(s) were added to refs/heads/master by this push:
 new 55cc0b9  QPID-8373: Modify test to use synchrnous publishing and 
preconfigured receive interval
55cc0b9 is described below

commit 55cc0b9e83a7e15c1b7aa990413b882836e11894
Author: Alex Rudyy 
AuthorDate: Sat Nov 23 22:41:31 2019 +

QPID-8373: Modify test to use synchrnous publishing and preconfigured 
receive interval
---
 .../org/apache/qpid/tests/http/endtoend/message/MessageTest.java  | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
index 2be0603..bbe6ba7 100644
--- 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
+++ 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
@@ -153,8 +153,7 @@ public class MessageTest extends HttpTestBase
 @Test
 public void getAcquiredMessage() throws Exception
 {
-
-Connection connection = getConnection();
+Connection connection = 
getConnectionBuilder().setSyncPublish(true).build();
 try
 {
 Session session = connection.createSession(false, 
Session.CLIENT_ACKNOWLEDGE);
@@ -175,7 +174,7 @@ public class MessageTest extends HttpTestBase
 assertThat(message.get("deliveredToConsumerId"), is(nullValue()));
 connection.start();
 MessageConsumer consumer = session.createConsumer(queue);
-jmsMessage = consumer.receive(5000);
+jmsMessage = consumer.receive(getReceiveTimeout());
 assertThat(jmsMessage, is(notNullValue()));
 
 messages = getHelper().postJson("queue/myqueue/getMessageInfo",
@@ -192,11 +191,8 @@ public class MessageTest extends HttpTestBase
 {
 connection.close();
 }
-
 }
 
-
-
 @Test
 public void getJmsMapMessage() throws Exception
 {


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] branch master updated: QPID-8384: [Broker-J] Try to remove LVQ entry from the latest value map after setting the latest value reference if entry is deleted before the reference is set

2019-11-23 Thread orudyy
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git


The following commit(s) were added to refs/heads/master by this push:
 new ea2c157  QPID-8384: [Broker-J] Try to remove LVQ entry from the latest 
value map after setting the latest value reference if entry is deleted before 
the reference is set
ea2c157 is described below

commit ea2c1574f40561bd782b258bdf67aec61ad5986a
Author: Alex Rudyy 
AuthorDate: Sat Nov 23 22:25:08 2019 +

QPID-8384: [Broker-J] Try to remove LVQ entry from the latest value map 
after setting the latest value reference if entry is deleted before the 
reference is set
---
 .../org/apache/qpid/server/queue/LastValueQueueList.java| 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/queue/LastValueQueueList.java
 
b/broker-core/src/main/java/org/apache/qpid/server/queue/LastValueQueueList.java
index 1fb2adb..35decc3 100644
--- 
a/broker-core/src/main/java/org/apache/qpid/server/queue/LastValueQueueList.java
+++ 
b/broker-core/src/main/java/org/apache/qpid/server/queue/LastValueQueueList.java
@@ -241,12 +241,21 @@ public class LastValueQueueList extends 
OrderedQueueEntryList
 Object key = 
getMessage().getMessageHeader().getHeader(_conflationKey);
 _latestValuesMap.remove(key,_latestValueReference);
 }
-
 }
 
-public void setLatestValueReference(final 
AtomicReference latestValueReference)
+void setLatestValueReference(final 
AtomicReference latestValueReference)
 {
 _latestValueReference = latestValueReference;
+
+// When being added entry is deleted before setting 
#_latestValueReference (due to some unfortunate thread
+// scheduling), the entry can be left in #_latestValuesMap and 
cause OOM errors due to heap consumption
+// by deleted LVQ entries linked with leaked one.
+// Thus, in order to avoid memory leaks, the entry (which gets 
deleted before #_latestValueReference is set)
+// needs to be attempted to remove from #_latestValuesMap.
+if (isDeleted())
+{
+onDelete();
+}
 }
 
 private void discardIfReleasedEntryIsNoLongerLatest()


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-dispatch] branch eallen-DISPATCH-1385 updated: More tests

2019-11-23 Thread eallen
This is an automated email from the ASF dual-hosted git repository.

eallen pushed a commit to branch eallen-DISPATCH-1385
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/eallen-DISPATCH-1385 by this 
push:
 new aea3637  More tests
aea3637 is described below

commit aea3637c2b6f8fb342dcb6f7687ed92e37e3bbae
Author: Ernest Allen 
AuthorDate: Sat Nov 23 12:47:50 2019 -0500

More tests
---
 console/react/src/App.css  |   1 +
 console/react/src/common/updated.js|   4 +-
 console/react/src/details/createEntity.js  |   6 +-
 .../{updateEntity.js => createEntity.test.js}  |  28 +++---
 .../react/src/details/dataSources/routerData.js| 101 -
 console/react/src/details/deleteEntity.js  |  35 +++
 .../{createEntity.js => deleteEntity.test.js}  |  27 +++---
 console/react/src/details/detailsTablePage.test.js |  30 --
 console/react/src/details/entityList.test.js   |   4 +
 console/react/src/details/routerSelect.js  |  26 +++---
 console/react/src/details/updateEntity.js  |   6 +-
 .../{updateEntity.js => updateEntity.test.js}  |  28 +++---
 console/react/src/overview/dashboard/layout.js |   4 +-
 console/react/src/topology/clientInfoComponent.js  |   7 ++
 console/react/src/topology/nodes.js|   2 +-
 console/react/src/topology/routerInfoComponent.js  |   3 +
 console/react/src/topology/svgUtils.js |   2 +-
 console/react/src/topology/topologyViewer.js   |  78 ++--
 18 files changed, 145 insertions(+), 247 deletions(-)

diff --git a/console/react/src/App.css b/console/react/src/App.css
index 2f0581f..e4a51a6 100644
--- a/console/react/src/App.css
+++ b/console/react/src/App.css
@@ -753,6 +753,7 @@ path.empty {
   opacity: 1;
   padding: 12px;
   font-size: 14px;
+  display: none;
 }
 
 #popover-div {
diff --git a/console/react/src/common/updated.js 
b/console/react/src/common/updated.js
index e762d8e..1813edd 100644
--- a/console/react/src/common/updated.js
+++ b/console/react/src/common/updated.js
@@ -28,9 +28,7 @@ class Updated extends Component {
   render() {
 return (
   
-{`Updated ${this.props.service.utilities.strDate(
-  this.props.lastUpdated
-)}`}
+{`Updated 
${this.props.service.utilities.strDate(this.props.lastUpdated)}`}
   
 );
   }
diff --git a/console/react/src/details/createEntity.js 
b/console/react/src/details/createEntity.js
index 3f5dfe2..205b37b 100644
--- a/console/react/src/details/createEntity.js
+++ b/console/react/src/details/createEntity.js
@@ -31,7 +31,11 @@ class CreateEntity extends React.Component {
   };
 
   render() {
-return Create;
+return (
+  
+Create
+  
+);
   }
 }
 
diff --git a/console/react/src/details/updateEntity.js 
b/console/react/src/details/createEntity.test.js
similarity index 62%
copy from console/react/src/details/updateEntity.js
copy to console/react/src/details/createEntity.test.js
index 4d1fac9..d31f50d 100644
--- a/console/react/src/details/updateEntity.js
+++ b/console/react/src/details/createEntity.test.js
@@ -18,21 +18,21 @@ under the License.
 */
 
 import React from "react";
-import { Button } from "@patternfly/react-core";
+import { render, fireEvent } from "@testing-library/react";
+import CreateEntity from "./createEntity";
 
-class UpdateEntity extends React.Component {
-  constructor(props) {
-super(props);
-this.state = {};
-  }
-
-  handleClick = () => {
-this.props.handleEntityAction("update", this.props.record);
+it("renders UpdateEntity", () => {
+  let buttonClicked = false;
+  const props = {
+handleEntityAction: () => {
+  buttonClicked = true;
+}
   };
 
-  render() {
-return Update;
-  }
-}
+  const { getByLabelText } = render();
+  const button = getByLabelText("create-entity-button");
+  expect(button).toBeInTheDocument();
 
-export default UpdateEntity;
+  fireEvent.click(button);
+  expect(buttonClicked).toBe(true);
+});
diff --git a/console/react/src/details/dataSources/routerData.js 
b/console/react/src/details/dataSources/routerData.js
deleted file mode 100644
index 67c015e..000
--- a/console/react/src/details/dataSources/routerData.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-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 

[qpid-broker-j] branch master updated: QPID-8373 : Modify test to encourage synchronous send

2019-11-23 Thread rgodfrey
This is an automated email from the ASF dual-hosted git repository.

rgodfrey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git


The following commit(s) were added to refs/heads/master by this push:
 new c59342a  QPID-8373 : Modify test to encourage synchronous send
c59342a is described below

commit c59342a4eb53fccfc6f7476e7321938f5bd9ac50
Author: Robert Godfrey 
AuthorDate: Sat Nov 23 15:04:15 2019 +0100

QPID-8373 : Modify test to encourage synchronous send
---
 .../java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java   | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
index 36afeed..2be0603 100644
--- 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
+++ 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/message/MessageTest.java
@@ -44,6 +44,7 @@ import java.util.stream.IntStream;
 
 import javax.jms.BytesMessage;
 import javax.jms.Connection;
+import javax.jms.DeliveryMode;
 import javax.jms.MapMessage;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
@@ -160,6 +161,7 @@ public class MessageTest extends HttpTestBase
 Queue queue = session.createQueue(QUEUE_NAME);
 
 MessageProducer producer = session.createProducer(queue);
+producer.setDeliveryMode(DeliveryMode.PERSISTENT);
 Message jmsMessage = session.createMessage();
 producer.send(jmsMessage);
 


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org