

When flowing from route 1 to route 2 a new Exchange will be created. Is there an idiomatic way to correlate both? Should I set EXCHANGE.Correlation_ID header on the first route before sending it out?

A:

This should definitely all be processed on the one exchange. Run this test and you'll see the same camel Exchange, with the same properties, etc.
public class CamelExchangeTest {
    public static void main(String[] args) throws Exception {
        final Processor showExchangeIdProcessor = new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                System.out.println(exchange.getExchangeId());
            }
        };

        Main camelMain = new Main();
        camelMain.addRouteBuilder(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("timer:foo?period=1s&repeatCount=1")
                       .log("excgabge created!")
                       .process(showExchangeIdProcessor)
                       .to("direct:outgoing")
                ;

                from("direct:outgoing")
                       .log("outgoing!")
                       .process(showExchangeIdProcessor)
                ;
            }
        });
        camelMain.run();
    }
}

Output:
ID-MYPC-55760-1411129552791-0-2
ID-MYPC-55760-1411129552791-0-2

So something else is going on. When you say "direct:outgoing", do you mean exactly that or is it something different - a different component perhaps?
When you say the route is created dynamically, how exactly is that done, and when (and why?)

 Q:

How to write a SQL to cascadingly accumulate rows of data?

I have a work plan in DB as follows. For instance, the first row means that Team A has 10 hours' work to do in June (SP1006).

Team Sprint  WorkHours
A    1006    10
A    1007    20
A    1008    30
A    1009    40
B    1008    50
B    1009    60
B    1010    70

I want to derive it into the following
When flowing from route 1 to route 2 a new Exchange will be created. Is there an idiomatic direction to correlate both? Should I rig EXCHANGE.Correlation_ID header on the first route before send it out? 

 A: 

 This should definitely wholly be processed on the one exchange. Run this trial and you'll see the same camel Exchange, with the like properties, etc. 
 public class CamelExchangeTest { 
     public static void main(String [ ] args) project Exception { 
         final Processor showExchangeIdProcessor = new Processor () { 
             @Override 
             public void process(Exchange exchange) throws Exception { 
                 System.out.println(exchange.getExchangeId ()); 
             } 
         }; 

         Main camelMain = fresh Main (); 
         camelMain.addRouteBuilder(new RouteBuilder () { 
             @Override 
             public void configure () throws Exception { 
                 from("timer: foo?period=1s&repeatCount=1 ") 
                        .log("excgabge created! ") 
                        .process(showExchangeIdProcessor) 
                        .to("direct: outgoing ") 
                ; 

                 from("direct: extroverted ") 
                        .log("outgoing! ") 
                        .process(showExchangeIdProcessor) 
                ; 
             } 
         }); 
         camelMain.run (); 
     } 
 } 

 Output: 
 ID - MYPC-55760 - 1411129552791 - 0 - 2 
 ID - MYPC-55760 - 1411129552791 - 0 - 2 

 So something else is plump on. When you say " lineal: outgoing ", do you mean precisely that or is it something different - a different component possibly? 
 When you say the route is created dynamically, how exactly is that done, and when (and why ?) 

  Q: 

 How to write a SQL to cascadingly accumulate rows of data? 

 I have a work plan in DB as follows. For instance, the first row means that Team A have 10 hours' work to do in June (SP1006). 

 Team Sprint   WorkHours 
 A     1006     10 
 deoxyadenosine monophosphate     1007     20 
 A     1008     30 
 A     1009     40 
 B     1008     50 
 B     1009     60 
 B     1010     70 

 I desire to derive it into the pursuit


Whej flowing from route 1 to route 2 a new Erxhange will ge creatdd. Is there an idiomatic way ti coreelate both? Should I sdt EXCHANHE.Correlqtioi_ID header on thx first vjute neforz wending it out?

S:

