Re: Dynamic supplying of class to BindyCsvDataFormat

2016-10-26 Thread raghavender.anth...@gmail.com
Oh.. if this is the case then I feel it's a bit weird. Thanks for the quick
reply.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-supplying-of-class-to-BindyCsvDataFormat-tp5789283p5789291.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Dynamic supplying of class to BindyCsvDataFormat

2016-10-26 Thread raghavender.anth...@gmail.com
Hello All,

I would like to supply the class name dynamically to BindyCsvDataFormat? I
will be setting this class name in some exchange property/ in header. I
would like to read this value and set it to BindyCsvDataFormat during
marshalling/unmarshalling.

Can someone guide me how it can be done?

Thanks,
Raghavender Anthwar



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-supplying-of-class-to-BindyCsvDataFormat-tp5789283.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AW: Dynamic routing based on collection values

2016-10-26 Thread raghavender.anth...@gmail.com
Thanks a ton everyone, I was able to achieve it by using split and by writing
a custom bean/method.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-routing-based-on-collection-values-tp5789157p5789282.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AW: Dynamic routing based on collection values

2016-10-24 Thread raghavender.anth...@gmail.com
Thanks a lot for the response. This seems like useful, I'll give out a try
and will update you accordingly.

Best,
Raghavender Anthwar



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-routing-based-on-collection-values-tp5789157p5789179.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic routing based on collection values

2016-10-24 Thread raghavender.anth...@gmail.com
Thanks will tr the split method. Is there any example available on the web to
split the collection? I searched but couldn't find much help.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-routing-based-on-collection-values-tp5789157p5789169.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic routing based on collection values

2016-10-24 Thread raghavender.anth...@gmail.com
I've gone through the document of recipient list and seems it send the same
copy of the message to all routes.

I'm looking for sending each value of the map to a different router based on
the key. 

Thank you.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-routing-based-on-collection-values-tp5789157p5789165.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AW: Dynamic routing based on collection values

2016-10-24 Thread raghavender.anth...@gmail.com
Basically I've the map that was mentioned in the post as input in the
incoming message. And I wanted to iterate over each key of the map and send
it as input to different endpoint based on the key value.

Yes, it's kind of content based routing but the content is a collection
here.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-routing-based-on-collection-values-tp5789157p5789163.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic routing based on collection values

2016-10-24 Thread raghavender.anth...@gmail.com
Thanks for the quick response but I don't see whether recipient list can
iterate over the map and send each of the value to different endpoint.

Can you point me to a specific example where the routing is done based on
the collection values in the incoming message?

Sorry, am a beginner to Camel so looking for specific example. Thanks again.

Best,
Raghu



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-routing-based-on-collection-values-tp5789157p5789162.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Dynamic routing based on collection values

2016-10-24 Thread raghavender.anth...@gmail.com
Hello All,

Can someone help me with a solution for this problem:

I want to route to different destinations based on the values that are
present in the collection. For example, I've a map/any other collection with
list of different values. I want to iterate over the collection and want to
route the message to different destination based on the value of the
collection.

Assume that my map contains below keys and values:

Map> myMap = new HashMap>();

I would like to iterate over the map and based on key I wanted to pass on
the corresponding value list to a different route. Like:

If (Key == "Hyderabad") then route to Hyderabad uri etc.

Your help is much appreciated, Thank you.

Best,
Raghavender Anthwar



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-routing-based-on-collection-values-tp5789157.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Need help in processing comma seperated text file

2016-10-19 Thread raghavender.anth...@gmail.com
Thanks a lot for the response. Initially I thought of using BeanIO itself but
my data format is not exactly delimited format. As per my understanding, to
use BeanIO we should specify the format in the mapping xml.

Since I've the below elements in my text file, am not sure which one to go
with. Also am not sure how to read the elements: Runtime, Task, Data
dynamically as they are interrelated with index.

[Runtime] 
Date=ASAP 
Time= 
AllowErrors=FALSE 

[Task.1] 
Server=Item Master 
Module=ItemPOSIdentity 
Operation=addupdate

[Data.1] 
ItemPOSIdentity,11108,,40087320,UPC 
ItemPOSIdentity,11108,,40087337,UPC 
temPOSIdentity,1,,40087325,UPC 
ItemPOSIdentity,1,,40087335,UPC 

[Task.2] 
Server=Item Master 
Module=ItemPOSIdentity 
Operation=delete

[Data.2] 
ItemPOSIdentity,11108,,, 
ItemPOSIdentity,1,,, 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-in-processing-comma-seperated-text-file-tp5787930p5788947.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Need help in processing comma seperated text file

2016-10-14 Thread raghavender.anth...@gmail.com
Can someone guide me on this?

Thank you.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-in-processing-comma-seperated-text-file-tp5787930p5788783.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Need help in processing comma seperated text file

2016-09-23 Thread raghavender.anth...@gmail.com
Am not sure whether I've understood your question correctly, am looking for
an approach/solution that is efficient, quick with minimal code.

