File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
publish-common/src/main/java/com/ericsson/eiffel/remrem/publish/helper Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
## 2.0.28
2
2
- Made changes to override AMQP Basic properties.
3
3
- Swagger don't display default status codes
4
+ - Made changes to create a new RabbitMQ Channel when it is closed in the middle of publishing.
4
5
5
6
## 2.0.27
6
7
- Degraded the spring-boot-maven-plugin version to 2.7.5
Original file line number Diff line number Diff line change @@ -540,7 +540,20 @@ private Channel giveMeRandomChannel() throws RemRemPublishException {
540
540
if ((rabbitConnection == null || !rabbitConnection .isOpen ())) {
541
541
createRabbitMqConnection ();
542
542
}
543
- return rabbitChannels .get (random .nextInt (rabbitChannels .size ()));
543
+ for (Channel channel : rabbitChannels ) {
544
+ if (channel .isOpen ()) {
545
+ return channel ;
546
+ }
547
+ }
548
+ try {
549
+ Channel channel = rabbitConnection .createChannel ();
550
+ channel .confirmSelect ();
551
+ rabbitChannels .add (channel );
552
+ return channel ;
553
+ } catch (IOException e ) {
554
+ log .error (e .getMessage (), e );
555
+ throw new RemRemPublishException ("Failed to create new channel for Rabbitmq :: " ,
556
+ factory , e );
557
+ }
544
558
}
545
-
546
559
}
You can’t perform that action at this time.
0 commit comments