spring 集成activitymq持久化文件怎么设置

spring 集成activitymq持久化文件怎么设置,第1张

ActiveMQ另问题要软件能挂掉挂掉怕怕挂掉信息给丢所本节析几种持久化式:
、持久化文件
ActiveMQ默认支持种式要发消息设置消息持久化
打安装目录配置文件:
D:\ActiveMQ\apache-activemq\conf\activemqxml越80行发现默认配置项:
注意使用kahaDB基于文件支持事务消息存储器靠高性能扩展消息存储器
设计初衷使用简单并尽能快KahaDB索引使用transaction log并且所destination使用index测试表明:用于产环境支持1万active connection每connection独立queue该表现已经足矣应付部需求
再发送消息候改变第二参数:
MsgDeliveryModePersistent
Message保存式2种
PERSISTENT:保存磁盘consumer消费message删除
NON_PERSISTENT:保存内存消费message清除
注意:堆积消息太能导致内存溢
打产者端发送消息:
wps30F4tmp
启消费者端同管理界面查看:
wps3105tmp
发现消息等待没持久化ActiveMQ宕机重启消息丢失我现修改文件持久化重启ActiveMQ消费者仍能够收消息
wps3106tmp
二、持久化数据库
我支持Mysql例先载mysql-connector-java-5134-binjar包放:
D:\ActiveMQ\apache-activemq\lib目录
打并修改配置文件:
复制代码
<beans
xmlns=""
xmlns:xsi=""
xsi:schemaLocation=" /spring-beansxsd
/activemq-corexsd">
file:${activemqconf}/credentialsproperties
<bean id="logQuery" class="orgfusesourceinsightloglog4jLog4jLogQuery"
lazy-init="false" scope="singleton"
init-method="start" destroy-method="stop">
<!--
The element is used to configure the ActiveMQ broker
-->
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
-->
<!--
The managementContext is used to configure how ActiveMQ is exposed in
JMX By default, ActiveMQ uses the MBean server that is started by
the JVM For more information, see:
-->
<!--
Configure message persistence for the broker The default persistence
mechanism is the KahaDB store (identified by the kahaDB tag)
For more information, see:
-->
<!--
The systemUsage controls the maximum amount of space the broker will
use before disabling caching and/or slowing down producers For more information, see:
-->
<!--
The transport connectors expose ActiveMQ over a given protocol to
clients and other brokers For more information, see:
-->
<!--
Enable web consoles, REST and Ajax APIs and demos
The web consoles requires by default login, you can disable this in the jettyxml file
Take a look at ${ACTIVEMQ_HOME}/conf/jettyxml for more details
-->
J

Spring框架是为了解决企业应用开发的复杂性而创建的。

Spring的用途不仅仅限于服务器端的开发。从简单性、可测试性和松耦合性角度而言,绝大部分Java应用都可以从Spring中受益。使用基本的JavaBean代替EJB,并提供了更多的企业应用功能。

扩展资料

优点

1、JAVA EE应该更加容易使用。

2、面向对象的设计比任何实现技术(比如JAVA EE)都重要。

3、面向接口编程,而不是针对类编程。Spring将使用接口的复杂度降低到零。(面向接口编程有哪些复杂度)

4、代码应该易于测试。Spring框架会帮助你,使代码的测试更加简单。

5、JavaBean提供了应用程序配置的最好方法。

6、在Java中,已检查异常(Checked exception)被过度使用。框架不应该迫使你捕获不能恢复的异常。

参考资料来源:百度百科-spring框架

创建一个默认名为hazelcast-instance的HazelcastInstance实例;
使用默认的组播发现模式,组播传播地址默认为:224223,如果想修改信息或修改为TCP模式可通过setNetworkConfig()接口设置相关信息;
创建一个名为dev,访问密码为dev-pass的group保障节点加入,如果想修改组,可通过setGroupConfig()接口设置相关信息;
创建了一个名为instruments的分布式map数据结构,并设置了该map的最大容量200/逐出策略LRU/有效期20000ms等信息,当集群启动后,我们可以在任一成员节点上通过HazelcastInstance读写该map。
资料整理自:黑少微服务商店


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/dianzi/12895167.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-28
下一篇 2023-05-28

发表评论

登录后才能评论

评论列表(0条)

保存