Right now, I'm planning to do below steps:

1. Read the source file line by line
2. Process the data line by line and collect the data in several collections
3. Prepare CSVRecord objects for mapping with the destination format
4. Use the collections from step 2 to prepare list of CSVRecord objects
(which uses camel bindy feature)
5. Marshal the collection object to CSV using bindy

Am not sure whether this is an effective solution keeping in mind that the
source file can contain 100,000-10,00,000 records. especially the step 1,
step 2 are gonna take much time if the volume of the data is huge.

Thank you.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-in-processing-comma-seperated-text-file-tp5787930p5787959.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Need help in processing comma seperated text file

2016-09-23 Thread raghavender.anth...@gmail.com
Thanks Steve. I am sending you the source and target file formats as
mentioned below. The source file can contain 100,000 - 10,00,000 records.

*Source delimited text file:*

[Runtime]
Date=ASAP
Time=
AllowErrors=FALSE

[Task.1]
Server=Item Master
Module=ItemPOSIdentity
Operation=*addupdate*

[Data.1]
ItemPOSIdentity,11108,,40087320,UPC
ItemPOSIdentity,11108,,40087337,UPC
temPOSIdentity,1,,40087325,UPC
ItemPOSIdentity,1,,40087335,UPC

[Task.2]
Server=Item Master
Module=ItemPOSIdentity
Operation=*delete*

[Data.2]
ItemPOSIdentity,11108,,,
ItemPOSIdentity,1,,,

The result file should look like:

--For add update operation
INSERT|ITEM_XREF|11108||40087320|||
INSERT|ITEM_XREF|11108||40087337|||
INSERT|ITEM_XREF|1||40087325|||
INSERT|ITEM_XREF|1||40087335|||

--For delete operation
DELETE|ITEM_XREF|11108|
DELETE|ITEM_XREF|1|

Thank you.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-in-processing-comma-seperated-text-file-tp5787930p5787957.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Need help in processing comma seperated text file

2016-09-22 Thread raghavender.anth...@gmail.com
Thanks for the response. I would like to use Camel to read the file,
process it and generate a new CSV file to send it to a different system.

I get this file from a different system X and I need to process and
transform it to CSV file in a different format which can be understood by
system Y.

I can try to do that but the problem here is task and data are always
associated with each other. I'm not sure how to dynamically split based on
task.1 or task.2 or task.n.

My goal is to read this file and generate a new CSV file in a different
format.

Can you point me/send me sample code to split the file by task?

I do really appreciate your help.

Thank you.

On Sep 23, 2016 01:25, "DariusX [via Camel]" <
ml-node+s465427n578794...@n5.nabble.com> wrote:

It isn't clear how you want to use Camel in this picture. if it is simply
to poll for files, and if the file is not huge, a simple/naive approach
would be to read in the whole file and do all the steps you need. All as a
single Processor following the "from:file" consumer.

The the Data/Task sections always follow one another, as in your example,
you could attempt to split the file into sections that way, and handle each
split task differently, based on the "operation". It will be more complex
to code. So the question is: what would you gain by this?

--
If you reply to this email, your message will be added to the discussion
below:
http://camel.465427.n5.nabble.com/Need-help-in-processing-
comma-seperated-text-file-tp5787930p5787941.html
To unsubscribe from Need help in processing comma seperated text file, click
here

.
NAML





--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-in-processing-comma-seperated-text-file-tp5787930p5787945.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Need help in processing comma seperated text file

2016-09-22 Thread raghavender.anth...@gmail.com
Hello Experts,

I'm a new bee to the Camel technology and have the following requirement.
Can someone help me with how to go about it.

*P.S. I've gone through CSV data format, BeanIO and Bindy implementations of
Camel and felt that they can't accommodate my requirement, correct me if am
wrong here :-)*

Requirement:

I've a text file that has got the below format:

[Runtime]
Date=ASAP
Time=
AllowErrors=FALSE

[Task.1]
Server=Item Master
Module=ItemPOSIdentity
Operation=addupdate

[Data.1]
ItemPOSIdentity,11108,,40087320,UPC
ItemPOSIdentity,11108,,40087337,UPC

[Task.2]
Server=Item Master
Module=ItemPOSIdentity
Operation=delete

[Data.2]
ItemPOSIdentity,11108,,40087320
ItemPOSIdentity,11108,,40087337


*If you look at the above format, the Task.x is linked with Data.x element
and Task.x defines which operation to perform such as addupdate/delete/add
etc. The operation type defined in Task.x needs to be executed on Data.x.
For eg. If the operation type is addupdate for Task.1 then for Data.1, we've
to execute addupdate for all the rows. I need to read this file, process it
and generate a new file in a different format.*

Your help is much appreciated.

Thank you.

Best Regards,
Raghu



--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-in-processing-comma-seperated-text-file-tp5787930.html
Sent from the Camel - Users mailing list archive at Nabble.com.