4 Replies Latest reply on Aug 7, 2009 5:11 PM by Mac Ferguson

    Is it possible to change the name of the message table in th

    Mac Ferguson Newbie

      is it possible to change the name of the 'message' table in the message store (I need to capitalize and add a prefix to make my DBA happy)?

        • 1. Re: Is it possible to change the name of the message table i
          Daniel Bevenius Master

          Hi,

          depending on the database you are using you can modify:

          jbossesb.esb/message-store-sql/<database-name>/create_database.sql


          Regards,

          /Daniel

          • 2. Re: Is it possible to change the name of the message table i
            Mac Ferguson Newbie

             

            "beve" wrote:
            Hi,

            depending on the database you are using you can modify:
            jbossesb.esb/message-store-sql/<database-name>/create_database.sql


            Regards,

            /Daniel


            Of course, but how will DBMessageStoreImpl recognize that the table name has changed when it is storing/retrieving messages? There must be some basic SQL generation or even hard coded statements in the code.

            Perhaps I'll do some repository browsing...

            Thanks for your reply Daniel!

            • 3. Re: Is it possible to change the name of the message table i
              Daniel Bevenius Master

               

              Of course, but how will DBMessageStoreImpl recognize that the table name has changed when it is storing/retrieving messages?

              The default name is 'message' but this can be configured in jbossesb.sar/jbossesb-properties.xml by setting the property 'org.jboss.soa.esb.persistence.db.table'.
              For example:
              <properties name="dbstore">
               <property name="org.jboss.soa.esb.persistence.db.table" value="MESSAGE"/>
              ...
              </properties>


              Can you give that a try?

              Regards,

              /Daniel

              • 4. Re: Is it possible to change the name of the message table i
                Mac Ferguson Newbie

                 

                "beve" wrote:


                Can you give that a try?

                Regards,

                /Daniel


                Thanks for the pointer, I changed the property to reference the table name 'ESB_MESSAGE' and as it turned out I also needed to re-configure the MessageStoreDatabaseInitializer MBean in /deploy/jbossesb.esb/jbossesb-service.xml as follows:

                <server>
                 <mbean code="org.jboss.internal.soa.esb.dependencies.DatabaseInitializer"
                 name="jboss.esb:service=MessageStoreDatabaseInitializer">
                 <attribute name="Datasource">java:/JBossESBDS</attribute>
                 <attribute name="ExistsSql">select count(*) from ESB_MESSAGE</attribute>
                 <attribute name="SqlFiles">
                 message-store-sql/mssql/create_database.sql
                 </attribute>
                 <depends>jboss.jca:service=DataSourceBinding,name=JBossESBDS</depends>
                 </mbean>
                </server>


                Prior to that it was using the wrong sqlExists test and trying to initialize the database from the hsql folder. now it workls like a charm.