0 Replies Latest reply on Jan 6, 2010 10:00 AM by Angus Morison

    test

    Angus Morison Newbie
      The above contribution lost a few (rather critical) bits of XML. Hopefully i will do a little better (though I am not all all sure)
      *JBoss Messaging Null Persistence Service* 
      *Purpose:* To disable the Database Persistence Policy and introducing Null Persistence Service.
      *Step 1:* we have to delete the existing {color:green}\server\default\deploy\messaging\hsqldb-persistence-service.xml{color}.
      *Step 2:* delete the following *messaging* security policy from the {color:green}\server\default\deploy\messaging\messaging-jboss-beans.xml{color} file
      {code:xml}
         <!-- messaging application-policy definition -->
         <application-policy xmlns="urn:jboss:security-beans:1.0" name="messaging">
            <authentication>
               <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
                  <module-option name="unauthenticatedIdentity">guest</module-option>
                  <module-option name="dsJndiName">java:/DefaultDS</module-option>
                  <module-option name="principalsQuery">SELECT PASSWD FROM JBM_USER WHERE USER_ID=?</module-option>
                  <module-option name="rolesQuery">SELECT ROLE_ID, 'Roles' FROM JBM_ROLE WHERE USER_ID=?</module-option>
               </login-module>
            </authentication>
         </application-policy>
      {code}
      *Step 3:* Include the messaging policy in the {color:green}\server\default\conf\login-config.xml{color} file as the follows,
      {code:xml}
            <!-- A template configuration for messaging. This
      defaults to the UsersRolesLoginModule the same as other and should be
      changed to a stronger authentication mechanism as required.
      -->
      <application-policy name="messaging">
      <authentication>
      <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
      <module-option name = "unauthenticatedIdentity">guest</module-option>
      <module-option name="usersProperties">props/messaging-users.properties</module-option>
      <module-option name="rolesProperties">props/messaging-roles.properties</module-option>
      </login-module>
        </authentication>
      </application-policy>
      {code}
      And also place the following properties files in the directory {color:green}\server\default\conf\props{color}
      {code}
      1. messaging-users.properties
      ------------------------------
      #
      # user=password
      #
      guest=guest
      2. messaging-roles.properties
      -------------------------------
      #
      # user=role1,role2,...
      #
      guest=guest
      {code}
      *Step 4:* Place the null-persistence-service.xml file with the following contents under the directory {color:green}\server\default\deploy\messaging{color}
      {code:xml}
      <?xml version="1.0" encoding="UTF-8"?>
      <!--
           Null persistence config.
          
           Use this if you don't actually want to persist anything
          
           $Id$
      -->
      <server>
         <!-- Persistence Manager MBean configuration
             ======================================== -->
         <mbean code="org.jboss.messaging.core.jmx.NullPersistenceManagerService"
            name="jboss.messaging:service=PersistenceManager"
            xmbean-dd="xmdesc/NullPersistenceManager-xmbean.xml"/>
          
         <!-- Messaging Post Office MBean configuration
              ========================================= -->
         <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
            name="jboss.messaging:service=PostOffice"
            xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
        <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
           
            <!-- The name of the post office -->
            <attribute name="PostOfficeName">JMS post office</attribute>
          
            <!-- This post office is clustered. If you don't want a clustered post office then set to false -->
            <attribute name="Clustered">false</attribute>
         </mbean>
         <!-- Messaging JMS User Manager MBean config
              ======================================= -->
         <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
            name="jboss.messaging:service=JMSUserManager"
            xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
          <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
      </mbean>
      </server>
      {code}