File tree 3 files changed +15
-2
lines changed 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change
1
+ ### 3.0.3 - (2024-06-12)
2
+
3
+ - Release the resources if ` Session.createReceiver() ` rejects due to timeout.
4
+
1
5
### 3.0.2 - (2024-05-02)
2
6
3
7
- Set the max listener limit to 1000 for ` RheaConnection `
Original file line number Diff line number Diff line change 2
2
// Licensed under the Apache License. See License in the project root for license information.
3
3
4
4
import * as log from "./log" ;
5
- import { Connection } from "./connection" ;
5
+ import { Connection , CreateReceiverOptions } from "./connection" ;
6
6
import { Receiver , ReceiverOptions } from "./receiver" ;
7
7
import { Sender , SenderOptions } from "./sender" ;
8
8
import {
@@ -396,6 +396,15 @@ export class Session extends Entity {
396
396
const msg : string = `Unable to create the amqp receiver '${ receiver . name } ' on amqp ` +
397
397
`session '${ this . id } ' due to operation timeout.` ;
398
398
log . error ( "[%s] %s" , this . connection . id , msg ) ;
399
+
400
+ const createReceiverOptions = options as CreateReceiverOptions ;
401
+ if ( createReceiverOptions ?. session ?. createReceiver ) {
402
+ // being called on a session passed via the options so don't close the session
403
+ receiver . close ( { closeSession : false } ) . then ( ( ) => { receiver . remove ( ) ; } )
404
+ } else {
405
+ receiver . close ( { closeSession : true } ) . then ( ( ) => { receiver . remove ( ) ; } )
406
+ }
407
+
399
408
return reject ( new OperationTimeoutError ( msg ) ) ;
400
409
} ;
401
410
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " rhea-promise" ,
3
- "version" : " 3.0.2 " ,
3
+ "version" : " 3.0.3 " ,
4
4
"description" : " A Promisified layer over rhea AMQP client" ,
5
5
"license" : " Apache-2.0" ,
6
6
"main" : " ./dist/lib/index.js" ,
You can’t perform that action at this time.
0 commit comments