I am still new at Mulesoft. need to insert csv file into MYSQL database (wamp). All the examples on the web, give me "Duplicated Database" and then no solutions!
I've asked similar to this question before, but as no correct answer, so that question is forgotten now, and this one is updated! the problem is the app is not working! no data inserted in the db!
The HTML inbound endpoint is to send the csv file using postman plugin (chrome). when running the app, the console is showing this warning: rg.mule.routing.ExpressionSplitter: Splitter returned no results. If this is not expected, please check your split expression
even when I add a splitter after the Byte Array to String, and the expression is #[xpath('//item')], it keeps showing same warning!
I have MuleESB enterprise. All connections with database is correct. Anyone to help ASAP, please! Thanks for your help in advance!
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:jdbc-ee="http://ift.tt/1dj135l" xmlns:http="http://ift.tt/1cFdM1N" xmlns:ftp="http://ift.tt/1kJcioG" xmlns:smtp="http://ift.tt/1kJchky" xmlns:tracking="http://ift.tt/18e47h2" xmlns:mulexml="http://ift.tt/1atROdg" xmlns:file="http://ift.tt/1atRLOv"
xmlns:db="http://ift.tt/1m8LRbf" xmlns:data-mapper="http://ift.tt/1gHdDjj"
xmlns="http://ift.tt/1atROtw" xmlns:doc="http://ift.tt/18e498t"
xmlns:spring="http://ift.tt/GArMu6" version="EE-3.5.0"
xmlns:xsi="http://ift.tt/ra1lAU"
xsi:schemaLocation="http://ift.tt/GArMu6 http://ift.tt/1bzZcnw
http://ift.tt/1atROtw http://ift.tt/18e498A
http://ift.tt/1atRLOv http://ift.tt/18e498w
http://ift.tt/1gHdDjj http://ift.tt/1o7kulI
http://ift.tt/1m8LRbf http://ift.tt/1q8YOKD
http://ift.tt/1atROdg http://ift.tt/1atRLOz
http://ift.tt/18e47h2 http://ift.tt/18e47xm
http://ift.tt/1kJchky http://ift.tt/1u65F9i
http://ift.tt/1kJcioG http://ift.tt/1kJchkC
http://ift.tt/1dj135l http://ift.tt/1iHLNQH
http://ift.tt/1cFdM1N http://ift.tt/1cFdOXb">
<db:mysql-config name="MySQL_Configuration" host="localhost"
port="3306" database="dbflow"
doc:name="MySQL Configuration" user="root"/>
<data-mapper:config name="CSV_To_XML" transformationGraphPath="csv_to_xml.grf" doc:name="CSV_To_XML"/>
<jdbc-ee:mysql-data-source name="MySQL_Data_Source" user="root" password="" url="jdbc:mysql://localhost:3306/dbflow" transactionIsolation="UNSPECIFIED" doc:name="MySQL Data Source"/>
<jdbc-ee:connector name="Database" dataSource-ref="MySQL_Data_Source" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database"/>
<flow name="dbFlow1" doc:name="dbFlow1">
<http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8084" path="csv" doc:name="HTTP"/>
<data-mapper:transform config-ref="CSV_To_XML" doc:name="CSV To XML"/>
<byte-array-to-string-transformer doc:name="Byte Array to String"/>
<foreach collection="#[xpath('//info')]" doc:name="For Each">
<mulexml:dom-to-xml-transformer doc:name="DOM to XML"/>
<db:insert config-ref="MySQL_Configuration" doc:name="Database">
<db:parameterized-query><![CDATA[INSERT INTO `dbflow`.`user_table`
(`current_date`,
`serialnumber`,
`gender`,
`fullname`,
`birthdate`,
`email`,
`mobilnumber`,
`address`)
VALUES
(#[xpath://date],
#[xpath://serialnumber],
#[xpath://gender],
#[xpath://fullname],
#[xpath://birthdate],
#[xpath://email],
#[xpath://mobilenumber],
#[xpath://address]
);]]></db:parameterized-query>
</db:insert>
</foreach>
</flow>
</mule>
No comments:
Post a Comment