WebLogic Server高级管理之八:JMS 存储与转发

提醒:weblogic系列博客均转载自千红一酷的博客,原地址为http://maping930883.blogspot.com

运行环境:WebLogic Server 12.1.1 开发版 + Oracle Database 10g Express Edition 10.2.0.1。

我们知道,部署在某个WebLogic Server上的应用可以通过JNDI访问到部署在该Server上的Queue/Topic。
如果有两个应用是分别部署在同一个Domain的两个Server上,或者是两个Domain的Server上,那么如何通过Queue/Topic进行通讯?
WebLogic Server中的JMS功能提供了一个Store and Forward特性,可以帮助我们实现该功能

设计图如下:
[img]http://dl.iteye.com/upload/attachment/0071/1575/ed0b922a-a704-3b39-b390-5eb31b4e8e2d.png[/img]
[b]重点步骤说明:[/b]
[b]1. 创建两个Domain:dev_domain和dev2_domain[/b]
其中dev_domain作为消息源,dev2_domain作为消息目的。

[b]2. 在dev2_domain创建JMS资源[/b]JMS Modules:msg2JMSSystemResource
JMS Server:msg2JMSServer
Connection Factory:msg2ConnectionFactory
Queue:msg2Queue
Subdeployment:msg2Subdeployment

[img]http://dl.iteye.com/upload/attachment/0071/1577/4e4b6f13-eb61-3a62-aa42-b6c5fe16cdb2.png[/img]


[b]3. 在dev_domain创建JMS资源[/b]
创建完成后的JMS Modules:MySAFSystemModule。

[img]http://dl.iteye.com/upload/attachment/0071/1579/e8e2bdb0-0ef9-395d-9f42-2f014eda5ce1.png[/img]

(1)创建Store-and-Forward Agents:MySAFAgent,target到Server上。

[img]http://dl.iteye.com/upload/attachment/0071/1581/ce9960a0-3d07-329a-b199-74861d648885.png[/img]

(2)创建JMS Modules:MySAFSystemModule
(3)在MySAFSystemModule中创建SubDeployment:MySAFSubDeployment,target到MySAFAgent上。
注意,与一般的SubDeployment定义不同,这里要把target到MySAFAgent上。
不要把MySAFSubDeploymenttarget到JMS Server上,这一步很关键,不要搞错

[img]http://dl.iteye.com/upload/attachment/0071/1583/1a62231c-aba9-3597-9f66-72724863a166.png[/img]

(4)在MySAFSystemModule中创建Connection Factory:MySAFConnectionFactory,target到MySAFSubDeployment上。

(5)在MySAFSystemModule中创建remote SAF contex:MyRemoteSAFContext。
这里指向dev2_domain。

[img]http://dl.iteye.com/upload/attachment/0071/1585/0b3a3d79-5e44-3463-b4e1-9c32fb28bc78.png[/img]
(6)在MySAFSystemModule中创建SAF imported destinations:MySAFImportedDestination。
此步特别容易出错,建议如图配置后,直接点击finish按钮;然后再为其设置SubDeployment,选择MySAFSubDeployment。

[img]http://dl.iteye.com/upload/attachment/0071/1587/8867214d-b99a-3ecd-9921-d9d6d74f9add.png[/img]

(7)在MySAFImportedDestination中创建Queue:MySAFQueue。
注意别忘了设置Local JNDI Name。
此步也特别容易出错,如图配置后,点击save按钮时如果报出如下错误:
“The imported destination msg2Queue has been targeted to an invalid target:msgJMSServer”
请把MySAFImportedDestination的SubDeployment设置为None。
然后再重新创建Queue并保存。
最后把MySAFImportedDestination的SubDeployment再改回MySAFSubDeployment。

[img]http://dl.iteye.com/upload/attachment/0071/1589/a916609a-4a9d-3448-ba90-9d61b18b3b55.png[/img]

(8)重新启动dev_domain中的AdminServer。
查看JNDI Tree,如果能看到SAF_msg2Queue,说明SAF配置成功。

[img]http://dl.iteye.com/upload/attachment/0071/1591/355ed837-61a2-3cc4-ac6a-9f1b9a772754.png[/img]


[b]4. 测试

4.1 测试Forward[/b]
(1)分别启动dev_domain和dev2_domain中的AdminServer。
(2)向dev_domain中的SAF Queue:和SAF_msg2Queue中发消息。
(3)观察dev_domain中的SAF Queue:

[img]http://dl.iteye.com/upload/attachment/0071/1594/44ceace0-cd81-326e-8ae4-17f68d2edbd3.png[/img]

点击Remote Endpoints进去查看,发现没有一条消息,消息可能已经转发走了。
(4)观察dev2_domain中的Queue:msg2Queue
发现消息都转发过来了。

4.2 测试Store and Forward
(1)只启动dev_domain中的AdminServer。
(2)向dev_domain中的SAF Queue:和SAF_msg2Queue中发消息。
(3)观察dev_domain中的SAF Queue
点击Remote Endpoints进去查看,发现消息都在这里,消息的详细信息如下。

[img]http://dl.iteye.com/upload/attachment/0071/1597/9ceaf222-49d6-38b2-a120-c8477da3c980.png[/img]


(4)启动dev2_domain中的AdminServer
(5)观察dev2_domain中的Queue:msg2Queue
发现消息都转发过来了。
(6)再次观察dev_domain中的SAF Queue。
发现消息都没有了,已经转发走了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值