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
1f875d55
Commit
1f875d55
authored
Sep 05, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Add a config property for JMS listener container's receive timeout"
See gh-17332
parent
1cde6578
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
JmsProperties.java
...springframework/boot/autoconfigure/jms/JmsProperties.java
+4
-5
JmsPropertiesTests.java
...gframework/boot/autoconfigure/jms/JmsPropertiesTests.java
+8
-0
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java
View file @
1f875d55
...
@@ -156,12 +156,11 @@ public class JmsProperties {
...
@@ -156,12 +156,11 @@ public class JmsProperties {
private
Integer
maxConcurrency
;
private
Integer
maxConcurrency
;
/**
/**
* Timeout to use for receive calls. By default, the listener uses a 1s timeout on
* Timeout to use for receive calls. Use -1 for a no-wait receive or 0 for no
* its polling loop. See
* timeout at all. The latter is only feasible if not running within a transaction
* @see org.springframework.jms.listener.AbstractPollingMessageListenerContainer#setReceiveTimeout
* manager and is generally discouraged since it prevents clean shutdown.
* for more details on this value and the meaning of special values 0 and -1.
*/
*/
private
Duration
receiveTimeout
;
private
Duration
receiveTimeout
=
Duration
.
ofSeconds
(
1
)
;
public
boolean
isAutoStartup
()
{
public
boolean
isAutoStartup
()
{
return
this
.
autoStartup
;
return
this
.
autoStartup
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsPropertiesTests.java
View file @
1f875d55
...
@@ -20,6 +20,8 @@ import java.time.Duration;
...
@@ -20,6 +20,8 @@ import java.time.Duration;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.jms.listener.AbstractPollingMessageListenerContainer
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
/**
...
@@ -78,4 +80,10 @@ class JmsPropertiesTests {
...
@@ -78,4 +80,10 @@ class JmsPropertiesTests {
assertThat
(
properties
.
getTemplate
().
determineQosEnabled
()).
isTrue
();
assertThat
(
properties
.
getTemplate
().
determineQosEnabled
()).
isTrue
();
}
}
@Test
void
defaultReceiveTimeoutMatchesListenerContainersDefault
()
{
assertThat
(
new
JmsProperties
().
getListener
().
getReceiveTimeout
())
.
isEqualTo
(
Duration
.
ofMillis
(
AbstractPollingMessageListenerContainer
.
DEFAULT_RECEIVE_TIMEOUT
));
}
}
}
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