We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
labels: ["in: mule-3.9"]
Support DB: Insert Component
input Mule XML
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> <flow name="dbFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/> <logger level="INFO" doc:name="Logger"/> <db:insert config-ref="Oracle_Configuration" doc:name="Database"> <db:parameterized-query><![CDATA[INSERT INTO STUDENTS (NAME, AGE, CITY) VALUES (#[payload.name], #[payload.age], #[payload.city])]]></db:parameterized-query> </db:insert> </flow> </mule>
java DSL:
package com.example.javadsl; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.integration.dsl.IntegrationFlow; import org.springframework.integration.dsl.IntegrationFlows; import org.springframework.integration.handler.LoggingHandler; import org.springframework.integration.http.dsl.Http; import org.springframework.util.LinkedMultiValueMap; @Configuration public class FlowConfigurations { @Bean IntegrationFlow dbFlow() { return IntegrationFlows.from(Http.inboundChannelAdapter("/")).handle((p, h) -> p) .log(LoggingHandler.Level.INFO) // TODO: payload type might not be always LinkedMultiValueMap please change it to appropriate type // TODO: mule expression language is not converted to java, do it manually. example: #[payload] etc .<LinkedMultiValueMap<String, String>>handle((p, h) -> { jdbcTemplate.execute("INSERT INTO STUDENTS (NAME, AGE, CITY) VALUES (#[payload.name], #[payload.age], #[payload.city])"); return p; }) .get(); } }
The text was updated successfully, but these errors were encountered:
Closes db insert component (#140)
c59554c
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
labels: ["in: mule-3.9"]
What needs to be done
Support DB: Insert Component
Sample input and outputs
input
Mule XML
java DSL:
The text was updated successfully, but these errors were encountered: