Announcement Announcement Module
Collapse
No announcement yet.
How to continue the process if the xpath splitter expression evaluation fails Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to continue the process if the xpath splitter expression evaluation fails

    I have configured the cascade of splitters as shown below:
    HTML Code:
    <int:chain  input-channel="PQCaseInquiry-AWD-GROUP-MEMBER-PROVIDER-PQCALLISSLOOKUP-Execute"  output-channel="Aggregate-Cases-Channel" >
    <int-xml:xpath-splitter >
            <int-xml:xpath-expression expression="//folder"/>
            </int-xml:xpath-splitter>
            
            <!-- split the cases -->
           <int-xml:xpath-splitter >
            <int-xml:xpath-expression expression="//case"/>
            </int-xml:xpath-splitter>
              
            <int-jdbc:stored-proc-outbound-gateway
                           ............................        
    </int-jdbc:stored-proc-outbound-gateway>
          
              </int:chain>
    For any reason if the second xpath splitter fails in evaluating(//case) the expression i.e if no case is found, still I want to continue with another folder(//folder) split by the first xpath splitter. Can anybody help on this? Thanks in advance.

  • Ashok.N
    replied
    Artem,
    Sorry for the late reply. I was on vacation for couple of days. Thank you very much for your support. At last I could able to complete the task by adding a filter as you said. Once again, Thanks for your wonderful support.

    Leave a comment:


  • Artem Bilan
    replied
    Well...
    Since your "folder" might not contain "cases", there is no need to try to split it and work out with "error compensation".
    Just use "filter" to check if "//folder/cases" and discard that folder just to the Aggregate-Folders-Channel.

    I think that's all.

    Leave a comment:


  • Ashok.N
    replied
    Artem,
    I found one interesting thing now. The following are my observations after investigation:
    1) There are three folders among which the first folder have the cases.
    2)For the first folder, the message is reaching the "Aggregate-Folders-Channel" from "Aggregate-Cases-Channel" since the folder has some cases
    3)The second folder message reaches "Aggregate-Cases-Channel" and from there it goes to splitErrorChannel since there are no cases for the folder.
    4)The third folder message also reaches "Aggregate-Cases-Channel" and from there it goes to splitErrorChannel since there are no cases for the folder.

    Here, the problem is after completing all the folders, the poller is waiting for one more folder. So the execution is hung by waiting for another folder indefinitely.
    So, Could you please provide an idea on how to deal with this situation.
    Last edited by Ashok.N; May 22nd, 2014, 09:06 AM.

    Leave a comment:


  • Artem Bilan
    replied
    I don't think so:
    HTML Code:
    <int:transformer input-channel="splitErrorChannel" output-channel="Aggregate-Cases-Channel" method="handleErrors" ref="msgHandler"/>
    Since you have an issue with <int-xml:xpath-expression expression="//case"/>, it is a responsibility of "Folder" message.
    So, that "Error" transformer should send "compensation" message to the Aggregate-Folders-Channel

    Leave a comment:


  • Ashok.N
    replied
    Thanks Artem. I am so thankful to you for your help. If we can solve the issue I am facing, we are planning to use spring integration for the migration of huge legacy code.

    I see one incorrect point: HTML Code:

    <int:error-channel expression="headers.originalErrorChannel"/>
    OK. I have removed that.
    But if you have an issue with the splitter on <int-xml:xpath-expression expression="//case"/> it should send its error to thesplitErrorChannel.
    So, try change to this: HTML Code:

    <int:chain input-channel="queueChannel" output-channel="queueChannelTwo"> <intoller fixed-delay="5000" error-channel="splitErrorChannel"/> .... <int:chain input-channel="queueChannelTwo" output-channel="Aggregate-Cases-Channel"> <intoller fixed-delay="5000" error-channel="nullChannel"/> ...
    This time the control is going to handleErrors() method defined in the transformer. But, unfortunately, even now the message is not reaching the final channel "PQCaseInquiry-XsltTransformOutputChannel-Final-Transformation". The execution is hung after executing handleErrors() method couple of times.
    Here is the modified code:
    HTML Code:
    <int:chain  input-channel="Build-Response-After-PQCLKUP-Response-Aggregation"  output-channel="queueChannel" >
           <int:service-activator ref="msgHandler" method="buildMessageFromExtSysResponse" />
           
           <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Format-response-StageOne}"  />
           <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Format-response-StageTwo}"  />
           
            <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="${headerNames.originalPayload}" expression="payload" />
                <int:header name="originalErrorChannel" expression="headers.errorChannel" />
    
            </int:header-enricher>    
            <int:header-filter header-names="errorChannel"/>
            <!-- Split the Folders-->
            <int-xml:xpath-splitter >
            <int-xml:xpath-expression expression="//folder"/>
            </int-xml:xpath-splitter>
        </int:chain>
            
            <int:channel id="queueChannel">
            <int:queue capacity="25"/>
            </int:channel>
        
        <int:chain  input-channel="queueChannel"  output-channel="queueChannelTwo" >
            <int:poller  fixed-delay="5000" error-channel="splitErrorChannel" />
            <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="folderInfo" expression="payload" />
            </int:header-enricher> 
                
            <int-xml:xpath-splitter  >
            <int-xml:xpath-expression expression="//case"/>
            </int-xml:xpath-splitter>
        </int:chain>
            
            <int:channel id="queueChannelTwo">
            <int:queue capacity="25"/>
            </int:channel>
        
        <int:chain  input-channel="queueChannelTwo"  output-channel="Aggregate-Cases-Channel" >
            <int:poller  fixed-delay="5000" error-channel="nullChannel" />
            
             <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="${headerNames.originalPayload}" expression="payload" />
                <!-- <int:error-channel expression="headers.originalErrorChannel" />  --> 
            </int:header-enricher> 
               
            <int-jdbc:stored-proc-outbound-gateway
                            auto-startup="true"
                            data-source="routingDataSource"
                            stored-procedure-name="${PQCaseInquiry.storedProcedureName.pqcallisslookup}"
                            skip-undeclared-results="true"
                            ignore-column-meta-data="true"  
                            use-payload-as-parameter-source = "false"
                            expect-single-result="true" >
                                    
                                    <int-jdbc:sql-parameter-definition name="P_CDATTIM" direction="IN" type="VARCHAR" />
                                    <int-jdbc:sql-parameter-definition name="P_CRECORDCD" direction="IN" type="VARCHAR" />
                                    <int-jdbc:sql-parameter-definition name="P_CCRNODE" direction="IN" type="VARCHAR" />
                                    
                                    <int-jdbc:parameter name="P_CDATTIM" expression="#xpath(payload, '//CRDATTIM')" />
                                    <int-jdbc:parameter name="P_CRECORDCD" expression="#xpath(payload, '//RECORDCD')" />
                                    <int-jdbc:parameter name="P_CCRNODE" expression="#xpath(payload, '//CRNODE')" />
                                    
                    <int-jdbc:returning-resultset name="rowMapper" row-mapper="com.dsths.cs.awd.utils.ResultSetRowMapper"/>
            </int-jdbc:stored-proc-outbound-gateway>
          
          <int:service-activator ref="msgHandler" method="buildMessageFromExtSysResponse" />
          <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Merge-All-Issues}"  />
        
        </int:chain>
        
            <!-- Service Activator to handle the errors -->    
             <int:transformer input-channel="splitErrorChannel" output-channel="Aggregate-Cases-Channel" method="handleErrors" ref="msgHandler"/>
            
          <int:aggregator input-channel="Aggregate-Cases-Channel" output-channel="Aggregate-Folders-Channel"
                            ref="xmlAggregator"  method="aggregateCases">         
            </int:aggregator>    
        
            <int:aggregator input-channel="Aggregate-Folders-Channel" output-channel="PQCaseInquiry-XsltTransformOutputChannel-Final-Transformation"
                            ref="xmlAggregator"  method="aggregateFolders">         
            </int:aggregator>    
     
         <int:chain input-channel="PQCaseInquiry-XsltTransformOutputChannel-Final-Transformation">
           
            <int:service-activator ref="msgHandler" method="buildMessageFromExtSysResponseTest" />
        
            <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Format-Response-Stage-One}" />
        
            <int:service-activator ref="msgHandler"  method="enrichPayloadXml"  />
            
            <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Format-Final-Response}" />
        </int:chain>    
    Please help me in figuring out the issue.

    Leave a comment:


  • Artem Bilan
    replied
    I see one incorrect point:
    HTML Code:
    <int:error-channel expression="headers.originalErrorChannel"/>
    You do it in wrong place: first of of you mark poller with error-channel="splitErrorChannel", but right after that you populate error-channel header.
    If you want to send message to the splitErrorChannel from that sub-flow you shouldn't populate error-channel header.

    From other side we talked with you that your issue is around <int-xml:xpath-expression expression="//case"/> splitter. So his poller should be with error-channel="splitErrorChannel". Then it will be correct to restore error-channel header in the second poller <chain>.

    By logic of your flow it should be exactly as I say:
    HTML Code:
    <int:chain input-channel="queueChannelTwo" output-channel="Aggregate-Cases-Channel">
            <int:poller fixed-delay="5000" error-channel="splitErrorChannel"/>
    Sends reply to the Aggregate-Cases-Channel. The same does:
    HTML Code:
    <int:transformer input-channel="splitErrorChannel" output-channel="Aggregate-Cases-Channel" method="handleErrors"
                         ref="msgHandler"/>
    But if you have an issue with the splitter on <int-xml:xpath-expression expression="//case"/> it should send its error to the splitErrorChannel.
    So, try change to this:
    HTML Code:
    <int:chain input-channel="queueChannel" output-channel="queueChannelTwo">
            <int:poller fixed-delay="5000" error-channel="splitErrorChannel"/>
    ....
    
    <int:chain input-channel="queueChannelTwo" output-channel="Aggregate-Cases-Channel">
            <int:poller fixed-delay="5000" error-channel="nullChannel"/>
    ...

    Leave a comment:


  • Ashok.N
    replied
    Artem,
    I am just curious, is there any thing wrong with my configuration?

    Leave a comment:


  • Ashok.N
    replied
    The configuration file
    Code:
        <beans.....
    
            <int:channel id="PQCaseInquiry-InputChannel" />
        <int:channel id="PQCaseInquiry-InputChannel" />
        <int:chain input-channel="PQCaseInquiry-InputChannel" output-channel="PQCaseInquiry-AWD-Router">
            <!-- Split the Search Request Params from Xml  -->
            <int-xml:xpath-splitter>
                <int-xml:xpath-expression expression="//PQCaseInquiry"  namespace-map="xmlMessageNamespace" />
            </int-xml:xpath-splitter>
            
            <!-- Store the original payload in header for future purpose -->
            <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="${headerNames.originalPayload}" expression="payload" />
            </int:header-enricher>  
        </int:chain>                
        
            <!-- The following router deligates the input to the appropriate channel based on the FOLDTYPE value  --> 
         <int:router input-channel="PQCaseInquiry-AWD-Router" expression="#xpath(payload, '//FOLDTYPE')">
            <int:mapping value="GROUP" channel="PQCaseInquiry-AWD-GROUP-MEMBER-PROVIDER-Channel"/>
        </int:router>
        <int:channel id="PQCaseInquiry-AWD-GROUP-MEMBER-PROVIDER-Channel"/>
        <!-- Get all the folders based on the FOLDTYPE and FOLDERID -->
        <int:chain  input-channel="PQCaseInquiry-AWD-GROUP-MEMBER-PROVIDER-Channel"  output-channel="PQCaseInquiry-AWD-GROUP-MEMBER-PROVIDER-PQCLKUP-Execute" >
           <int:service-activator ref="msgHandler" method="buildRequestBasedDataSource" />
            <int-jdbc:stored-proc-outbound-gateway
                            auto-startup="true"
                            data-source="routingDataSource"
                            stored-procedure-name="${PQCaseInquiry.storedProcedureName.pqflist}"
                            skip-undeclared-results="true"
                            ignore-column-meta-data="true"  
                            use-payload-as-parameter-source = "false"
                            expect-single-result="true">
                                    
                                    <int-jdbc:sql-parameter-definition name="P_FOLDTYPE" direction="IN" type="VARCHAR" />
                                    <int-jdbc:sql-parameter-definition name="P_FOLDERID" direction="IN" type="VARCHAR" />
                                
                                    <int-jdbc:parameter name="P_FOLDTYPE" expression="#xpath(payload, '//FOLDTYPE')" />
                                    <int-jdbc:parameter name="P_FOLDERID"  expression="#xpath(payload,'//FOLDERID')" />
                                    
              <int-jdbc:returning-resultset name="rowMapper" row-mapper="com.dsths.cs.awd.utils.ResultSetRowMapper"/>
        </int-jdbc:stored-proc-outbound-gateway>
            <int:service-activator ref="msgHandler" method="buildMessageFromExtSysResponse" />
                 <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiryAddDates}"  />   
        </int:chain>    
           <!-- Get all the cases associated to the folders --> 
        <int:chain  input-channel="PQCaseInquiry-AWD-GROUP-MEMBER-PROVIDER-PQCLKUP-Execute" output-channel="PQCaseInquiry-Aggregator-PQCLKUP-Response" >
            <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="${headerNames.originalPayload}" expression="payload" />
            </int:header-enricher>    
            <!-- split the folders-->
            <int-xml:xpath-splitter  >
            <int-xml:xpath-expression expression="//results/row"/>
            </int-xml:xpath-splitter>
            
            <int-jdbc:stored-proc-outbound-gateway
                            auto-startup="true"
                            data-source="routingDataSource"
                            stored-procedure-name="${PQCaseInquiry.storedProcedureName.pqclkup}"
                            skip-undeclared-results="true"
                            ignore-column-meta-data="true"  
                            use-payload-as-parameter-source = "false"
                            expect-single-result="true" >
                                    <int-jdbc:sql-parameter-definition name="P_FDATTIM" direction="IN" type="VARCHAR" />
                                    <int-jdbc:sql-parameter-definition name="P_FRECORDCD" direction="IN" type="VARCHAR" />
                                       <int-jdbc:parameter name="P_FDATTIM" expression="#xpath(payload, '//FKEY')" />
                                    <int-jdbc:parameter name="P_FRECORDCD" expression="#xpath(payload, '//RECORDCD')" />
                                     <int-jdbc:returning-resultset name="rowMapper" row-mapper="com.dsths.cs.awd.utils.ResultSetRowMapper"/>
                  </int-jdbc:stored-proc-outbound-gateway>
            <int:service-activator ref="msgHandler" method="buildMessageFromExtSysResponse" />
            <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Merge-All-Cases}"  />
            </int:chain>
            <int:aggregator input-channel="PQCaseInquiry-Aggregator-PQCLKUP-Response" output-channel="Build-Response-After-PQCLKUP-Response-Aggregation" 
                            ref="xmlAggregator"  method="aggregatePqclkupResults">         
            </int:aggregator>      
            <!-- Get all the issues associated to the cases -->
        <int:chain  input-channel="Build-Response-After-PQCLKUP-Response-Aggregation"  output-channel="queueChannel" >
           <int:service-activator ref="msgHandler" method="buildMessageFromExtSysResponse" />
           <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Format-response-StageOne}"  />
           <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Format-response-StageTwo}"  />
            <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="${headerNames.originalPayload}" expression="payload" />
                <int:header name="originalErrorChannel" expression="headers.errorChannel" />
            </int:header-enricher>    
            <int:header-filter header-names="errorChannel"/>
            <!-- Split the Folders-->
            <int-xml:xpath-splitter >
            <int-xml:xpath-expression expression="//folder"/>
            </int-xml:xpath-splitter>
        </int:chain>
               <int:channel id="queueChannel">
            <int:queue capacity="25"/>
            </int:channel>
        <int:chain  input-channel="queueChannel"  output-channel="queueChannelTwo" >
            <int:poller  fixed-delay="5000" error-channel="nullChannel" />
            <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="folderInfo" expression="payload" />
            </int:header-enricher> 
            <int-xml:xpath-splitter  >
            <int-xml:xpath-expression expression="//case"/>
            </int-xml:xpath-splitter>
        </int:chain>
            
            <int:channel id="queueChannelTwo">
            <int:queue capacity="25"/>
            </int:channel>
        
        <int:chain  input-channel="queueChannelTwo"  output-channel="Aggregate-Cases-Channel" >
            <int:poller  fixed-delay="5000" error-channel="splitErrorChannel" />
            
             <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="${headerNames.originalPayload}" expression="payload" />
                 <int:error-channel expression="headers.originalErrorChannel" />   
            </int:header-enricher> 
               
            <int-jdbc:stored-proc-outbound-gateway
                            auto-startup="true"
                            data-source="routingDataSource"
                            stored-procedure-name="${PQCaseInquiry.storedProcedureName.pqcallisslookup}"
                            skip-undeclared-results="true"
                            ignore-column-meta-data="true"  
                            use-payload-as-parameter-source = "false"
                            expect-single-result="true" >
                                    
                                    <int-jdbc:sql-parameter-definition name="P_CDATTIM" direction="IN" type="VARCHAR" />
                                    <int-jdbc:parameter name="P_CDATTIM" expression="#xpath(payload, '//CRDATTIM')" />
                                        <int-jdbc:returning-resultset name="rowMapper" row-mapper="com.dsths.cs.awd.utils.ResultSetRowMapper"/>
            </int-jdbc:stored-proc-outbound-gateway>
            <int:service-activator ref="msgHandler" method="buildMessageFromExtSysResponse" />
          <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Merge-All-Issues}"  />
           </int:chain>
            <!-- Service Activator to handle the errors -->    
             <int:transformer input-channel="splitErrorChannel" output-channel="Aggregate-Cases-Channel" method="handleErrors" ref="msgHandler"/>
         <int:aggregator input-channel="Aggregate-Cases-Channel" output-channel="Aggregate-Folders-Channel"
                            ref="xmlAggregator"  method="aggregateCases">         
            </int:aggregator>    
            <int:aggregator input-channel="Aggregate-Folders-Channel" output-channel="PQCaseInquiry-XsltTransformOutputChannel-Final-Transformation"
                            ref="xmlAggregator"  method="aggregateFolders">         
            </int:aggregator>    
     
         <int:chain input-channel="PQCaseInquiry-XsltTransformOutputChannel-Final-Transformation">
               <int:service-activator ref="msgHandler" method="buildMessageFromExtSysResponseTest" />
            <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Format-Response-Stage-One}" />
            <int:service-activator ref="msgHandler"  method="enrichPayloadXml"  />
            <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Format-Final-Response}" />
        </int:chain>    
    </beans>

    Leave a comment:


  • Ashok.N
    replied
    I have configured gateway as below :
    Code:
    <int:gateway service-interface="com.dsths.cs.awd.gateway.PQCaseInquiryGateway"  
                     error-channel="cs-exceptionHandlingChannel" >
            <!-- Entry point for PQCaseInquiryTest.pqCaseInquiryAWD  -->
             <int:method name="pqCaseInquiryAWD" request-channel="jobDesignerInputChannel">
                 <int:header name="jobDesignerJobName" value="PQCaseInquiry"/>    
             </int:method>
             
         </int:gateway>
    I will post the configuration separately due to size constraints.

    Leave a comment:


  • Artem Bilan
    commented on 's reply
    Show here, please, your entire config file - from gateway to the component, which should send the reply t othat gateway.

  • Ashok.N
    replied
    Thanks for your response. I appreciate your patience.
    From other side it would be better, if you will be a bit kind to your CPU and ecrease such a small value fixed-delay="1" - it is 1 millisecond and your machine tries to run new task!
    I have increased the fixed-delay to 5000 and turned off the DEBUG. Still The message is not reaching the last channel "PQCaseInquiry-XsltTransformOutputChannel-Final-Transformation". Actually the message should be delivered to "PQCaseInquiry-XsltTransformOutputChannel-Final-Transformation" after completion of the aggregation. But it appears that due to the split failure it is hung in the middle. Surprisingly, the error handler method that I wrote as per your suggestion is not getting called after split failure. So, I suspect that something is wrong with the configuration.

    Leave a comment:


  • Artem Bilan
    replied
    [org.springframework.integration.endpoint.PollingCo nsumer.doPoll] Received no Message during the poll, returning 'false'
    It's correct DEBUG message, which says that your poller works. Well, just turn off DEBUG for org.springframework.integration

    From other side it would be better, if you will be a bit kind to your CPU and ecrease such a small value fixed-delay="1" - it is 1 millisecond and your machine tries to run new task!

    Leave a comment:


  • Ashok.N
    replied
    I have configured as you said, but still the same problem persists, see the complete code below:
    Code:
    int:chain  input-channel="Build-Response-After-PQCLKUP-Response-Aggregation"  output-channel="queueChannel" >
           <int:service-activator ref="msgHandler" method="buildMessageFromExtSysResponse" />
           
           <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Format-response-StageOne}"  />
           <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Format-response-StageTwo}"  />
           
            <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="${headerNames.originalPayload}" expression="payload" />
                <int:header name="originalErrorChannel" expression="headers.errorChannel" />
    
            </int:header-enricher>    
            <int:header-filter header-names="errorChannel"/>
            <!-- Split the Folders-->
            <int-xml:xpath-splitter >
            <int-xml:xpath-expression expression="//folder"/>
            </int-xml:xpath-splitter>
        </int:chain>
            
            <int:channel id="queueChannel">
            <int:queue capacity="25"/>
            </int:channel>
        
        <int:chain  input-channel="queueChannel"  output-channel="queueChannelTwo" >
            <int:poller  fixed-delay="1" error-channel="nullChannel" />
            <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="folderInfo" expression="payload" />
            </int:header-enricher> 
                
            <int-xml:xpath-splitter  >
            <!--<int:poller  fixed-delay="1" error-channel="nullChannel" />-->
            <int-xml:xpath-expression expression="//case"/>
            </int-xml:xpath-splitter>
        </int:chain>
            
            <int:channel id="queueChannelTwo">
            <int:queue capacity="25"/>
            </int:channel>
        
        <int:chain  input-channel="queueChannelTwo"  output-channel="Aggregate-Cases-Channel" >
            <int:poller  fixed-delay="1" error-channel="splitErrorChannel" />
            
             <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="${headerNames.originalPayload}" expression="payload" />
                 <int:error-channel expression="headers.originalErrorChannel" />   
            </int:header-enricher> 
               
            <int-jdbc:stored-proc-outbound-gateway
                            auto-startup="true"
                            data-source="routingDataSource"
                            stored-procedure-name="${PQCaseInquiry.storedProcedureName.pqcallisslookup}"
                            skip-undeclared-results="true"
                            ignore-column-meta-data="true"  
                            use-payload-as-parameter-source = "false"
                            expect-single-result="true" >
                                    
                                    <int-jdbc:sql-parameter-definition name="P_CDATTIM" direction="IN" type="VARCHAR" />
                                    <int-jdbc:sql-parameter-definition name="P_CRECORDCD" direction="IN" type="VARCHAR" />
                                    <int-jdbc:sql-parameter-definition name="P_CCRNODE" direction="IN" type="VARCHAR" />
                                    
                                    <int-jdbc:parameter name="P_CDATTIM" expression="#xpath(payload, '//CRDATTIM')" />
                                    <int-jdbc:parameter name="P_CRECORDCD" expression="#xpath(payload, '//RECORDCD')" />
                                    <int-jdbc:parameter name="P_CCRNODE" expression="#xpath(payload, '//CRNODE')" />
                                    
                    <int-jdbc:returning-resultset name="rowMapper" row-mapper="com.dsths.cs.awd.utils.ResultSetRowMapper"/>
            </int-jdbc:stored-proc-outbound-gateway>
          
          <int:service-activator ref="msgHandler" method="buildMessageFromExtSysResponse" />
          <int-xml:xslt-transformer xsl-resource="${stylesheet.PQCaseInquiry-Merge-All-Issues}"  />
        
        </int:chain>
        
            <!-- Service Activator to handle the errors -->    
             <int:transformer input-channel="splitErrorChannel" output-channel="Aggregate-Cases-Channel" method="handleErrors" ref="msgHandler"/>
            
          <int:aggregator input-channel="Aggregate-Cases-Channel" output-channel="Aggregate-Folders-Channel"
                            ref="xmlAggregator"  method="aggregateCases">         
            </int:aggregator>    
        
            <int:aggregator input-channel="Aggregate-Folders-Channel" output-channel="PQCaseInquiry-XsltTransformOutputChannel-Final-Transformation"
                            ref="xmlAggregator"  method="aggregateFolders">         
            </int:aggregator>
    Again I could see the following message displayed in the log continuously for indefinite time:
    HTML Code:
    13:33:42,027 DEBUG [org.springframework.integration.endpoint.PollingConsumer.doPoll] Received no Message during the poll, returning 'false'

    Leave a comment:


  • Artem Bilan
    replied
    1. You change "nullChannel" to concrete one for that <poller>, which <xpath-splitter> throws Exception.
    2. Write some simple ErrorHandler:
    Code:
    public Message<String> handleError(MessagingException e)  {
         return MessageBuilder.withPayload("ERROR")
                                          .copyHeaders(e.getFailedMessage().getHeaders())
                                          .build();
    }
    copyHeaders is needed here to keep SequenceDetails from previous splitter and for aggregatot.
    3. Use that handler as:
    HTML Code:
       <transformer input-channel="splitErrorChannel" output-channel="aggregator" ref="errorHandler"/>
    where output-channel="aggregator" should have an appropriate channel for your aggregator.
    4. The aggregateProcessor should filter those "ERROR" messages

    Hope it is clear

    Leave a comment:

Working...
X