<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Knight of the round table

    wansong

    jboss JMS clustering

    http://community.jboss.org/wiki/JMSClusteringByExample

    http://community.jboss.org/wiki/JBossHA

    http://docs.jboss.org/jbossas/getting_started/v4/html/mdb.html
    http://carter.zhmy.com/archives/2007/112108.html


    Computer A:
    $ cd $JBOSS_HOME/bin
    $ ./run.sh -c all -b 192.168.0.143 -Djboss.messaging.ServerPeerID=1

    Computer B:
    $ cd $JBOSS_HOME/bin
    $ ./run.sh -c all -b 192.168.0.210 -Djboss.messaging.ServerPeerID=2


    It is necesary to give an ID to each server and this is accomplished with this directive:
    -Djboss.messaging.ServerPeerID

    When you start the jboss on computer A, you should see the logs (server.log) telling you that there is one node ready and listening, and once you start the jboss on computer B, on the log will appear the two nodes, the two IP's ready to consume messages.

    5) Now it's time to send a Message to the Queue. To accomplish this it's necessary to change the connection factory to "ClusteredConnectionFactory" (JMSDispatcher.java - See the code below).
    Also on the jndi.properties (if you are using the default InitialContext) file it's necessary to add the two computers ip's separated by comma to the java.naming.provider.url property. (In my case a create a Properties variable and I set all the necessary properties, JMSDispatcher.java - see the code below).

     

    java.naming.provider.url=192.168.0.143:1099,192.168.0.210:1099

    The client that I wrote is a web application, that consist in one index.jsp page, which contains a form that prompts you for the name of the queue, the type of messaging (Queue or Topic), the server ip and port, how many times it will send the message and the actual message to be sent; also the web application has a Servlet (JMSClusteredClient.java - see code below) that receives the postback and helper class (JMSDispatcher.java - see code below) that sends the message to the jboss servers.  You can to deploy it in any computer. In my case I deployed it on the Computer A. And you can access it through this URL: http://192.168.0.143:8080/JMSWeb/ (just modify the IP where the client war was deployed).If you notice (on the index.jsp - code below) I've already put some default values that reflects the name of the Queue, and the IP's of my two computers. Now, If you increment the number of times that the message will be sent (maybe a 10) and fill out the message box, and click "Send" you should see on the two servers some of the messages being consumed by the MDB.

    posted on 2011-09-15 19:48 w@ns0ng 閱讀(329) 評(píng)論(0)  編輯  收藏 所屬分類: jbossDistributed & Cluster

    主站蜘蛛池模板: 亚洲黄色免费在线观看| 日韩精品福利片午夜免费观着| 国产国产人免费人成免费视频 | 国产成人亚洲精品青草天美| 羞羞漫画页面免费入口欢迎你| 麻豆成人精品国产免费| 中文字幕精品三区无码亚洲| 免费下载成人电影| 亚洲小说图片视频| 国产精品成人免费一区二区| 99亚偷拍自图区亚洲| 成人免费看吃奶视频网站| 亚洲最大无码中文字幕| 又黄又大又爽免费视频| 一级一级一片免费高清| 亚洲色中文字幕无码AV| 久久国产乱子伦精品免费不卡 | 亚洲一区二区三区无码影院| 国产免费久久精品丫丫| 久久亚洲精品无码| 18勿入网站免费永久| 国产精品亚洲专区无码牛牛| 亚洲成?Ⅴ人在线观看无码| 成年女人A毛片免费视频| 亚洲欧洲精品国产区| 精品剧情v国产在免费线观看| 羞羞网站免费观看| 久久亚洲免费视频| 成人免费一区二区无码视频| 深夜a级毛片免费无码| 亚洲国产精品一区二区第一页 | 99爱在线精品视频免费观看9| 一级视频免费观看| 亚洲av无码成h人动漫无遮挡 | 国产美女视频免费观看的网站| 亚洲AV无码成人精品区蜜桃| 噜噜嘿在线视频免费观看| 精品一区二区三区高清免费观看 | 成人毛片免费观看视频| 一级毛片免费全部播放| 亚洲综合图片小说区热久久|