Configuring JBoss AS 5 JMS for MySQL

Configuring JBoss AS 5 JMS for MySQL

To round-out the JBoss AS 5 clustering stuff, I figured I'd add a little how-to for configuring JMS to use MySQL.

This is covered in the docs, but what the hell (the example DS config files leaves out transaction stuffs, which produces an warning like this: DataSource connection transaction isolation should be READ_COMMITTED, but it is currently REPEATABLE_READ.).

{jbossdir} = your jboss dir {serverdir} = your server dir {jbossdir}/server/{serverdir}

Firstly, create a mysql datasource file:{serverdir}/deploy/mysql-ds.xml

Fill it with something along these lines:

<local-tx-datasource>
<jndi-name> DefaultDS</jndi-name>
<connection-url> jdbc:mysql://yourMySQLhost:3306/jbossjms</connection-url>
<driver-class> com.mysql.jdbc.Driver</driver-class>
<user-name> yourUsername</user-name>
<password> yourUserPassword</password>
<exception-sorter-class-name> org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
    <transaction-isolation> TRANSACTION_READ_COMMITTED</transaction-isolation>
<min-pool-size> 5</min-pool-size>
<max-pool-size> 20</max-pool-size>
<idle-timeout-minutes> 0</idle-timeout-minutes>
<metadata>
<type-mapping> mySQL</type-mapping>
</metadata>
</local-tx-datasource>

Delete the {serverdir}/deploy/hsqldb-ds.xml file.

Then delete the {serverdir}/deploy/messaging/hsqldb-persistence-service.xml file.

Copy {jbossdir}/docs/examples/jms/mysql-persistence-service.xml file to {serverdir}/deploy/messaging/mysql-persistence-service.xml.

If you're using clustering, be sure to set Clustered to true in mysql-persistence-service.xml.

Um, guess that's it.

 

轉自:http://coldshen.com/blog/index.cfm/2009/3/8/Configuring-JBoss5-JMS-for-MySQL

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值