Skip to content

Commit 0a359f2

Browse files
committed
Merge branch 'release/13.0.2'
2 parents 2d5e960 + 91a20d4 commit 0a359f2

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>com.swiftmq</groupId>
99
<artifactId>swiftmq-client</artifactId>
10-
<version>13.0.1</version>
10+
<version>13.0.2</version>
1111

1212
<name>SwiftMQ Client</name>
1313
<description>Client for SwiftMQ Messaging System with JMS, AMQP 1.0 and file transfer over JMS.</description>

src/main/java/com/swiftmq/amqp/v100/client/Connection.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,10 @@ private Session mapSessionToLocalChannel(long incomingWindowSize, long outgoingW
448448
/**
449449
* Creates a new Session.
450450
*
451-
* @param incomingWindowSize Incoming Window Size (maxnumber of unsettled incoming transfers)
451+
* @param incomingWindowSize Incoming Window Size (max number of unsettled incoming transfers)
452452
* @param outgoingWindowSize Outgoing Window Size (max number of unsettled outgoing transfers)
453453
* @return Session
454-
* @throws SessionHandshakeException An error occured during handshake
454+
* @throws SessionHandshakeException An error occurred during handshake
455455
* @throws ConnectionClosedException The connection was closed
456456
*/
457457
public Session createSession(long incomingWindowSize, long outgoingWindowSize) throws SessionHandshakeException, ConnectionClosedException {

src/main/java/com/swiftmq/amqp/v100/client/ConnectionDispatcher.java

+15-8
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ private void checkBothSidesClosed() {
217217
}
218218

219219
private void notifyWaitingPOs(POObject[] po) {
220-
for (int i = 0; i < po.length; i++) {
221-
if (po[i] != null) {
222-
po[i].setSuccess(false);
223-
if (po[i].getException() == null)
224-
po[i].setException("Connection was asynchronously closed");
225-
po[i].getSemaphore().notifySingleWaiter();
220+
for (POObject poObject : po) {
221+
if (poObject != null) {
222+
poObject.setSuccess(false);
223+
if (poObject.getException() == null)
224+
poObject.setException("Connection was asynchronously closed");
225+
poObject.getSemaphore().notifySingleWaiter();
226226
}
227227
}
228228
}
@@ -584,8 +584,15 @@ public void visit(EndFrame frame) {
584584

585585
public void visit(CloseFrame frame) {
586586
if (pTracer.isEnabled()) pTracer.trace(toString(), ", visit=" + frame);
587-
remoteClose = frame;
588-
checkBothSidesClosed();
587+
// Async remote close due to error
588+
if (frame.getError() != null) {
589+
if (myConnection.getExceptionListener() != null)
590+
myConnection.getExceptionListener().onException(new ConnectionClosedException(frame.getError().getDescription().getValue()));
591+
new Thread(() -> myConnection.cancel()).start();
592+
} else {
593+
remoteClose = frame;
594+
checkBothSidesClosed();
595+
}
589596
}
590597

591598
public void visit(SaslMechanismsFrame frame) {

0 commit comments

Comments
 (0)