1 Reply Latest reply on Mar 25, 2012 5:40 PM by vishal_changrani

    sql-listener causing extremely frequent queries on database (once every 50millisec)

    vishal_changrani

      Hi,

      Following is my jboss-esb.xml (ESB version 4.9) For some unknown reason the sql-listener (TxHelloSQLChannel) causes extremely frequent SQL queries being sent to the database server. Upon some investigation through the source code I realize that a "MessageAwareListener" class is created for this listener (maybe since I have not set is-gateway to true). This MessageAwareListener class has a run() method which runs once every 50 milliseconds as hardcoded in the _pauseLapseInMillis variable. It doesnt honor the schedule-frequency that I specify in the xml. Also another strange thing I observe is the my SqlGatewayListener class is not initalized for this listener (is that becuase this is not a gateway sql-listener). For the other listner 'helloSQLChannel' it is instatiated and it honors the schedule frequency.

      Finally I got the ESB source code but I cannot get the package xbeanmodel.impl. Are these suppose to be downloaded from somewhere else? (they are coming from the jar jbossesb-config-model-1.0.1.jar).

      Thanks in advance for all your help/comments.

       

      <?xml version="1.0"?>

      <jbossesb parameterReloadSecs="5"

      xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">

      <providers>

        <jms-provider connection-factory="ConnectionFactory" name="JBossMQ">

         <jms-bus busid="ftpGwChannel">

          <jms-message-filter dest-name="queue/ftptstv_gw" dest-type="QUEUE"/>

         </jms-bus>

         <jms-bus busid="ftpEsbChannel">

          <jms-message-filter dest-name="queue/ftptstv_esb" dest-type="QUEUE"/>

         </jms-bus>

         <jms-bus busid="quickstartEsbChannel">

          <jms-message-filter

           dest-name="queue/quickstart_sql_action_Request_esb"

           dest-type="QUEUE" selector="source='fromHelloworldSQLAction'"/>

         </jms-bus>

        </jms-provider>

        <fs-provider name="FSprovider">

         <fs-bus busid="FtpChannel">

          <fs-message-filter directory="${esb.ftpwatchdir}"

           error-delete="false" error-directory="${esb.error}"

           error-suffix=".IN_ERROR" input-suffix=".dat" post-delete="true"

           post-directory="${esb.sent}" post-suffix=".sentToEsb" work-suffix=".esbWorking"/>

         </fs-bus>

        </fs-provider>

        <sql-provider datasource="java:/myDB" name="GatewaySQLprovider" url="${esb.oracleurl}">

         <sql-bus busid="helloSQLChannel">

          <sql-message-filter insert-timestamp-column="TIMESTAMP_COL"

           message-column="DATA_COLUMN" message-id-column="UNIQUE_ID"

           order-by="DATA_COLUMN" post-delete="false"

           status-column="STATUS_COL" tablename="export_gateway" where-condition="DATA_COLUMN like 'data%'"/>

         </sql-bus>

        </sql-provider>

        <sql-provider datasource="java:/myDB" name="SQLprovider" url="${esb.oracleurl}">

         <sql-bus busid="TxHelloSQLChannel">

          <sql-message-filter insert-timestamp-column="TIMESTAMP_COL"

           message-column="DATA_COLUMN" message-id-column="MESSAGE_ID"

           status-column="STATUS_COL" tablename="TX_ESB_MESSAGES"/>

         </sql-bus>

        </sql-provider>

      </providers>

      <services>

        <service category="FtpServiceESB" description="Ftp service" name="FtpListener">

         <listeners>

          <jms-listener busidref="ftpGwChannel" is-gateway="true" name="JMS-Gateway"/>

          <jms-listener busidref="ftpEsbChannel" name="quickstart"/>

          <fs-listener busidref="FtpChannel" is-gateway="true"

           name="FtpGateway" poll-frequency-seconds="10">

           <property name="mimeType" value="text/plain"/>

           <property name="encoding" value="UTF-8"/>

          </fs-listener>

         </listeners>

         <actions mep="OneWay">

          <action class="org.jboss.soa.esb.actions.SystemPrintln" name="actionq2">

           <property name="message"/>

          </action>

          <action class="org.jboss.soa.esb.smooks.SmooksAction" name="simple-transform">

           <property name="smooksConfig" value="/smooks-res.xml"/>

          </action>

          <action class="org.jboss.soa.esb.actions.Notifier" name="notificationAction1">

           <property name="okMethod" value="notifyOK"/>

           <property name="notification-details">

            <NotificationList type="ok">

             <target class="NotifyConsole"/>

            </NotificationList>

            <NotificationList type="OK" xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">

             <target class="NotifyFTP">

              <ftp

               URL="ftp://${esb.ftpuser}:${esb.ftpuserpw}@${esb.ftpserver}/" filename="${esb.ftpfilename}"/>

             </target>

            </NotificationList>

           </property>

          </action>

         </actions>

        </service>

        <service category="SQLServiceESB"

         description=" TX SQL Action (esb jdbc listener)" name="myTxListener">

         <listeners>

             <sql-listener busidref="helloSQLChannel" is-gateway="true"

           name="SqlGateway" schedule-frequency="${esb.demandInterval}"/>

          <sql-listener busidref="TxHelloSQLChannel" name="TxSqlListener" schedule-frequency="${esb.demandInterval}">

           <property name="transacted" value="false"/>

          </sql-listener>

         </listeners>

         <actions mep="OneWay">

          <action class="com.tandbergtv.tstv.rcs.esb.MyAction" name="action1" process="displayMessage1"/>

         </actions>

        </service>

      </services>

      </jbossesb>

       

       

      PS: the esb.demandInterval and other values are coming from the properties-service.xml. Am sure via debugging that the values are picked up correctly and even if they are not the default is 10seconds but the query is happening way more frequently than 10 seconds