csusky
导航
BlogJava
首页
新随笔
联系
聚合
管理
<
2008年10月
>
日
一
二
三
四
五
六
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
留言簿
(2)
给我留言
查看公开留言
查看私人留言
随笔分类
AJAX
(rss)
HIBERNATE(1)
(rss)
J2EE(3)
(rss)
JAVA基础(8)
(rss)
JAVA非阻塞编程(2)
(rss)
JDBC(2)
(rss)
LUCENE(13)
(rss)
NOTE(1)
(rss)
ORACLE(1)
(rss)
PL/SQL
(rss)
SPRING
(rss)
STRUTS
(rss)
随笔档案
2009年11月 (1)
2008年12月 (1)
2008年11月 (2)
2008年10月 (1)
2008年5月 (4)
2008年4月 (11)
2008年3月 (2)
2008年2月 (10)
阅读排行榜
1. JDBC中的连接方式 thin模式 和 DataSource方式(3697)
2. SPRING整合IBMMQ实现全局事物(2404)
3. TREEMAP的排序机制(2091)
4. JMS基础(2084)
5. ORACLE的块大小(1755)
评论排行榜
1. Lucene的切词 analysis包(1)
2. 异步IO的关闭事件(1)
3. TREEMAP的排序机制(1)
4. JDBC中的批处理(1)
5. JMS基础(1)
常用链接
我的随笔
我的评论
我的参与
最新评论
统计
随笔 - 32
文章 - 0
评论 - 5
引用 - 0
最新评论
1. re: TREEMAP的排序机制[未登录]
不错,不错!
--xxx
2. re: 异步IO的关闭事件
好文,帮助很大,就是如何判断通道关闭了
--daimojingdeyu
3. re: Lucene的切词 analysis包
强,真是我需要的
--啊啊啊
4. re: JMS基础
不错,谢谢共享
--hushuili
5. re: JDBC中的批处理
ddddddddd
--反反复复
SPRING整合IBMMQ实现全局事物
<?
xml version
=
"
1.0
"
encoding
=
"
UTF-8
"
?>
<
beans xmlns
=
"
http://www.springframework.org/schema/beans
"
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
"
>
<
bean id
=
"
jndiTemplate
"
class
=
"
org.springframework.jndi.JndiTemplate
"
>
<
property name
=
"
environment
"
>
<
props
>
<
prop key
=
"
java.naming.factory.initial
"
>
com.sun.jndi.fscontext.RefFSContextFactory
</
prop
>
<
prop key
=
"
java.naming.provider.url
"
>
file:
/
C:
/
JMSDEMO
/
JNDI
/
mes
</
prop
>
</
props
>
</
property
>
</
bean
>
<!--<
bean id
=
"
queueConnectionFactory
"
class
=
"
org.springframework.jndi.JndiObjectFactoryBean
"
>
<
property name
=
"
jndiTemplate
"
>
<
ref bean
=
"
jndiTemplate
"
/>
</
property
>
<
property name
=
"
jndiName
"
>
<
value
>
JMSDEMOCF
</
value
>
</
property
>
</
bean
>
-->
<
bean id
=
"
ConnectionFactoryBean
"
class
=
"
bitronix.tm.resource.jms.JndiXAConnectionFactory
"
>
<!--
<
property name
=
"
className
"
value
=
"
com.ibm.mq.jms.MQXAQueueConnectionFactory
"
/>-->
<!--
<
property name
=
"
uniqueName
"
value
=
"
MQSeries
"
/>-->
<!--
<
property name
=
"
poolSize
"
value
=
"
2
"
/>-->
<
property name
=
"
name
"
value
=
"
JMSDEMOCF
"
></
property
>
<
property name
=
"
initialContextFactory
"
value
=
"
com.sun.jndi.fscontext.RefFSContextFactory
"
></
property
>
<
property name
=
"
providerUrl
"
value
=
"
file:/C:/JMSDEMO/JNDI/mes
"
></
property
>
</
bean
>
<
bean id
=
"
des
"
class
=
"
org.springframework.jndi.JndiObjectFactoryBean
"
>
<
property name
=
"
jndiTemplate
"
>
<
ref local
=
"
jndiTemplate
"
/>
</
property
>
<
property name
=
"
resourceRef
"
>
<
value
>
false
</
value
>
</
property
>
<
property name
=
"
jndiName
"
>
<
value
>
JMSDEMOQueue
</
value
>
</
property
>
</
bean
>
<
bean id
=
"
connectionFactory
"
class
=
"
org.springframework.jms.connection.SingleConnectionFactory
"
>
<
property name
=
"
targetConnectionFactory
"
>
<
ref bean
=
"
ConnectionFactoryBean
"
/>
</
property
>
</
bean
>
<!--<
bean id
=
"
ConnectionFactory
"
factory
-
bean
=
"
ConnectionFactoryBean
"
factory
-
method
=
"
createXAConnection
"
/>-->
<
bean id
=
"
BitronixTransactionManager
"
factory
-
method
=
"
getTransactionManager
"
class
=
"
bitronix.tm.TransactionManagerServices
"
depends
-
on
=
"
btmConfig,connectionFactory
"
destroy
-
method
=
"
shutdown
"
/>
<
bean id
=
"
transactionManager
"
class
=
"
org.springframework.transaction.jta.JtaTransactionManager
"
>
<
property name
=
"
transactionManager
"
ref
=
"
BitronixTransactionManager
"
/>
<
property name
=
"
userTransaction
"
ref
=
"
BitronixTransactionManager
"
/>
</
bean
>
<
bean id
=
"
btmConfig
"
factory
-
method
=
"
getConfiguration
"
class
=
"
bitronix.tm.TransactionManagerServices
"
>
<
property name
=
"
serverId
"
value
=
"
spring-btm-consumer
"
/>
</
bean
>
<
bean id
=
"
dataSourceFactoryBean
"
class
=
"
bitronix.tm.resource.jdbc.DataSourceBean
"
>
<
property name
=
"
className
"
value
=
"
oracle.jdbc.xa.client.OracleXADataSource
"
/>
<
property name
=
"
uniqueName
"
value
=
"
oracle
"
/>
<
property name
=
"
poolSize
"
value
=
"
2
"
/>
<
property name
=
"
driverProperties
"
>
<
props
>
<
prop key
=
"
user
"
>
cdh_dev
</
prop
>
<
prop key
=
"
password
"
>
cdh_dev
</
prop
>
<
prop key
=
"
URL
"
>
jdbc:oracle:thin:@
10.0
.
24.130
:
1521
:mixdb98
</
prop
>
</
props
>
</
property
>
</
bean
>
<
bean id
=
"
dataSource
"
factory
-
bean
=
"
dataSourceFactoryBean
"
factory
-
method
=
"
createResource
"
/>
<!--<
bean id
=
"
atomikosConnectionFactory
"
class
=
"
com.atomikos.jms.QueueConnectionFactoryBean
"
init
-
method
=
"
init
"
>
<
property name
=
"
xaQueueConnectionFactory
"
>
<
ref bean
=
"
queueConnectionFactory
"
/>
</
property
>
<
property name
=
"
resourceName
"
value
=
"
MQSeries_XA_RMI
"
/>
</
bean
>
<
bean id
=
"
connectionFactory
"
class
=
"
org.springframework.jms.connection.SingleConnectionFactory
"
>
<
property name
=
"
targetConnectionFactory
"
>
<
ref bean
=
"
atomikosConnectionFactory
"
/>
</
property
>
</
bean
>
-->
<!--<
bean id
=
"
dataSource
"
class
=
"
com.atomikos.jdbc.SimpleDataSourceBean
"
init
-
method
=
"
init
"
destroy
-
method
=
"
close
"
>
<
property name
=
"
uniqueResourceName
"
>
<
value
>
oracle
</
value
>
</
property
>
<
property name
=
"
xaDataSourceClassName
"
>
<
value
>
oracle.jdbc.xa.client.OracleXADataSource
</
value
>
</
property
>
<
property name
=
"
xaDataSourceProperties
"
>
<
value
>
user
=
cdh_dev;password
=
cdh_dev;URL
=
jdbc:oracle:thin:@
10.0
.
24.130
:
1521
:mixdb98
</
value
>
</
property
>
<
property name
=
"
exclusiveConnectionMode
"
>
<
value
>
true
</
value
>
</
property
>
<
property name
=
"
connectionPoolSize
"
value
=
"
3
"
/>
</
bean
>
-->
<!--<
bean id
=
"
atomikosTransactionManager
"
class
=
"
com.atomikos.icatch.jta.UserTransactionManager
"
init
-
method
=
"
init
"
destroy
-
method
=
"
close
"
>
<
property name
=
"
forceShutdown
"
>
<
value
>
false
</
value
>
</
property
>
</
bean
>
<
bean id
=
"
atomikosUserTransaction
"
class
=
"
com.atomikos.icatch.jta.UserTransactionImp
"
>
<
property name
=
"
transactionTimeout
"
value
=
"
300
"
/>
</
bean
>
<
bean id
=
"
transactionManager
"
class
=
"
org.springframework.transaction.jta.JtaTransactionManager
"
>
<
property name
=
"
transactionManager
"
>
<
ref bean
=
"
atomikosTransactionManager
"
/>
</
property
>
<
property name
=
"
userTransaction
"
>
<
ref bean
=
"
atomikosUserTransaction
"
/>
</
property
>
</
bean
>
-->
<
bean id
=
"
messageDao
"
class
=
"
com.sfexpress.mes_c2.dao.MessageDAO
"
>
<
property name
=
"
dataSource
"
>
<
ref bean
=
"
dataSource
"
/>
</
property
>
</
bean
>
<
bean id
=
"
dataSourceNoTx
"
class
=
"
org.springframework.jdbc.datasource.DriverManagerDataSource
"
>
<
property name
=
"
driverClassName
"
>
<
value
>
oracle.jdbc.driver.OracleDriver
</
value
>
</
property
>
<
property name
=
"
url
"
>
<
value
>
jdbc:oracle:thin:@
10.0
.
24.130
:
1521
:mixdb98
</
value
>
</
property
>
<
property name
=
"
username
"
>
<
value
>
cdh_dev
</
value
>
</
property
>
<
property name
=
"
password
"
>
<
value
>
cdh_dev
</
value
>
</
property
>
</
bean
>
<
bean id
=
"
updateMessageto
"
class
=
"
com.sfexpress.mes_c2.dao.UpdateMessageto
"
>
<
property name
=
"
dataSource
"
ref
=
"
dataSourceNoTx
"
></
property
>
</
bean
>
<
bean id
=
"
converter
"
class
=
"
com.sf.framework.integration.converter.JiBXConverter
"
/>
<
bean id
=
"
messageHandler
"
class
=
"
com.sfexpress.mes_c2.message.MessageHandler
"
>
<
property name
=
"
process
"
ref
=
"
messagetoProcess
"
/>
<
property name
=
"
converter
"
ref
=
"
converter
"
/>
</
bean
>
<
bean id
=
"
listenerContainer
"
class
=
"
org.springframework.jms.listener.DefaultMessageListenerContainer
"
>
<
property name
=
"
concurrentConsumers
"
value
=
"
10
"
/>
<
property name
=
"
connectionFactory
"
ref
=
"
connectionFactory
"
/>
<
property name
=
"
destination
"
ref
=
"
des
"
/>
<
property name
=
"
messageListener
"
ref
=
"
messageHandler
"
/>
<
property name
=
"
transactionManager
"
ref
=
"
transactionManager
"
/>
<
property name
=
"
sessionTransacted
"
value
=
"
false
"
/>
<
property name
=
"
receiveTimeout
"
value
=
"
3000
"
/>
<
property name
=
"
recoveryInterval
"
value
=
"
6000
"
/>
</
bean
>
<
bean id
=
"
messagetoProcess
"
class
=
"
com.sfexpress.mes_c2.service.MessageToProcess
"
>
<
property name
=
"
messageDao
"
ref
=
"
messageDao
"
></
property
>
</
bean
>
<
bean id
=
"
sendSms
"
class
=
"
com.sfexpress.mes_c2.send.SendSms
"
>
<
property name
=
"
sendNumEachTime
"
value
=
"
500
"
></
property
>
<
property name
=
"
resendNumLimited
"
value
=
"
5
"
></
property
>
<
property name
=
"
process
"
ref
=
"
messagetoProcess
"
></
property
>
<
property name
=
"
updateMessageto
"
ref
=
"
updateMessageto
"
></
property
>
</
bean
>
<
bean id
=
"
methodInvokingJobDetail
"
class
=
"
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
"
>
<
property name
=
"
targetObject
"
>
<
ref bean
=
"
sendSms
"
/>
</
property
>
<
property name
=
"
targetMethod
"
>
<
value
>
sendMsg
</
value
>
</
property
>
</
bean
>
<
bean id
=
"
cronTrigger1
"
class
=
"
org.springframework.scheduling.quartz.CronTriggerBean
"
>
<
property name
=
"
jobDetail
"
>
<
ref bean
=
"
methodInvokingJobDetail
"
/>
</
property
>
<
property name
=
"
cronExpression
"
>
<
value
>
0
/
30
*
08
-
21
*
*
?</
value
>
</
property
>
</
bean
>
<
bean id
=
"
cronTrigger2
"
class
=
"
org.springframework.scheduling.quartz.CronTriggerBean
"
>
<
property name
=
"
jobDetail
"
>
<
ref bean
=
"
methodInvokingJobDetail
"
/>
</
property
>
<
property name
=
"
cronExpression
"
>
<
value
>
0
5
,
10
,
15
,
20
,
25
,
30
21
*
*
?</
value
>
</
property
>
</
bean
>
<
bean
class
=
"
org.springframework.scheduling.quartz.SchedulerFactoryBean
"
>
<
property name
=
"
triggers
"
>
<
list
>
<!--
<
ref local
=
"
cronTrigger1
"
/>-->
<!--
<
ref local
=
"
cronTrigger2
"
/>-->
<!--
<
ref local
=
"
cronTriggerMonitorMQ
"
/>-->
</
list
>
</
property
>
</
bean
>
<!--
只是测试 发送消息到MQ的队列里,实际不需要
-->
<
bean id
=
"
jmsQueueConnectionFactory
"
class
=
"
org.springframework.jms.connection.SingleConnectionFactory
"
>
<
property name
=
"
targetConnectionFactory
"
>
<
ref bean
=
"
queueConnectionFactory
"
/>
</
property
>
</
bean
>
<
bean id
=
"
jmsDestinationResolver
"
class
=
"
org.springframework.jms.support.destination.JndiDestinationResolver
"
>
<
property name
=
"
jndiTemplate
"
>
<
ref bean
=
"
jndiTemplate
"
/>
</
property
>
<
property name
=
"
cache
"
>
<
value
>
true
</
value
>
</
property
>
</
bean
>
<
bean id
=
"
jmsQueueTemplate
"
class
=
"
org.springframework.jms.core.JmsTemplate
"
>
<
property name
=
"
connectionFactory
"
>
<
ref bean
=
"
jmsQueueConnectionFactory
"
/>
</
property
>
<
property name
=
"
destinationResolver
"
>
<
ref bean
=
"
jmsDestinationResolver
"
/>
</
property
>
<
property name
=
"
pubSubDomain
"
>
<
value
>
false
</
value
>
</
property
>
</
bean
>
<
bean id
=
"
jmsSender
"
class
=
"
com.sfexpress.mes_c2.test.SendMsgToMQ
"
>
<
property name
=
"
jmsTemplate
"
>
<
ref bean
=
"
jmsQueueTemplate
"
/>
</
property
>
<
property name
=
"
topicNames
"
>
<
value
>
JMSDEMOQueue
</
value
>
</
property
>
</
bean
>
<!--
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-->
<
bean id
=
"
monitorMQ
"
class
=
"
com.sfexpress.mes_c2.monitorMQ.MonitorMQ
"
>
<
property name
=
"
jmsTemplate
"
ref
=
"
jmsQueueTemplate
"
></
property
>
<
property name
=
"
destinations
"
>
<
list
>
<
ref local
=
"
des
"
/>
</
list
>
</
property
>
</
bean
>
<
bean id
=
"
c2LogDao
"
class
=
"
com.sfexpress.mes_c2.dao.C2LogDAO
"
>
<
property name
=
"
dataSource
"
ref
=
"
dataSourceNoTx
"
></
property
>
</
bean
>
<!--
发邮件
-->
<
bean id
=
"
mailSender
"
class
=
"
org.springframework.mail.javamail.JavaMailSenderImpl
"
>
<
property name
=
"
host
"
value
=
"
10.0.15.22
"
/><!--
邮件服务器地址
-->
<
property name
=
"
username
"
value
=
"
089244
"
></
property
><!--
用户名
-->
<
property name
=
"
password
"
value
=
"
089244
"
></
property
><!--
密码
-->
<!--<
property name
=
"
javaMailProperties
"
>
<
props
>
<
prop key
=
"
mail.smtp.auth
"
>
true
</
prop
>
<
prop key
=
"
mail.smtp.timeout
"
>
25000
</
prop
>
</
props
>
</
property
>
--></
bean
>
<
bean id
=
"
mailMessage
"
class
=
"
org.springframework.mail.SimpleMailMessage
"
>
<
property name
=
"
from
"
value
=
"
zhongzhenyang@sf-express.com
"
/><!--
设置发件人
-->
<
property name
=
"
subject
"
value
=
"
MQ 不行了
"
/><!--
设置主题
-->
<
property name
=
"
to
"
><!--
设置收件人
-->
<
list
>
<
value
>
zhongzhenyang@sf
-
express.com
</
value
>
</
list
>
</
property
>
</
bean
>
<
bean id
=
"
monitorMqMailImpl
"
class
=
"
com.sfexpress.mes_c2.monitorMQ.MonitorMqMailTextImpl
"
>
<
property name
=
"
mailSender
"
ref
=
"
mailSender
"
/>
<
property name
=
"
message
"
ref
=
"
mailMessage
"
/>
</
bean
>
<
bean id
=
"
monitorMQService
"
class
=
"
com.sfexpress.mes_c2.monitorMQ.MonitorMQService
"
>
<
property name
=
"
monitor
"
ref
=
"
monitorMQ
"
></
property
>
<
property name
=
"
mail
"
ref
=
"
monitorMqMailImpl
"
></
property
>
<
property name
=
"
logDao
"
ref
=
"
c2LogDao
"
></
property
>
</
bean
>
<
bean id
=
"
jobMonitorMQ
"
class
=
"
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
"
>
<
property name
=
"
targetObject
"
>
<
ref bean
=
"
monitorMQService
"
/>
</
property
>
<
property name
=
"
targetMethod
"
>
<
value
>
service
</
value
>
</
property
>
</
bean
>
<!--
设置监控mq的时间间隔
-->
<
bean id
=
"
cronTriggerMonitorMQ
"
class
=
"
org.springframework.scheduling.quartz.CronTriggerBean
"
>
<
property name
=
"
jobDetail
"
>
<
ref bean
=
"
jobMonitorMQ
"
/>
</
property
>
<
property name
=
"
cronExpression
"
>
<
value
>
0
/
30
*
*
*
*
?</
value
>
</
property
>
</
bean
>
</
beans
>
posted on 2008-10-27 17:01
晓宇
阅读(2404)
评论(0)
编辑
收藏
所属分类:
J2EE
新用户注册
刷新评论列表
只有注册用户
登录
后才能发表评论。
网站导航:
博客园
IT新闻
Chat2DB
C++博客
博问
相关文章:
SPRING整合IBMMQ实现全局事物
JMS基础
JMS
Powered by:
BlogJava
Copyright © 晓宇