Skip to content

Commit 97fae51

Browse files
committed
fix(spring/jetty): add depends-one on Jetty to start only when the broker is available
1 parent 084502a commit 97fae51

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

assembly/src/release/conf/activemq.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<!--
3232
The <broker> element is used to configure the ActiveMQ broker.
3333
-->
34-
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
34+
<broker id="broker" xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
3535

3636
<destinationPolicy>
3737
<policyMap>

assembly/src/release/conf/jetty.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
An embedded servlet engine for serving up the Admin consoles, REST and Ajax APIs and
1616
some demos Include this file in your configuration to enable ActiveMQ web components
1717
e.g. <import resource="jetty.xml"/>
18+
19+
Note: the broker element in your configuration must have id="broker" set so that
20+
the Jetty server starts only after the broker is fully available.
21+
e.g. <broker id="broker" xmlns="http://activemq.apache.org/schema/core" ...>
1822
-->
1923
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2024
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
@@ -208,8 +212,8 @@
208212
</property>
209213
</bean>
210214

211-
<bean id="invokeStart" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"
212-
depends-on="configureJetty, invokeConnectors">
215+
<bean id="invokeStart" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"
216+
depends-on="configureJetty, invokeConnectors, broker">
213217
<property name="targetObject" ref="Server" />
214218
<property name="targetMethod" value="start" />
215219
</bean>

assembly/src/release/examples/conf/activemq-demo.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
- Change the brokerName attribute to something unique
4848
-->
4949

50-
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="amq-broker" useJmx="true">
50+
<broker id="broker" xmlns="http://activemq.apache.org/schema/core" brokerName="amq-broker" useJmx="true">
5151

5252
<!--
5353
Examples of destination-specific policies using destination

assembly/src/release/examples/conf/activemq-security.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
</bean>
6464
-->
6565

66-
<broker useJmx="true" persistent="false" xmlns="http://activemq.apache.org/schema/core" >
66+
<broker id="broker" useJmx="true" persistent="false" xmlns="http://activemq.apache.org/schema/core" >
6767

6868
<managementContext>
6969
<managementContext createConnector="true">

assembly/src/release/examples/conf/activemq-stomp.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<!--
4545
The <broker> element is used to configure the ActiveMQ broker.
4646
-->
47-
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
47+
<broker id="broker" xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
4848

4949
<!--
5050
For better performances use VM cursor and small memory limit.

0 commit comments

Comments
 (0)