No announcement yet.

detect increase in table size

  • Filter
  • Time
  • Show
Clear All
new posts

  • detect increase in table size


    I'm currently learning about mirth. I've gone through a few simple examples and now I want to do the following use case.

    - use a database reader to get the size of a table (using select count(*) from mytable)
    - check if that table increased in size (filter count against previous count saved in as a global var)
    - if there is a new record in the database, notify a web service.

    Problem is, I'm in fact stuck on step one!
    select * from mytable works, but count(*) doesn't.

    I get the following error in the System Events window:
    org.mule.umo.routing.RoutingException: Failed to transform message before applying the filter. Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.webreach.mirth .server.mule.providers.[email protected], endpointUri=jdbc://query, transformer=Transformer{name='ResultMapToXML', returnClass=false, returnClass=false, sourceTypes=[class java.util.HashMap]}, name='_jdbcEndpoint#70137697', type='receiver', properties={}, transactionConfig=org.mule.impl.MuleTransactionCon [email protected], filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: org.apache.commons.dbutils.BasicRowProcessor$CaseI nsensitiveHashMap
    at org.mule.routing.inbound.SelectiveConsumer.isMatch (
    at org.mule.routing.inbound.InboundMessageRouter.rout e(
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(
    at com.webreach.mirth.server.mule.providers.jdbc.Jdbc MessageReceiver.processMessage(JdbcMessageReceiver .java:149)
    at org.mule.providers.TransactedPollingMessageReceive r$MessageProcessorWorker.doInTransaction(Transacte
    at org.mule.transaction.TransactionTemplate.execute(T
    at org.mule.providers.TransactedPollingMessageReceive r$
    at .java:290)
    at eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at eadPoolExecutor$ :675)
    Caused by: org.mule.umo.transformer.TransformerException: Failed to parse result map
    at com.webreach.mirth.server.mule.transformers.Result MapToXML.doTransform(
    at org.mule.transformers.AbstractTransformer.transfor m(
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule
    at org.mule.routing.inbound.SelectiveConsumer.isMatch (
    ... 12 more


    Any ideas what this is about?

    Thanks alot!

    Kristof Taveirne

  • #2
    Re:detect increase in table size

    When I do the query from javascript in my database reader, I get the following exception:

    org.mule.config.ConfigurationException: Failed to parse configuration resource "C:\\Program Files\\Mirth\\conf\\mule-config.xml" (org.mule.config.ConfigurationException)
    at er.configure(
    at com.webreach.mirth.server.Mirth.startMule(Mirth.ja va:178)
    at com.webreach.mirth.server.Mirth.restartMule(Mirth. java:160)
    at )
    Caused by: org.mule.config.ConfigurationException: Failed to parse configuration resource "C:\\Program Files\\Mirth\\conf\\mule-config.xml"
    at tion.process( 1)
    at er.configure(
    at er.configure(
    ... 3 more
    Caused by: org.mule.umo.lifecycle.InitialisationException: Initialisation Failure: missing } after function body (d19f38cc-bafc-4cc3-afed-f54f8fcb80a8#11)
    at org.apache.commons.digester.Digester.createSAXExce ption(
    at org.apache.commons.digester.Digester.createSAXExce ption(
    at org.apache.commons.digester.Digester.endElement(Di
    at tSAXParser.endElement(Unknown Source)
    at tFragmentScannerImpl.scanEndElement(Unknown Source)
    at tFragmentScannerImpl$FragmentContentDispatcher.dis patch(Unknown Source)
    at tFragmentScannerImpl.scanDocument(Unknown Source)
    at nfiguration.parse(Unknown Source)
    at nfiguration.parse(Unknown Source)
    at er.parse(Unknown Source)
    at tSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digeste
    at tion.process( 9)
    ... 5 more


    What I'm having now is a very basic channel.
    database reader and file writer. No filters, no transformation.
    Just select count(*) from patients as the SQL statement.

    I must be doing something wrong, because this is so basic, can't imagine where I could have made a mistake.

    Any ideas?


    PS: mirth config is in attachement
    mule_config-5911d9d60d1349b18744637d3bf1b5af.xml (8935 bytes)


    • #3
      Re:detect increase in table size

      Try with a column name like,

      SELECT Count(*) AS CurRecCount FROM Patients

      Hope it helps!


      • #4
        Re:detect increase in table size

        Great, it works!
        Thanks alot!

        Kristof Taveirne