Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6628785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:10:00+00:00 2026-05-25T22:10:00+00:00

I need to send a file to a external web service. When the response

  • 0

I need to send a file to a external web service. When the response is 1, the file should be deleted, else the file should be kept.

I use the file connector to send the file, and insert a record into Oracle. When the file is sent out, the key is the message id of the file connect. I want to keep the message id so that I can update the record using this id when the response is back.

I tried to use MessagePropertiesTransformer to add a custom property, but the response doesn’t preserve it. Is there any way to keep the message id?

My config:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:file="http://www.mulesoft.org/schema/mule/file"
      xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
      xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
      xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
      xsi:schemaLocation="
          http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
          http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
          http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.1/mule-stdio.xsd
          http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.1/mule-cxf.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
          http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.1/mule-jdbc.xsd
          http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.1/mule-xml.xsd  
          ">    
  <spring:bean id="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
    <spring:property name="driverName" value="oracle.jdbc.driver.OracleDriver"/>
    <spring:property name="url" value="jdbc:oracle:thin:user/pass@ip:1521:orcl"/>
  </spring:bean>
  <file:connector name="output" outputAppend="true" outputPattern="#[function:datestamp]-#[header:originalFilename]" />
  <file:connector name="input" streaming="false" recursive="true" autoDelete="false"> 

          <service-overrides messageFactory="org.mule.transport.file.FileMuleMessageFactory" /> 

  </file:connector>
        <jdbc:connector name="jdbcConnector" pollingFrequency="10000" dataSource-ref="jdbcDataSource">
           <jdbc:query key="outboundInsertStatement"
              value="INSERT INTO TEST_MESSAGE (message_id, filename, done) VALUES (#[message:id], 
                    #[header:originalFilename], #[string:0])"/>
        </jdbc:connector> 
        <mulexml:namespace-manager includeConfigNamespaces="true">
                <mulexml:namespace prefix="ns1" uri="http://www.iec.ch/TC57/2008/schema/message"/>
                <mulexml:namespace prefix="soapenv" uri="http://schemas.xmlsoap.org/soap/envelope/"/>
                <mulexml:namespace prefix="ns1" uri="http://www.iec.ch/TC57/2008/schema/message"/>
                <mulexml:namespace prefix="fullmodel" uri="iesb.dongfang.com"/>
        </mulexml:namespace-manager> 
    <flow name="fileTestFlow1">

         <file:inbound-endpoint path="D:/data/in" moveToDirectory="D:/data/out" moveToPattern="#[message:id]-#[header:originalFilename]" connector-ref="input"/>
            <component class="com.component.FileNameExtract"/> 

         <message-properties-transformer scope="outbound">

                <add-message-property key="test" value="#[message:id]"/>
         </message-properties-transformer>       
         <jdbc:outbound-endpoint queryKey="outboundInsertStatement"/>         
         <cxf:jaxws-client
               clientClass="com.ws.IESBService"
               port="IESBServiceEndpoint"               
               wsdlLocation="classpath:IESBService.wsdl"
               operation="requestInfo"/>               
         <outbound-endpoint address="http://ip:8888/axis2/services/iESBService/" exchange-pattern="request-response">           
         </outbound-endpoint>         
         <xml-entity-decoder-transformer/>                   
         <logger message=" #[header:test] !" level="INFO"></logger>        
    </flow>   
</mule>

UPDATE:
I tried “session” scope and I think it works. New config:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:file="http://www.mulesoft.org/schema/mule/file"
      xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
      xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
      xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
      xsi:schemaLocation="
          http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
          http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
          http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.1/mule-stdio.xsd
          http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.1/mule-cxf.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
          http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.1/mule-jdbc.xsd
          http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.1/mule-xml.xsd  
          ">    
  <spring:bean id="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
    <spring:property name="driverName" value="oracle.jdbc.driver.OracleDriver"/>
    <spring:property name="url" value="jdbc:oracle:thin:user/pass@ip:1521:orcl"/>
  </spring:bean>
  <file:connector name="output" outputAppend="true" outputPattern="#[function:datestamp]-#[header:originalFilename]" />
  <file:connector name="input" streaming="false" recursive="true" autoDelete="false"> 

          <service-overrides messageFactory="org.mule.transport.file.FileMuleMessageFactory" /> 

  </file:connector>
        <jdbc:connector name="jdbcConnector" pollingFrequency="10000" dataSource-ref="jdbcDataSource">
           <jdbc:query key="outboundInsertStatement"
              value="INSERT INTO TEST_MESSAGE (message_id, filename, done) VALUES (#[message:id], 
                    #[header:originalFilename], #[string:0])"/>
           <jdbc:query key="outboundUpdateStatement"
              value="update TEST_MESSAGE set done='1' where message_id=#[header:SESSION:test] "/>
        </jdbc:connector> 
        <mulexml:namespace-manager includeConfigNamespaces="true">
                <mulexml:namespace prefix="ns1" uri="http://www.iec.ch/TC57/2008/schema/message"/>
                <mulexml:namespace prefix="soapenv" uri="http://schemas.xmlsoap.org/soap/envelope/"/>
                <mulexml:namespace prefix="ns1" uri="http://www.iec.ch/TC57/2008/schema/message"/>
                <mulexml:namespace prefix="fullmodel" uri="iesb.dongfang.com"/>
        </mulexml:namespace-manager> 
    <flow name="fileTestFlow1">

         <file:inbound-endpoint path="D:/data/in" moveToDirectory="D:/data/out" moveToPattern="#[message:id]-#[header:originalFilename]" connector-ref="input"/>
            <component class="com.component.FileNameExtract"/> 

         <message-properties-transformer scope="outbound">

                <add-message-property key="test" value="#[message:id]"/>
         </message-properties-transformer> 
         <logger message="first #[message:id] " level="INFO"></logger>      
         <jdbc:outbound-endpoint queryKey="outboundInsertStatement"/>         
         <cxf:jaxws-client
               clientClass="com.ws.IESBService"
               port="IESBServiceEndpoint"               
               wsdlLocation="classpath:IESBService.wsdl"
               operation="requestInfo"/>               
         <outbound-endpoint address="http://ip:8888/axis2/services/iESBService/" exchange-pattern="request-response">           
         </outbound-endpoint>         
         <xml-entity-decoder-transformer/>                   
         <jdbc:outbound-endpoint queryKey="outboundUpdateStatement"/>
         <logger message="second #[header:SESSION:test] " level="INFO"></logger>       
    </flow>   
</mule>

When I copy the file one by one, it’s ok, but when I copy more than five files to the directory, some records can’t be updated.

 Executing SQL statement: 0 row(s) updated
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:10:01+00:00Added an answer on May 25, 2026 at 10:10 pm

    Set your JDBC outbound endpoint to request-response in order to ensure the flow will execute in a single thread. With your current configuration, the 2 in-only JDBC requests are “detached” from the flow and executed in parallel from it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to send a CSV file in HTTP response. How can I set
How to use third party api in blackberry jde ?....(I need send file to
I need to send an image (as a downloadable file) from an ASP web
after processing a upload file received from an external website, we need to send
I have this problem in my web page, I need to send a file
I need to send a file to MobileMe via Cocoa. I stumbled across a
Dear friends, I need your help. I need to send .bmp file to another
HI I have an xml file with 500KB size which i need to send
I am opening a file which has 100,000 URL's. I need to send an
I have an XML file which I need to parse using PHP and send

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.