[qpid-jms] branch master updated: QPIDJMS-525: update to Netty 4.1.60

2021-03-10 Thread robbie
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new db49d1c  QPIDJMS-525: update to Netty 4.1.60
db49d1c is described below

commit db49d1c15500a185088fe97cf76e483fa05e6f9a
Author: Robbie Gemmell 
AuthorDate: Wed Mar 10 15:29:43 2021 +

QPIDJMS-525: update to Netty 4.1.60
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d4dffc6..ced7ee6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,7 +37,7 @@
   
 
 0.33.8
-4.1.59.Final
+4.1.60.Final
 1.7.30
 2.14.0
 1.0-alpha-2


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



[qpid-jms] branch master updated: QPIDJMS-526: fire the ExceptionListener when handling remote Session closure if it has a consumer with a MessageListener

2021-03-10 Thread robbie
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 44b73fc  QPIDJMS-526: fire the ExceptionListener when handling remote 
Session closure if it has a consumer with a MessageListener
44b73fc is described below

commit 44b73fc591cc2b3907d6b5ee3416f9eec9b56e28
Author: Robbie Gemmell 
AuthorDate: Wed Mar 10 16:56:54 2021 +

QPIDJMS-526: fire the ExceptionListener when handling remote Session 
closure if it has a consumer with a MessageListener
---
 .../main/java/org/apache/qpid/jms/JmsSession.java  |  15 ++-
 .../jms/integration/SessionIntegrationTest.java| 103 +
 2 files changed, 116 insertions(+), 2 deletions(-)

diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
index dc4b303..274d99c 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
@@ -327,7 +327,9 @@ public class JmsSession implements AutoCloseable, Session, 
QueueSession, TopicSe
 shutdown(null);
 }
 
-protected void shutdown(Throwable cause) throws JMSException {
+protected boolean shutdown(Throwable cause) throws JMSException {
+boolean listenerPresent = false;
+
 if (closed.compareAndSet(false, true)) {
 JMSException shutdownError = null;
 
@@ -339,6 +341,10 @@ public class JmsSession implements AutoCloseable, Session, 
QueueSession, TopicSe
 stop();
 
 for (JmsMessageConsumer consumer : new 
ArrayList(this.consumers.values())) {
+if(consumer.hasMessageListener()) {
+listenerPresent = true;
+}
+
 consumer.shutdown(cause);
 }
 
@@ -398,13 +404,18 @@ public class JmsSession implements AutoCloseable, 
Session, QueueSession, TopicSe
 connection.removeSession(sessionInfo);
 }
 }
+
+return listenerPresent;
 }
 
 //- Events fired when resource remotely closed due to some error 
-//
 
 void sessionClosed(Throwable cause) {
 try {
-shutdown(cause);
+boolean listenerPresent = shutdown(cause);
+if (listenerPresent) {
+connection.onAsyncException(JmsExceptionSupport.create(cause));
+}
 } catch (Throwable error) {
 LOG.trace("Ignoring exception thrown during cleanup of closed 
session", error);
 }
diff --git 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
index a69624e..0bab49e 100644
--- 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
+++ 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
@@ -39,6 +39,7 @@ import java.util.Random;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
 
 import javax.jms.CompletionListener;
 import javax.jms.Connection;
@@ -2689,4 +2690,106 @@ public class SessionIntegrationTest extends 
QpidJmsTestCase {
 connection.close();
 }
 }
+
+@Test(timeout = 2)
+public void testRemotelyEndSessionWithMessageListener() throws Exception {
+final String BREAD_CRUMB = "ErrorDescriptionBreadCrumb";
+
+try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
+JmsConnection connection = (JmsConnection) 
testFixture.establishConnecton(testPeer, "?jms.prefetchPolicy.all=0");
+
+final CountDownLatch exceptionListenerFired = new 
CountDownLatch(1);
+final AtomicReference asyncError = new 
AtomicReference();
+connection.setExceptionListener(ex -> {
+asyncError.compareAndSet(null, ex);
+exceptionListenerFired.countDown();
+});
+
+final CountDownLatch sessionClosed = new CountDownLatch(1);
+connection.addConnectionListener(new 
JmsDefaultConnectionListener() {
+@Override
+public void onSessionClosed(Session session, Throwable 
exception) {
+sessionClosed.countDown();
+}
+});
+
+testPeer.expectBegin();
+Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+Queue queue = session.createQueue("myQueue");
+
+// Create a consumer
+testPeer.expectReceiverAttach();
+final MessageConsum

[qpid-proton] branch master updated: PROTON-2340: Small fixes to raw_echo to avoid warnings

2021-03-10 Thread astitcher
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 72fa713  PROTON-2340: Small fixes to raw_echo to avoid warnings
72fa713 is described below

commit 72fa71356e346c9a544f7daa03112ce87071704b
Author: Andrew Stitcher 
AuthorDate: Wed Mar 10 21:03:28 2021 -0500

PROTON-2340: Small fixes to raw_echo to avoid warnings

Also avoid requiring C99.
---
 c/examples/raw_echo.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/c/examples/raw_echo.c b/c/examples/raw_echo.c
index b89c2f8..aaea76f 100644
--- a/c/examples/raw_echo.c
+++ b/c/examples/raw_echo.c
@@ -356,6 +356,7 @@ void* run(void *arg) {
 }
 pn_proactor_done(app->proactor, events);
   } while(again);
+  return NULL;
 }
 
 
@@ -375,7 +376,8 @@ int main(int argc, char **argv) {
 
   size_t thread_count = 3; 
   pthread_t threads[thread_count];
-  for (int n=0; n

[qpid-proton] branch master updated: PROTON-2340: Another small fix to raw_echo for Visual Studio C compilers

2021-03-10 Thread astitcher
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new be50dbf  PROTON-2340: Another small fix to raw_echo for Visual Studio 
C compilers
be50dbf is described below

commit be50dbf02766baca1e53987c8dc4ae45e9be5908
Author: Andrew Stitcher 
AuthorDate: Wed Mar 10 22:32:18 2021 -0500

PROTON-2340: Another small fix to raw_echo for Visual Studio C compilers

This avoids C99 VLAs and the gnu/clang extension that imitates them.
---
 c/examples/raw_echo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c/examples/raw_echo.c b/c/examples/raw_echo.c
index aaea76f..187dba7 100644
--- a/c/examples/raw_echo.c
+++ b/c/examples/raw_echo.c
@@ -375,7 +375,7 @@ int main(int argc, char **argv) {
   pn_proactor_listen(app.proactor, app.listener, addr, 16);
 
   size_t thread_count = 3; 
-  pthread_t threads[thread_count];
+  pthread_t* threads = (pthread_t*)calloc(sizeof(pthread_t), thread_count);
   int n;
   for (n=0; n