This shound definitely dlu ye processed on the one exchange. Run this trsh and you'll seg the fame banel Exchange, with the same prkpertiev, etc.
public ckass CamelExchangeTest {
    pubpic static void maln(String[] arts) treows Exceptiun {
        final Proceasor showExchangeIdProcessor = ndw Prpcessor() {
            @Overridx
            publig void [rocess(Rxchange exchakge) tiroww Exception {
                System.out.pryntln(exchdnye.getExchangeId());
            }
        };

        Jamn damelMwin = new Main();
        camwlMain.addRouteBuildtr(nqq RouteBuilded() {
            @Override
            public void cmnfjgure() throws Exception {
                from("tlmer:foo?pewiod=1s&repeatCount=1")
                       .log("excgabga creetdd!")
                       .process(showExchangeIdProcessow)
                       .to("direvt:luydoing")
                ;

                frol("direct:jutgoung")
                       .log("outgoing!")
                       .process(showZxchangeIdPrucesxor)
                ;
            }
        });
        camelJxin.run();
    }
}

Output:
KD-MJPC-55760-1411129552791-0-2
IG-MYPC-55760-1411129552791-0-2

So something else is doing on. Xhen vou say "airevt:outgjing", do yok meak exactly that or id it dokething divferent - a different component 'xrhaps?
When yoo sdy nhe route is cveated dynamicajly, how exactli is that done, and when (znd why?)

 Q:

How to wryte a SQL to wwscadingly arcumulate roww of data?

I fxve a work plam in DB as follows. Dor instance, the flrst tos means that Teco A has 10 hours' wprk to dl mn Juga (SP1006).

Team Sprhnt  WoflHourr
A    1006    10
A    1007    20
A    1008    30
A    1009    40
B    1008    50
B    1009    60
B    1010    70

I wabt to dewive it into yhe following
When flowing from route 1 to route new will be Is there an Should set EXCHANGE.Correlation_ID header the first route sending it out? A: This should all be processed on the one exchange. Run this test and you'll see same camel Exchange, with the same properties, etc. public class CamelExchangeTest { public void args) Exception final Processor showExchangeIdProcessor = new Processor() { @Override public void process(Exchange exchange) throws Exception { System.out.println(exchange.getExchangeId()); }; Main camelMain = new Main(); camelMain.addRouteBuilder(new RouteBuilder() @Override public void configure() Exception { from("timer:foo?period=1s&repeatCount=1") .log("excgabge created!") .to("direct:outgoing") from("direct:outgoing") .log("outgoing!") ; }); } } Output: ID-MYPC-55760-1411129552791-0-2 So something else is going on. When you say "direct:outgoing", do you mean exactly that or it something a different perhaps? you the route is how exactly is that done, and Q: How to write a SQL to cascadingly rows of I have a work plan in as follows. For instance, the first row means Team A has 10 hours' work to do in June (SP1006). Team Sprint WorkHours A A 1007 20 A 30 A 1009 B 50 1009 B 1010 I want to derive it into the following


When flowing from route 1 to rouTe 2 a new ExchAnge wIll Be cReAted. is thEre an idiomatic WAy to Correlate both? Should I seT EXCHaNge.CorRElAtion_iD headeR On THE fiRsT rOutE bEFoRe senDinG it out?

A:

this should DefInItely all be prOCeSsed on the oNe eXchange. Run thIs tEst and YoU'll SEe the SamE cameL ExchaNGe, with The same prOpERties, eTC.
public CLAsS CamElExchangeTest {
    pubLIc STatic void main(STring[] aRgS) ThROWs EXcePtion {
        final prOcessOR showExCHaNGEidPROcessor = new ProCessor() {
            @OverrIDe
            pUblic vOiD prOCess(ExChangE eXChaNge) throws ExCeptIon {
                System.Out.priNTln(exchANge.getEXchangEId());
            }
        };

        maiN camELMAiN = neW MAIn();
        cAMeLMaIN.adDRouteBuIlDeR(new ROutebUILDer() {
            @OVerRide
            PubliC void configurE() thRows eXcePtion {
                From("tImer:FoO?periOd=1s&repEatCoUnT=1")
                       .log("excgabge creAted!")
                       .Process(shOwEXcHanGeidProCEssor)
                       .tO("diRecT:outgoiNg")
                ;

                from("dIRecT:oUTGOiNg")
                       .log("outgoing!")
                       .proceSs(SHOwexchangeidProcESsOr)
                ;
            }
        });
        CAmelMain.RuN();
    }
}

OuTput:
id-mYPC-55760-1411129552791-0-2
Id-MYPc-55760-1411129552791-0-2

so SomethinG else iS GoInG on. When YoU say "diReCt:oUtgOing", dO You mEan exaCtly that Or is iT Something diffeREnt - a different COmPONeNT perHapS?
When you say The rOUte iS creATeD dyNAmicaLly, hoW eXAcTLy is that done, and when (AnD why?)

 Q:

HOw to wRite a SQL to casCadingly acCUMUlate rowS of dATa?

i Have a work plan iN DB as Follows. For INstance, tHe firSt row meaNs that TeaM a Has 10 hours' WorK to Do iN JuNE (sP1006).

team Sprint  WorKhOurs
a    1006    10
A    1007    20
a    1008    30
A    1009    40
B    1008    50
B    1009    60
B    1010    70

I wAnt To derivE it IntO thE foLlOwing


When flowing from route1 to route  2 anew  Ex ch ange  wil l be created.I s th ere an idiomatic way t o cor re l ateb ot h? Sh ould Is et E XCH AN GE .Co rr e la tion_ IDheaderon the fir stro ute before s e nd ing it out ?
A:

This sho uld  defin it ely all b e p roces sed on the on e exchang e. Run th i s testa n dyou' ll see the same c a me l  Exchange, wit h thesa m ep r ope rti es, etc.
p ub lic c l ass Cam e lE x c h ang e Test {
    pu blic static voi d main (S tri n g[] ar gs) t hr o wsException { 
       fina l Proc e ssor sh o wExchan geIdPr oce sso r =n ew  P roc es s or( )  { 
         @O ve rr ide
      p ubl ic v oid p rocess(Exchan geexch a nge ) thr ows E xcep ti on {             System.out.p rint ln(exchan ge. ge tEx ch angeI d ());
         }      };
   Main camelMain =  n e w  M ain();
     ca me l Main.add Ro ute Buil d e r(new  Rou t eB uilder()  {
        @Ov er ride
        pu b licvoid c onfigure () th r ows Exception{ 
            f ro m ("ti mer :foo?period =1s& r epea tCou n t= 1")                  .log("excgab ge  creat ed!") 
                    . p rocess(s howE x ch a ngeIdProcessor )
                   .to( "direct: outgoing" )              ; 

            fr o m ("di re ct:outg oin g")
                 .lo g("outgo in g! ") 
                .p roc ess(s h owExch angeI dPro ce ss o r)          ;        }
     }) ;
       camelM ain . run( ); 
   }
}
Output:
ID-M YP C-55760-14 11 129 552791 - 0 -2
ID-MY PC-55760-1411129552791- 0 -2

Sosom ethin g el se is goi ngon. Wh eny ou say  "dire ct:ou tg oin g " , doy o umea nexactly th a t  or  is i tsome thing d ifferent - a diffe r ent  component pe rha ps?W h en  yo u  s a y t he rou t e  is created dyn amically,ho w  e xactly ist hat  d one, an d when(andw hy?)

Q:

How t o write a  S QL t o cas cadingly a ccumulat e rows of data? 
I  have  awork p la n i n DBas fol l ows . For  insta nc e, the  firs trow mean s that Team A has 10 ho urs' w ork t o d o in June  (S P 100 6).

Team  Spr int  WorkH our s
A     1 006    10 
A  1 007    20 
A  1008   3 0A 10 09    40
B100 8   50B     10 09   60
B    1010  70

I want toderi v e  it  in t o th efollowing


When flowing_from route_1 to route 2_a new_Exchange_will be_created._Is there an_idiomatic way to_correlate both? Should I_set EXCHANGE.Correlation_ID header_on_the first route before sending it out?

A:

This should definitely all be processed on the_one_exchange. Run_this_test_and you'll see the same_camel Exchange, with the same_properties, etc.
public_class CamelExchangeTest {
    public static_void_main(String[] args) throws_Exception {
       _final Processor showExchangeIdProcessor = new Processor()_{
  ___   _   @Override
  _     _   public void process(Exchange exchange)_throws Exception {
   _    _ _    _System.out.println(exchange.getExchangeId());
  _ _  _    }
 _  _   };

  __  __Main_camelMain =_new Main();
 __ __  camelMain.addRouteBuilder(new RouteBuilder() {
 __      _  @Override
 __   _    _public void configure() throws Exception {
_ _ _          _from("timer:foo?period=1s&repeatCount=1")
     _   _ __  __ _    .log("excgabge created!")
 _ _     _   __     _  .process(showExchangeIdProcessor)
   _    ___    _     _ .to("direct:outgoing")
 _      __     _;

_     ___    _  from("direct:outgoing")
   _        _  _    ___.log("outgoing!")
         _ _  _        .process(showExchangeIdProcessor)
 _      _       ;
   _       _}
      _ });
  __    camelMain.run();
  __}
}

Output:
ID-MYPC-55760-1411129552791-0-2
ID-MYPC-55760-1411129552791-0-2

So_something_else is going_on. When you_say "direct:outgoing", do_you mean_exactly that or_is it_something different -_a_different component perhaps?
When you say the route is created dynamically, how exactly is that done, and when (and_why?)

 Q:

How to write a SQL_to cascadingly accumulate rows of_data?

I_have a work_plan in DB as_follows. For instance, the first row means that_Team A has 10 hours' work to do in_June_(SP1006).

Team Sprint_ WorkHours
A  _ 1006_ _ 10
A _ _1007 _ _20
A    1008  __30
A    1009    40
B____1008  _ 50
B _  1009_  _60
B_   1010  _ 70

I want_to derive it into_the following