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
8928cd19
Commit
8928cd19
authored
Nov 27, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate spring.rabbitmq.template.queue
Closes gh-15301
parent
a240e225
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
5 deletions
+30
-5
RabbitAutoConfiguration.java
...work/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
+1
-1
RabbitProperties.java
...ngframework/boot/autoconfigure/amqp/RabbitProperties.java
+15
-3
RabbitAutoConfigurationTests.java
...boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java
+13
-0
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+1
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
View file @
8928cd19
...
@@ -196,7 +196,7 @@ public class RabbitAutoConfiguration {
...
@@ -196,7 +196,7 @@ public class RabbitAutoConfiguration {
.
to
(
template:
:
setReplyTimeout
);
.
to
(
template:
:
setReplyTimeout
);
map
.
from
(
properties:
:
getExchange
).
to
(
template:
:
setExchange
);
map
.
from
(
properties:
:
getExchange
).
to
(
template:
:
setExchange
);
map
.
from
(
properties:
:
getRoutingKey
).
to
(
template:
:
setRoutingKey
);
map
.
from
(
properties:
:
getRoutingKey
).
to
(
template:
:
setRoutingKey
);
map
.
from
(
properties:
:
getQueue
).
whenNonNull
()
map
.
from
(
properties:
:
get
DefaultReceive
Queue
).
whenNonNull
()
.
to
(
template:
:
setDefaultReceiveQueue
);
.
to
(
template:
:
setDefaultReceiveQueue
);
return
template
;
return
template
;
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java
View file @
8928cd19
...
@@ -24,6 +24,7 @@ import java.util.List;
...
@@ -24,6 +24,7 @@ import java.util.List;
import
org.springframework.amqp.core.AcknowledgeMode
;
import
org.springframework.amqp.core.AcknowledgeMode
;
import
org.springframework.amqp.rabbit.connection.CachingConnectionFactory.CacheMode
;
import
org.springframework.amqp.rabbit.connection.CachingConnectionFactory.CacheMode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.DeprecatedConfigurationProperty
;
import
org.springframework.boot.convert.DurationUnit
;
import
org.springframework.boot.convert.DurationUnit
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -776,7 +777,7 @@ public class RabbitProperties {
...
@@ -776,7 +777,7 @@ public class RabbitProperties {
* Name of the default queue to receive messages from when none is specified
* Name of the default queue to receive messages from when none is specified
* explicitly.
* explicitly.
*/
*/
private
String
q
ueue
;
private
String
defaultReceiveQ
ueue
;
public
Retry
getRetry
()
{
public
Retry
getRetry
()
{
return
this
.
retry
;
return
this
.
retry
;
...
@@ -822,12 +823,23 @@ public class RabbitProperties {
...
@@ -822,12 +823,23 @@ public class RabbitProperties {
this
.
routingKey
=
routingKey
;
this
.
routingKey
=
routingKey
;
}
}
public
String
getDefaultReceiveQueue
()
{
return
this
.
defaultReceiveQueue
;
}
public
void
setDefaultReceiveQueue
(
String
defaultReceiveQueue
)
{
this
.
defaultReceiveQueue
=
defaultReceiveQueue
;
}
@Deprecated
@DeprecatedConfigurationProperty
(
replacement
=
"spring.rabbitmq.template.default-receive-queue"
)
public
String
getQueue
()
{
public
String
getQueue
()
{
return
this
.
queue
;
return
getDefaultReceiveQueue
()
;
}
}
@Deprecated
public
void
setQueue
(
String
queue
)
{
public
void
setQueue
(
String
queue
)
{
this
.
queue
=
queue
;
setDefaultReceiveQueue
(
queue
)
;
}
}
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java
View file @
8928cd19
...
@@ -321,6 +321,19 @@ public class RabbitAutoConfigurationTests {
...
@@ -321,6 +321,19 @@ public class RabbitAutoConfigurationTests {
}
}
@Test
@Test
public
void
testRabbitTemplateDefaultReceiveQueue
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
.
withPropertyValues
(
"spring.rabbitmq.template.default-receive-queue:default-queue"
)
.
run
((
context
)
->
{
RabbitTemplate
rabbitTemplate
=
context
.
getBean
(
RabbitTemplate
.
class
);
assertThat
(
rabbitTemplate
).
hasFieldOrPropertyWithValue
(
"defaultReceiveQueue"
,
"default-queue"
);
});
}
@Test
@Deprecated
public
void
testRabbitTemplateDefaultQueue
()
{
public
void
testRabbitTemplateDefaultQueue
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
TestConfiguration
.
class
)
.
withPropertyValues
(
"spring.rabbitmq.template.queue:default-queue"
)
.
withPropertyValues
(
"spring.rabbitmq.template.queue:default-queue"
)
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
8928cd19
...
@@ -1180,9 +1180,9 @@ content into your application. Rather, pick only the properties that you need.
...
@@ -1180,9 +1180,9 @@ content into your application. Rather, pick only the properties that you need.
spring.rabbitmq.ssl.trust-store-type=JKS # Trust store type.
spring.rabbitmq.ssl.trust-store-type=JKS # Trust store type.
spring.rabbitmq.ssl.validate-server-certificate=true # Whether to enable server side certificate validation.
spring.rabbitmq.ssl.validate-server-certificate=true # Whether to enable server side certificate validation.
spring.rabbitmq.ssl.verify-hostname=true # Whether to enable hostname verification.
spring.rabbitmq.ssl.verify-hostname=true # Whether to enable hostname verification.
spring.rabbitmq.template.default-receive-queue= # Name of the default queue to receive messages from when none is specified explicitly.
spring.rabbitmq.template.exchange= # Name of the default exchange to use for send operations.
spring.rabbitmq.template.exchange= # Name of the default exchange to use for send operations.
spring.rabbitmq.template.mandatory= # Whether to enable mandatory messages.
spring.rabbitmq.template.mandatory= # Whether to enable mandatory messages.
spring.rabbitmq.template.queue= # Name of the default queue to receive messages from when none is specified explicitly.
spring.rabbitmq.template.receive-timeout= # Timeout for `receive()` operations.
spring.rabbitmq.template.receive-timeout= # Timeout for `receive()` operations.
spring.rabbitmq.template.reply-timeout= # Timeout for `sendAndReceive()` operations.
spring.rabbitmq.template.reply-timeout= # Timeout for `sendAndReceive()` operations.
spring.rabbitmq.template.retry.enabled=false # Whether publishing retries are enabled.
spring.rabbitmq.template.retry.enabled=false # Whether publishing retries are enabled.
...
...
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