File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed
spring-boot-actuator-autoconfigure
spring-boot-autoconfigure
src/main/java/org/springframework/boot/autoconfigure/jms/activemq
spring-boot-starters/spring-boot-starter-activemq Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ dependencies {
78
78
optional(" jakarta.servlet:jakarta.servlet-api" )
79
79
optional(" javax.cache:cache-api" )
80
80
optional(" org.apache.activemq:activemq-client" )
81
+ optional(" org.apache.activemq:activemq-broker" )
81
82
optional(" org.apache.commons:commons-dbcp2" ) {
82
83
exclude group : " commons-logging" , module : " commons-logging"
83
84
}
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ dependencies {
77
77
optional(" javax.cache:cache-api" )
78
78
optional(" javax.money:money-api" )
79
79
optional(" org.apache.activemq:activemq-client" )
80
+ optional(" org.apache.activemq:activemq-broker" )
80
81
optional(" org.apache.activemq:artemis-jakarta-client" ) {
81
82
exclude group : " commons-logging" , module : " commons-logging"
82
83
}
Original file line number Diff line number Diff line change 37
37
@ ConfigurationProperties (prefix = "spring.activemq" )
38
38
public class ActiveMQProperties {
39
39
40
+ private static final String DEFAULT_EMBEDDED_BROKER_URL = "vm://localhost?broker.persistent=false" ;
41
+
40
42
private static final String DEFAULT_NETWORK_BROKER_URL = "tcp://localhost:61616" ;
41
43
42
44
/**
43
45
* URL of the ActiveMQ broker. Auto-generated by default.
44
46
*/
45
47
private String brokerUrl ;
46
48
49
+ /**
50
+ * Whether the default broker URL should be in memory. Ignored if an explicit broker
51
+ * has been specified.
52
+ */
53
+ private boolean inMemory = true ;
54
+
47
55
/**
48
56
* Login user of the broker.
49
57
*/
@@ -83,6 +91,14 @@ public void setBrokerUrl(String brokerUrl) {
83
91
this .brokerUrl = brokerUrl ;
84
92
}
85
93
94
+ public boolean isInMemory () {
95
+ return this .inMemory ;
96
+ }
97
+
98
+ public void setInMemory (boolean inMemory ) {
99
+ this .inMemory = inMemory ;
100
+ }
101
+
86
102
public String getUser () {
87
103
return this .user ;
88
104
}
@@ -132,8 +148,11 @@ public Packages getPackages() {
132
148
}
133
149
134
150
String determineBrokerUrl () {
135
- if (this .brokerUrl != null ) {
136
- return this .brokerUrl ;
151
+ if (this .getBrokerUrl () != null ) {
152
+ return this .getBrokerUrl ();
153
+ }
154
+ if (this .isInMemory ()) {
155
+ return DEFAULT_EMBEDDED_BROKER_URL ;
137
156
}
138
157
return DEFAULT_NETWORK_BROKER_URL ;
139
158
}
Original file line number Diff line number Diff line change @@ -8,4 +8,5 @@ dependencies {
8
8
api(project(" :spring-boot-project:spring-boot-starters:spring-boot-starter" ))
9
9
api(" org.springframework:spring-jms" )
10
10
api(" org.apache.activemq:activemq-client" )
11
+ api(" org.apache.activemq:activemq-broker" )
11
12
}
You can’t perform that action at this time.
0 commit comments