使用JMS Connector支持Apache ActiveMQ(基于Opentext Cordys平台)
2014-03-30 12:13
351 查看
介绍
本文描述怎样去配置JMS Connector连接Apache ActiveMQ消息传送系统。ActiveMQ是一个开源项目,能被安装和容易配置去测试JMS Connector功能。
安装 Apache ActiveMQ
下载最新正式版本,地址为:http://activemq.apache.org。解压zip文件内容到一个新的文件夹。
(在windows环境中)从bin文件夹中运行activemq.bat 。
创建 JNDI 属性文件
创建一个文件夹命名为activemq-jndi,这个文件夹将要在随后的步骤中被加入到JRE类路径( JRE class path)中,在这个文件夹中创建一个文件命名为 jndi.properties ,文件中内容如下:java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
# use the following property to configure the default connector
java.naming.provider.url = vm://localhost
# use the following property to specify the JNDI name the connection factory
# should appear as.
connectionFactoryNames = activemq-cf
# register some queues in JNDI using the form
# queue.[jndiName] = [physicalName]
queue.myqueue = example.myqueue
创建 SOAP处理器
1、创建一个新的JMS Connector SOAP 处理器。2、在 General tab页中,从 JRE classpath中的ActiveMQ lib文件夹 中添加下列文件。
对于ActiveMQ 5.0
activemq-core-5.0.0.jar
geronimo-jms_1.1_spec-1.0.jar
geronimo-j2ee-management_1.0_spec-1.0.jar
commons-logging-1.1.jar
添加activemq-jndi 文件夹全路径到JRE classpath中(确信Cordys用户有读处理此文件夹和文件的权限)。
对于 ActiveMQ 5.1
apache-activemq-5.5.1\lib\activemq-core-5.5.1.jar
apache-activemq-5.5.1\lib\geronimo-j2ee-management_1.1_spec-1.0.1.jar
apache-activemq-5.5.1\lib\geronimo-jms_1.1_spec-1.1.1.jar
apache-activemq-5.5.1\lib\slf4j-api-1.5.11.jar
apache-activemq-5.5.1\lib\optional\slf4j-log4j12-1.5.11.jar
添加activemq-jndi 文件夹全路径到JRE classpath中(确信Cordys用户有读处理此文件夹和文件的权限)。
对于其它版本,jar文件名称或许有点不同For other versions, jar file names might be a bit different
3、在JMS Connector tab页,添加下列属性:
一个新的目的地管理:
Name: activemq
JMS Vendor: ActiveMQ
Provider URL: tcp://localhost:61616
JNDI Name: activemq-cf
目的地管理器下一个新的队列。
Name: myqueue
JNDI Name: myqueue
注:你也可以通过保存文件到/Cordys/JMSConnector/config 文件夹下的XMLStore加载这个配置,并从连接器配置页导入配置。
4、保存连接器配置并启动Soap处理器。
测试配置
确信ActiveMQ 服务在运行, JMS Connector已经被正确的启动,并且你有在 JMS Connector ISV包的角色。使用下面SOAP请求写一个消息到队列中:
<sendMessage xmlns="http://schemas.cordys.com/1.0/jms" persistentdelivery="" expiration="">
<destination>activemq.myqueue</destination>
<message>
<root>
<message>Test Apache ActiveMQ message</message>
</root>
</message>
</sendMessage>
你应收到下面SOAP响应:
<sendMessageResponse xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.cordys.com/1.0/jms" persistentdelivery="" expiration="" >
<messageid>ID:cnd1033-4337-1184592484240-1:0:2:1:1</messageid>
</sendMessageResponse>
使用下面SOAP请求,从队列里读这个消息:
<getMessage xmlns="http://schemas.cordys.com/1.0/jms" waitformessage="true">
<destination>activemq.myqueue</destination>
<messageformat>xmlMessage</messageformat>
<timeout>10000</timeout>
</getMessage>
你应接收下面SOAP响应:
<getMessageResponse xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.cordys.com/1.0/jms" waitformessage="true" >
<message>
<root>
<message>Test Apache ActiveMQ message</message>
</root>
</message>
<messageid>ID:cnd1033-4337-1184592484240-1:0:5:1:1</messageid>
<fromdestination>activemq.myqueue</fromdestination>
</getMessageResponse>
原文:Using JMS Connector with Apache ActiveMQ
相关文章推荐
- Libgdx的使用(14)——基于RoboVM对IOS平台的支持
- Opentext Cordys BOP 4 平台数据库使用分析一则(在途流程)
- 基于微软开发平台构建和使用私有NuGet托管库
- JMS与Spring的整合实例(基于Apache ActiveMQ)JMS的介绍
- AWStats: Apache/IIS的日志分析工具——在GNU/Linux和Windows平台上的使用简介
- so使用原则(要么不支持,要么全部支持) 固定的运行平台 指定目录:System.load("/data/data/<package-name>/mydir/libmath.so");
- 基于modern ui for wpf的在线公开课平台 之三 使用grid布局
- [C] 跨平台使用TCHAR——让Linux等平台也支持tchar.h,解决跨平台时的格式控制字符问题,多国语言的同时显示(兼容vc/gcc/bcb,支持Windows/Linux/Mac)
- apache使用.htaccess进行基于文件扩展名的访问控制
- 使用基于Apache Spark的随机森林方法预测贷款风险
- 基于modern ui for wpf的在线公开课平台 之五 使用ListBox实现图片列表效果
- 使用基于Apache Spark的随机森林方法预测贷款风险
- JMS Apache ActiveMQ使用(1)
- 基于Centos 6.5 配置分离式LAMP平台环境的一次扩展实现多PHP Apache和自建DNS来提升LAMP的负载
- [ZZ]线程池 And 线程池的使用(基于.net平台)
- 使用 Apache JMeter 测试基于云的应用程序
- delphi不同版本字符串类型的演化(要支持基于firemonkey的app调用,字符串最好使用olevariant类型)
- 《基于Apache Kylin构建大数据分析平台》
- Cloud9免费云IDE代码编辑平台空间支持Node.js,PHP,Python可使用FTP管理
- ActiveMq--00--Windows和Linux平台安装使用ActiveMQ