From e17f267c313d6388b7bbb0ca6fab5a81e4ed774e Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 13 May 2021 16:00:24 -0400 Subject: [PATCH] INT-2436: JMS channel: bean name for container (#3565) JIRA: https://jira.spring.io/browse/INT-2436 The `JmsChannelFactoryBean` creates a `ListenerContainer` internally without any `beanName` propagation. When we rely on a default internal `Executor`, it is created with a default thread name prefix for all the JMS channel instances. It cause a confusion in logs * Set `beanName` for the internal `ListenerContainer` to `this.beanName + ".container"` making its connection with a channel it is associated with and unique thread name prefix * Comment out `allWarningsAsErrors = true` in `build.gradle` for deprecated Kotlin language version `1.3`. Otherwise IDEA doesn't want to build project --- build.gradle | 2 +- .../integration/jms/config/JmsChannelFactoryBean.java | 11 ++++------- .../integration/jms/config/JmsChannelParserTests.java | 2 ++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 2463299fb2..6bdc15ed38 100644 --- a/build.gradle +++ b/build.gradle @@ -206,7 +206,7 @@ configure(javaProjects) { subproject -> languageVersion = '1.3' jvmTarget = '1.8' freeCompilerArgs = ['-Xjsr305=strict'] - allWarningsAsErrors = true +// allWarningsAsErrors = true TODO bring it back after upgrading to Kotlin 1.5 language version } } compileTestKotlin { diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java index 1e36f994ef..72e795a236 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,8 +66,6 @@ public class JmsChannelFactoryBean extends AbstractFactoryBean containerType; private boolean acceptMessagesWhileStopping; @@ -376,9 +374,9 @@ public class JmsChannelFactoryBean extends AbstractFactoryBean