Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
a12eace2
Commit
a12eace2
authored
Apr 11, 2020
by
dhimathu
Committed by
Stephane Nicoll
Apr 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Align Kafka's missingTopicsFatal default value
See gh-20917
parent
856543c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
KafkaProperties.java
...ngframework/boot/autoconfigure/kafka/KafkaProperties.java
+2
-1
KafkaAutoConfigurationTests.java
...boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java
+14
-2
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java
View file @
a12eace2
...
...
@@ -53,6 +53,7 @@ import org.springframework.util.unit.DataSize;
* @author Stephane Nicoll
* @author Artem Bilan
* @author Nakul Mishra
* @author Dhiren Mathur
* @since 1.5.0
*/
@ConfigurationProperties
(
prefix
=
"spring.kafka"
)
...
...
@@ -876,7 +877,7 @@ public class KafkaProperties {
* Whether the container should fail to start if at least one of the configured
* topics are not present on the broker.
*/
private
boolean
missingTopicsFatal
=
tru
e
;
private
boolean
missingTopicsFatal
=
fals
e
;
public
Type
getType
()
{
return
this
.
type
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java
View file @
a12eace2
...
...
@@ -86,6 +86,7 @@ import static org.mockito.Mockito.verify;
* @author Stephane Nicoll
* @author Eddú Meléndez
* @author Nakul Mishra
* @author Dhiren Mathur
*/
class
KafkaAutoConfigurationTests
{
...
...
@@ -364,7 +365,7 @@ class KafkaAutoConfigurationTests {
"spring.kafka.listener.no-poll-threshold=2.5"
,
"spring.kafka.listener.type=batch"
,
"spring.kafka.listener.idle-event-interval=1s"
,
"spring.kafka.listener.monitor-interval=45"
,
"spring.kafka.listener.log-container-config=true"
,
"spring.kafka.listener.missing-topics-fatal=
fals
e"
,
"spring.kafka.jaas.enabled=true"
,
"spring.kafka.listener.missing-topics-fatal=
tru
e"
,
"spring.kafka.jaas.enabled=true"
,
"spring.kafka.producer.transaction-id-prefix=foo"
,
"spring.kafka.jaas.login-module=foo"
,
"spring.kafka.jaas.control-flag=REQUISITE"
,
"spring.kafka.jaas.options.useKeyTab=true"
)
.
run
((
context
)
->
{
...
...
@@ -389,7 +390,7 @@ class KafkaAutoConfigurationTests {
assertThat
(
containerProperties
.
getIdleEventInterval
()).
isEqualTo
(
1000L
);
assertThat
(
containerProperties
.
getMonitorInterval
()).
isEqualTo
(
45
);
assertThat
(
containerProperties
.
isLogContainerConfig
()).
isTrue
();
assertThat
(
containerProperties
.
isMissingTopicsFatal
()).
is
Fals
e
();
assertThat
(
containerProperties
.
isMissingTopicsFatal
()).
is
Tru
e
();
assertThat
(
ReflectionTestUtils
.
getField
(
kafkaListenerContainerFactory
,
"concurrency"
)).
isEqualTo
(
3
);
assertThat
(
kafkaListenerContainerFactory
.
isBatchListener
()).
isTrue
();
assertThat
(
context
.
getBeansOfType
(
KafkaJaasLoginModuleInitializer
.
class
)).
hasSize
(
1
);
...
...
@@ -580,6 +581,17 @@ class KafkaAutoConfigurationTests {
});
}
@Test
void
testConcurrentKafkaListenerContainerFactoryMatchesDefaults
()
{
Listener
listenerProperties
=
new
KafkaProperties
().
getListener
();
this
.
contextRunner
.
withUserConfiguration
(
ConsumerFactoryConfiguration
.
class
).
run
((
context
)
->
{
ConcurrentKafkaListenerContainerFactory
<?,
?>
kafkaListenerContainerFactory
=
context
.
getBean
(
ConcurrentKafkaListenerContainerFactory
.
class
);
assertThat
(
kafkaListenerContainerFactory
.
getContainerProperties
().
isMissingTopicsFatal
())
.
isEqualTo
(
listenerProperties
.
isMissingTopicsFatal
());
});
}
@Configuration
(
proxyBeanMethods
=
false
)
static
class
MessageConverterConfiguration
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment