Search code examples
mulemule-studiomule-el

Jdbc Acknowledgment (ACK) in Mule for outbound endpoint


I am using jbdc acknowledgement process for my jdbc inbound endpoint it works well. Is it possible to use the same process for my jdbc outbound endpoint.


Solution

  • You can use JDBC Acknowledgement process for JDBC outbound endpoint ... For example here in the flow the JDBC outbound endpoint is calling RetrieveQuery which does a simple Select operation and then the .ack query is automatically called which insert Data into DB :-

     <jdbc-ee:connector name="Database_Global" dataSource-ref="DB_Source" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database">
    
    <jdbc-ee:query key="RetrieveQuery.ack" value="INSERT INTO getData(ID,NAME,AGE,DESIGNATION)VALUES(2,'rrrrrr',44,'tttttt')"/>
    <jdbc-ee:query key="RetrieveQuery" value="Select * from getData"/>
    
    </jdbc-ee:connector>
    
    <flow name="Flow1" doc:name="Flow1">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="7777" path="aa" doc:name="HTTP"/>
    <jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="RetrieveQuery" queryTimeout="-1" connector-ref="Database_Global" doc:name="Database (JDBC)"/>
    <json:object-to-json-transformer doc:name="Object to JSON"/>
    <logger message=" payload #[message.payload]" level="INFO" doc:name="Logger"/>
    </flow>