hi
thanks for your reply.
this is our requirement:
Multiple REST service running on various host. Client send the request to
servicemix and serivcemix will decide which of the service to be called. For
eg System A is the client and sending the request to System B(Servicemix
running). Based on the Client request , the servicemix invoke the SystemC(
Webservice Running) and the output of the xml send back to the same client.
We took loan broker example for the above requirement. In these Client
(System A) can send the request to Servicemix (System B) and service mix
succesfully invoking the related REST Webservice (from System C) and the
output stored in the specifed file(output.txt). we want to send back the
result to the requested client. but we are receiving the output content as
many times.
Sample code and the output are mentioned below:
This is my RouteBuilder.java file which is running under Servicemix(System
B)
try {
context.addRoutes(new RouteBuilder() {
public void configure() {
from("http://localhost/testservice/resources/1")
.setHeader(FileComponent.HEADER_FILE_NAME, constant("output.txt"))
.to("file:/target/?autoCreate=false&append=true")
} });
} catch (Exception e) {
e.printStackTrace();
}
try{
context.start();
Thread.sleep(5000);
context.stop();
}catch(Exception e){}
this is the sample OUTPUT we are getting in the OUTPUT.TXT file:-
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?><abc><xmlcontent><address>Chennai</address><name>Ramya</name><mobileno>987878</mobileno><phoneno>43423</phoneno><vehicle_colour>red</vehicle_colour><vehicle_no>TN1456</vehicle_no><vehicle_type>maruthi</vehicle_type></xmlcontent></abc><?xml
version="1.0" encoding="UTF-8"
standalone="yes"?><abc><xmlcontent><address>Chennai</address><name>Ramya</name><mobileno>987878</mobileno><phoneno>43423</phoneno><vehicle_colour>red</vehicle_colour><vehicle_no>TN1456</vehicle_no><vehicle_type>maruthi</vehicle_type></xmlcontent></abc><?xml
version="1.0" encoding="UTF-8"
standalone="yes"?><abc><xmlcontent><address>Chennai</address><name>Ramya</name><mobileno>987878</mobileno><phoneno>43423</phoneno><vehicle_colour>red</vehicle_colour><vehicle_no>TN1456</vehicle_no><vehicle_type>maruthi</vehicle_type></xmlcontent></abc><?xml
version="1.0" encoding="UTF-8"
standalone="yes"?><abc><xmlcontent><address>Chennai</address><name>Ramya</name><mobileno>987878</mobileno><phoneno>43423</phoneno><vehicle_colour>red</vehicle_colour><vehicle_no>TN1456</vehicle_no><vehicle_type>maruthi</vehicle_type></xmlcontent></abc>
;
;
;
encoding="UTF-8"
standalone="yes"?><abc><xmlcontent><address>Chennai</address><name>Ramya</name><mobileno>987878</mobileno><phoneno>43423</phoneno><vehicle_colour>red</vehicle_colour><vehicle_no>TN1456</vehicle_no><vehicle_type>maruthi</vehicle_type></xmlcontent></abc>
(CONT...)
---------------------------------------------------------------------------------------------------------------------------------------
The problem is:
now it is not created 100 files instead it put the same xml content again
and again in the single output.txt file (around 30,000 lines). how to avoid
this issue. i want to retrieve it once.
--
View this message in context:
http://servicemix.396122.n5.nabble.com/Camel-Route-How-to-avoid-Multiple-files-in-target-folder-tp3244637p3246205.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.