http://tomee.apache.org/jms-resources-and-mdb-container.html

http://activemq.apache.org/xml-configuration.html

http://activemq.apache.org/persistence.html

http://activemq.apache.org/configuring-transports.html

文件位置

[tomee]/conf/tomee.xml

[tomee]/conf/activemq.xml

使用配置文件(activemq.xml)可以简化配置(../conf/activemq.xml 可以指定全路径 ps:是相对于启动tomcat的命令执行位置的相对路径,例如:[tomee]/bin 下执行starup.bat,        对应为../conf/activemq.xlm

[tomee]        下执行bin\startup.bat,对应为conf/activemq.xml

<tomee>
<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
BrokerXmlConfig = xbean:file:../conf/activemq.xml
ServerUrl = tcp://someHostName:61616
</Resource> <Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
ResourceAdapter = MyJmsResourceAdapter
</Resource> <Container id="MyJmsMdbContainer" ctype="MESSAGE">
ResourceAdapter = MyJmsResourceAdapter
</Container> <Resource id="FooQueue" type="javax.jms.Queue"/>
<Resource id="BarTopic" type="javax.jms.Topic"/>
</tomee>

AMQ 5.x (../derby 可以指定全路径,自动创建)

<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker useJmx="true" xmlns="http://activemq.apache.org/schema/core">
<networkConnectors>
<!--
<networkConnector uri="multicast://default?initialReconnectDelay=100" />
<networkConnector uri="static://(tcp://localhost:61616)" />
-->
</networkConnectors>
<persistenceFactory>
<journalPersistenceAdapterFactory journalLogFiles="5" dataDirectory="../derby" /> <!-- To use a different dataSource, use the following syntax : -->
<!--
<journalPersistenceAdapterFactory journalLogFiles="5" dataDirectory="${basedir}/activemq-data" dataSource="#mysql-ds"/>
-->
</persistenceFactory>
<transportConnectors>
<transportConnector uri="tcp://localhost:61616" />
</transportConnectors>
</broker>
<!-- MySql DataSource Sample Setup -->
<!--
<bean id="mysql-ds" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>
<property name="username" value="activemq"/>
<property name="password" value="activemq"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
-->
</beans>

所需的 jar 包

        <dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
<version>5.14.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-journal</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activeio-core</artifactId>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.12.1.1</version>
</dependency>

ps: localhost 只试用于本机remote client

如需不同机器之间remote client,需指定具体外网ip

tomee 消息持久化的更多相关文章

  1. RabbitMQ原理与相关操作(三)消息持久化

    现在聊一下RabbitMQ消息持久化: 问题及方案描述 1.当有多个消费者同时收取消息,且每个消费者在接收消息的同时,还要处理其它的事情,且会消耗很长的时间.在此过程中可能会出现一些意外,比如消息接收 ...

  2. EQueue - 详细谈一下消息持久化以及消息堆积的设计

    前言 之前写了一篇文章,总体介绍了EQueue.在看这篇文章之前如果还没看过那篇文章,可能会看不懂这篇文章.所以建议没看过的朋友务必先看一下那篇文章中所提到的各种概念,这样才能更好的理解本文所说的内容 ...

  3. ActiveMQ的几种消息持久化机制

    为了避免意外宕机以后丢失信息,需要做到重启后可以恢复消息队列,消息系统一般都会采用持久化机制. ActiveMQ的消息持久化机制有JDBC,AMQ,KahaDB和LevelDB,无论使用哪种持久化方式 ...

  4. 【转】 使用Redis的Pub/Sub来实现类似于JMS的消息持久化

    http://blog.csdn.net/canot/article/details/52040415 关于个人对Redis提供的Pub/Sub机制的认识在上一篇博客中涉及到了,也提到了关于如何避免R ...

  5. rabbitmq 消息持久化之receive and send

    二: 任务分发 &消息持久化   启用多个接收端的时候如果某一个receive 关闭要保证消息有反馈是否收到   send端 #-*- coding: UTF-8 -*-import pika ...

  6. rabbitmq 消息持久化

    rabbitmq 消息持久化 2016-02-18 11:19 224人阅读 评论(0) 收藏 举报  分类: 综合(15)  版权声明:本文为博主原创文章,未经博主允许不得转载. 二: 任务分发 & ...

  7. ActiveMQ学习系列(四)----消息持久化到mysql

    前记:目前学习还比较杂乱,还未找到系统化地学习ActiveMq的方法.在网上看到消息持久化的demo,了解了一下,在此记录. 一.目前ActiveMq支持的持久化方法 url:http://activ ...

  8. Azure Messaging-ServiceBus Messaging消息队列技术系列4-复杂对象消息是否需要支持序列化和消息持久化

    在上一篇中,我们介绍了消息的顺序收发保证: Azure Messaging-ServiceBus Messaging消息队列技术系列3-消息顺序保证 在本文中我们主要介绍下复杂对象消息是否需要支持序列 ...

  9. ActiveMQ的消息持久化机制

    为了避免意外宕机以后丢失信息,需要做到重启后可以恢复消息队列,消息系统一般都会采用持久化机制. ActiveMQ的消息持久化机制有JDBC,AMQ,KahaDB和LevelDB,无论使用哪种持久化方式 ...

随机推荐

  1. Oracle 更新表(另一张表)

    Update a set(a.province,a.city)= (select province,city from b where b.mobile=a.mobile)

  2. linux命令(3):pwd命令

    Linux中用 pwd 命令来查看”当前工作目录“的完整路径. 简单得说,每当你在终端进行操作时,你都会有一个当前工作目录. 在不太确定当前位置时,就会使用pwd来判定当前目录在文件系统内的确切位置. ...

  3. 初步认识html以及表格的制作

    12.21,冬至,天空中还下着小雨,雾霾也没有散去,但是也没有冲散节日的气氛,心情也是倍儿好. 今天学习了不少的内容,对我来说是对之前所学的一个巩固,内容比较多也比较杂乱一些,下面以例子的形式来表现: ...

  4. modelsim无法识别include文件的解决方法

    modelsim发现include关联的文件编译报语法错误,文件名需要写绝对路径,即使这个文件和工程其它文件在一个目录上.例如只写成 `include "c0_ddr3_model_para ...

  5. webpack配置sass模块的加载

    webpack管理的项目,我们希望用sass定义样式,为了正常编译,需要做如下配置.这里不讲webpack的入门,入门的文章,我推荐这篇<webpack入门>. 为了使用sass,我们需要 ...

  6. Ajax调用SpringMVC ModelAndView 无返回情况

    在项目中使用Ajax的时候,success中返回的data一直都是null,也没有报错.在确定Ajax语法没有错误,也没有牵扯跨域问题后,用排除法挨着删除代码,发现是因为Spring MVC会自动把方 ...

  7. CentOS下的Memcache安装步骤(Linux+Nginx+PHP+Memcached)

    一.源码包准备 服务器端主要是安装memcache服务器端下载:http://memcached.googlecode.com/files/memcached-1.4.4.tar.gz另外,Memca ...

  8. Calculating Stereo Pairs

    Calculating Stereo Pairs Written by Paul BourkeJuly 1999 Introduction The following discusses comput ...

  9. IOS中无缓存的图片载入

    在IOS中,我们常用[UIImage imageNamed]方法获取图像,这种方法简便,容易理解.但是有个缺点,就是有缓存.这种方式 传人的图像的就是通过文件名方式文件名.如果,我们内存有限,我们就必 ...

  10. php的cookie和session相同主域名共享

    如何使用chrome查看cookie和session详见另一篇文章,点这里 首先说cookie, $cookieDomain = '.elf.com'; setcookie('elf', 'im el ...