Look at simple language with toD, or use a java bean method to calculate the uri with recipient list (its also dynamic)
On Tue, Feb 7, 2023 at 6:14 AM Yash Ganthe <yas...@gmail.com> wrote: > Hi, > > The toD will help in setting the destination. How do we get the value of > the destination from the records? > I looked at > https://camel.apache.org/components/3.20.x/dataformats/csv-dataformat.html > > The unmarshall does give out a List<List<String>>. How can we use the 3rd > field in the toD ? > E.g. Can we do something like this? > from("file://rider/csvfiles") > .unmarshal().csv() > .split(body()).toD("jms:queue:csv.record[2]"); > > -Yash > > On Mon, 6 Feb 2023 at 20:41, Claus Ibsen <claus.ib...@gmail.com> wrote: > > > Hi > > > > Yes, look at toD which is a dynamic "to". > > > > > > On Mon, Feb 6, 2023 at 4:04 PM Yash Ganthe <yas...@gmail.com> wrote: > > > > > Hi, > > > > > > I have a text file that looks like: > > > my data, 342342, Q1 > > > my data2, 342342, Q2 > > > my data3, 342342, Q1 > > > .... > > > > > > I would like to read each line, read the third field and use it as the > > name > > > of the queue to which the first and second field are written. > > > E.g. > > > from("file://myfile.txt").to("jmsqueue:"+Line[2]) > > > > > > Is something like this possible with Camel? > > > > > > -Yash > > > > > > > > > -- > > Claus Ibsen > > ----------------- > > @davsclaus > > Camel in Action 2: https://www.manning.com/ibsen2 > > > -- Claus Ibsen ----------------- @davsclaus Camel in Action 2: https://www.manning.com/ibsen2