1. <beans
2. xmlns="/schema/beans"
3. xmlns:amq="/config/1.0"
4. xmlns:xsi="/2001/XMLSchema-instance" xsi:schemaLocation="/schema/beans /schema/beans/spring-beans-2.0.xsd
5. /config/1.0 /schema/activemq-core.xsd
6. /camel/schema/spring>
7.
8. <!-- persistent="true"表示要持久化存储消息,和子元素persistenceAdapter结合使用 -->
9. <!-- dataDirectory默认的存储持久化数据的目录 -->
10. <!-- brokerName 设置broker的name,在注意在网络上必须是唯一的-->
11. <!-- 更多参考/xbean-xml-reference-50.html#XBeanXMLReference5.0-brokerelement -->
12. <broker xmlns="/config/1.0" brokerName="192.168.1.148"active transport persistent ="true" dataDirectory="${activemq.base}/data" useShutdownHook="false">
13.
14.
15. <!-- wildcards意义见/wildcards.html -->
16. <destinationPolicy>
17. <policyMap>
18. <policyEntries>
19. <!-- 这里使用了wildcards,表示所有以EUCITA开头的topic -->
20. <policyEntry topic="EUCITA.>" producerFlowControl="false" memoryLimit="10mb">
21. <!-- 分发策略 -->
22. <dispatchPolicy>
23. <!-- 按顺序分发 -->
24. <strictOrderDispatchPolicy/>
25. </dispatchPolicy>
26. <!-- 恢复策略-->
27. <subscriptionRecoveryPolicy>
28. <!-- 只恢复最后一个message -->
29. <lastImageSubscriptionRecoveryPolicy/>
30. </subscriptionRecoveryPolicy>
31. </policyEntry>
32. </policyEntries>
33. </policyMap>
34. </destinationPolicy>
35.
36.
37. <transportConnectors>
38. <transportConnector name="openwire" uri="tcp://192.168.1.148:61616" discoveryUri="multicast://default"/>
39. <transportConnector name="ssl" uri="ssl://192.168.1.148:61617"/>
40. <transportConnector name="stomp" uri="stomp://192.168.1.148:61613"/>
41. <transportConnector name="xmpp" uri="xmpp://192.168.1.148:61222"/>
42. </transportConnectors>
43.
44. <!-- 消息持久化方式 -->
45. <persistenceAdapter>
46. <amqPersistenceAdapter directory="${activemq.base}/data"/>
47. </persistenceAdapter>
48. </broker>
49.
50.
51. <commandAgent xmlns="/config/1.0"/>
52.
53.
54. <jetty xmlns="mortbay/schemas/jetty/1.0">
55. <connectors>
56. <nioConnector port="8161" />
57. </connectors>
58.
59. <handlers>
60. <webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true" />
61. <webAppContext contextPath="/demo" resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true" />
62. </handlers>
63. </jetty>
64. </beans>
Xml代码
1. <beans
2. xmlns="/schema/beans"
3. xmlns:amq="/config/1.0"
4. xmlns:xsi="/2001/XMLSchema-instance" xsi:schemaLocation="/schema/beans /schema/beans/spring-beans-2.0.xsd
5. /config/1.0 /schema/activemq-core.xsd
6. /camel/schema/spring>
7. <!-- persistent="true"表示要持久化存储消息,和子元素persistenceAdapter结合使用 -->
8. <!-- dataDirectory默认的存储持久化数据的目录 -->
9. <!-- brokerName 设置broker的name,在注意在网络上必须是唯一的-->
10. <!-- 更多参考/xbean-xml-reference-50.html#XBeanXMLReference5.0-brokerelement -->
11. <broker xmlns="/config/1.0" brokerName="192.168.1.148" persistent ="true" dataDirectory="${activemq.base}/data" useShutdownHook="false">
12.
13. <!-- wildcards意义见/wildcards.html -->
14. <destinationPolicy>
15. <policyMap>
16. <policyEntries>
17. <!-- 这里使用了wildcards,表示所有以EUCITA开头的topic -->
18. <policyEntry topic="EUCITA.>" producerFlowControl="false" memoryLimit="10mb">
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论