Why DB response ( resultSets) are being divided in two splits in Mule ESB

前提是你 提交于 2019-12-25 01:32:59

问题


I'm querying DB to get the response through Mule. Response are being populated, but not sure why it is being divided inside resultSet1 (if it is larger).

Could see here in logger, ResultSet1 end tag is </custo ( not completly finished as ), it is being extended with same Key(XML_F5RYI-11YTR) and there it is finished mers>.

  1. Do I need to do any configuration settings in Mule DB level to propogate all the resultSet1 in same level ?
  2. Actually My ultimate aim is to extract the resultSet1, second logger MEL is extracting, but it not a complete ResultSet.Could you please suggest an MEL dynamically to extract the ResultSet1 Complete payload.

Else suggest me how can I achieve the scenario.

Please find the message printed in logger

 DB Actual response:{updateCount1=4,resultSet1=[{XML_F5RYI-11YTR=<Customers><Customer1>John<Customer1>( removed multiple customers tags)<Customer6>Ganesh<Customer6></Custo},{XML_F5RYI-11YTR=mers>}],resultSet2[{SequenceNumber=94}],updateCount2=1, updateCount3=4}

Please find the config xml

<poll doc:name="Poll">
        <fixed-frequency-scheduler frequency="10" timeUnit="SECONDS"/>
        <db:stored-procedure config-ref="SCC_DB" doc:name="Database">
            <db:parameterized-query><![CDATA[{call [Database Query here](1)}]]></db:parameterized-query>
        </db:stored-procedure>
    </poll>
    <logger message="DB Actual response:#[payload]" level="INFO" doc:name="Logger"/>
    <logger message="Extracted ResultSet1 Response:************#[payload.resultSet1[0]['XML_F5RYI-11YTR']]********" level="INFO" doc:name="Logger"/>

Mule Version : 3.5.1

Please suggest where I'm wrong. Thanks for your help in advance.

Edited:

I have enabled Streaming = 'true' and Made Fetch Count = '10'. If I enabled Streaming, response propagated after DB as below

****  DB response:org.mule.module.db.internal.result.statement.CloseableMap@558351f4*****

After adding Transformer 'Byte Array to string', response as below

  **After Transformer:{updateCount1=0, resultSet1=org.mule.module.db.internal.result.resultset.ResultSetIterator@64df82c7, resultSet2=org.mule.module.db.internal.result.resultset.ResultSetIterator@e030a8e}**********

I have tried separating #[payload.resultSet1] in set Payload, even after I'm not able to provide the transformer to see the exact response. Could you please suggest the transformer to see the response of resultSet1.


回答1:


The doc says this:

Fetch Size - Indicates how many rows should be fetched from the resultSet. This property is required when streaming is true, the default value is 10.

Try setting this to the maximum size you expect.




回答2:


Have you tried adding an dom to xml and you can use a collection aggregator to join the splits



来源:https://stackoverflow.com/questions/28551591/why-db-response-resultsets-are-being-divided-in-two-splits-in-mule-esb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!