activemq的配置问题

yan13579 2007-09-11 12:16:54
最近在研究activemq的使用,有几个问题请高手解决
1.如何在activemq.xml里面配置消息队列的大小,这样才保证队列不会溢出。
2.如果选择持久化消息,那么数据库应该如何配置,是否需要建库和建表,表的结构是怎么样的?
3.activemq有没有限制连接数的,默认是多少,如果自己设的,应该这样配置?
4.activemq在内存和连接方面还有没有其他性能的优化,具体配置是这样的?
先谢谢各位高手看贴,请回复,最好能贴上自己的activemq.xml。感谢感谢……
...全文
3003 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
白色心情 2008-12-25
  • 打赏
  • 举报
回复
1. <beans
2. <SPAN class=hilite2>xml</SPAN>ns="http://www.springframework.org/schema/beans"
3. <SPAN class=hilite2>xml</SPAN>ns:amq="http://<SPAN class=hilite1>activemq</SPAN>.org/config/1.0"
4. <SPAN class=hilite2>xml</SPAN>ns:xsi="http://www.w3.org/2001/<SPAN class=hilite2>XML</SPAN>Schema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
5. http://<SPAN class=hilite1>activemq</SPAN>.org/config/1.0 http://<SPAN class=hilite1>activemq</SPAN>.apache.org/schema/<SPAN class=hilite1>activemq</SPAN>-core.xsd
6. http://<SPAN class=hilite1>activemq</SPAN>.apache.org/camel/schema/spring>
7.
8. <!-- persistent="true"表示要持久化存储消息,和子元素persistenceAdapter结合使用 -->
9. <!-- dataDirectory默认的存储持久化数据的目录 -->
10. <!-- brokerName 设置broker的name,在注意在网络上必须是唯一的-->
11. <!-- 更多参考http://<SPAN class=hilite1>activemq</SPAN>.apache.org /xbean-<SPAN class=hilite2>xml</SPAN>-reference-50.html#XBean<SPAN class=hilite2>XML</SPAN>Reference5.0-brokerelement -->
12. <broker <SPAN class=hilite2>xml</SPAN>ns="http://<SPAN class=hilite1>activemq</SPAN>.org/config/1.0" brokerName="192.168.1.148" persistent ="true" dataDirectory="${<SPAN class=hilite1>activemq</SPAN>.base}/data" useShutdownHook="false">
13.
14. <!-- Destination specific policies using destination names or wildcards -->
15. <!-- wildcards意义见http://<SPAN class=hilite1>activemq</SPAN>.apache.org/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. <!-- The transport connectors <SPAN class=hilite1>ActiveMQ</SPAN> will listen to -->
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="${<SPAN class=hilite1>activemq</SPAN>.base}/data"/>
47. </persistenceAdapter>
48. </broker>
49.
50. <!-- lets create a command agent to respond to message based admin commands on the <SPAN class=hilite1>ActiveMQ</SPAN>.Agent topic -->
51. <commandAgent <SPAN class=hilite2>xml</SPAN>ns="http://<SPAN class=hilite1>activemq</SPAN>.org/config/1.0"/>
52.
53. <!-- An embedded servlet engine for serving up the Admin console -->
54. <jetty <SPAN class=hilite2>xml</SPAN>ns="http://mortbay.com/schemas/jetty/1.0">
55. <connectors>
56. <nioConnector port="8161" />
57. </connectors>
58.
59. <handlers>
60. <webAppContext contextPath="/admin" resourceBase="${<SPAN class=hilite1>activemq</SPAN>.base}/webapps/admin" logUrlOnStart="true" />
61. <webAppContext contextPath="/demo" resourceBase="${<SPAN class=hilite1>activemq</SPAN>.base}/webapps/demo" logUrlOnStart="true" />
62. </handlers>
63. </jetty>
64. </beans>
白色心情 2008-12-25
  • 打赏
  • 举报
回复
ActiveMQ 配置 可以看下 activemq.xml 里有英文注释可以看下

Xml代码
1. <beans
2. <SPAN class=hilite2>xml</SPAN>ns="http://www.springframework.org/schema/beans"
3. <SPAN class=hilite2>xml</SPAN>ns:amq="http://<SPAN class=hilite1>activemq</SPAN>.org/config/1.0"
4. <SPAN class=hilite2>xml</SPAN>ns:xsi="http://www.w3.org/2001/<SPAN class=hilite2>XML</SPAN>Schema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
5. http://<SPAN class=hilite1>activemq</SPAN>.org/config/1.0 http://<SPAN class=hilite1>activemq</SPAN>.apache.org/schema/<SPAN class=hilite1>activemq</SPAN>-core.xsd
6. http://<SPAN class=hilite1>activemq</SPAN>.apache.org/camel/schema/spring>
7.
8. <!-- persistent="true"表示要持久化存储消息,和子元素persistenceAdapter结合使用 -->
9. <!-- dataDirectory默认的存储持久化数据的目录 -->
10. <!-- brokerName 设置broker的name,在注意在网络上必须是唯一的-->
11. <!-- 更多参考http://<SPAN class=hilite1>activemq</SPAN>.apache.org /xbean-<SPAN class=hilite2>xml</SPAN>-reference-50.html#XBean<SPAN class=hilite2>XML</SPAN>Reference5.0-brokerelement -->
12. <broker <SPAN class=hilite2>xml</SPAN>ns="http://<SPAN class=hilite1>activemq</SPAN>.org/config/1.0" brokerName="192.168.1.148" persistent ="true" dataDirectory="${<SPAN class=hilite1>activemq</SPAN>.base}/data" useShutdownHook="false">
13.
14. <!-- Destination specific policies using destination names or wildcards -->
15. <!-- wildcards意义见http://<SPAN class=hilite1>activemq</SPAN>.apache.org/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. <!-- The transport connectors <SPAN class=hilite1>ActiveMQ</SPAN> will listen to -->
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="${<SPAN class=hilite1>activemq</SPAN>.base}/data"/>
47. </persistenceAdapter>
48. </broker>
49.
50. <!-- lets create a command agent to respond to message based admin commands on the <SPAN class=hilite1>ActiveMQ</SPAN>.Agent topic -->
51. <commandAgent <SPAN class=hilite2>xml</SPAN>ns="http://<SPAN class=hilite1>activemq</SPAN>.org/config/1.0"/>
52.
53. <!-- An embedded servlet engine for serving up the Admin console -->
54. <jetty <SPAN class=hilite2>xml</SPAN>ns="http://mortbay.com/schemas/jetty/1.0">
55. <connectors>
56. <nioConnector port="8161" />
57. </connectors>
58.
59. <handlers>
60. <webAppContext contextPath="/admin" resourceBase="${<SPAN class=hilite1>activemq</SPAN>.base}/webapps/admin" logUrlOnStart="true" />
61. <webAppContext contextPath="/demo" resourceBase="${<SPAN class=hilite1>activemq</SPAN>.base}/webapps/demo" logUrlOnStart="true" />
62. </handlers>
63. </jetty>
64. </beans>

meadking 2008-11-04
  • 打赏
  • 举报
回复
不懂,呵呵!
victorxiang 2008-11-01
  • 打赏
  • 举报
回复
建议,楼主到google找找,应该可以找到你的答案!
waterborn 2008-07-04
  • 打赏
  • 举报
回复
用持久化,队列不会溢出, 数据库应该如何配置好并建好库, 建表activemq自己会建立
配置先看一下activemq document ,很简单的, 注释和取消注释一下就好,
activemq.xml 写的很清楚. 5 和4 有些区别
yan13579 2007-09-12
  • 打赏
  • 举报
回复
any body?

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