348349350351352353354355356357358
Exchange e4 = new DefaultExchange(context); e4.getIn().setBody("END"); e4.getIn().setHeader("id", 123); ap.process(e1); try { ap.process(e2); fail("Should have thrown an exception"); } catch (CamelExchangeException e) {
351352353354355356357358359360361
e4.getIn().setHeader("id", 123); ap.process(e1); try { ap.process(e2); fail("Should have thrown an exception"); } catch (CamelExchangeException e) { assertEquals("Invalid correlation key. Exchange[Message: B]", e.getMessage()); }
357358359360361362363364365366367
fail("Should have thrown an exception"); } catch (CamelExchangeException e) { assertEquals("Invalid correlation key. Exchange[Message: B]", e.getMessage()); } ap.process(e3); ap.process(e4); assertMockEndpointsSatisfied(); ap.stop();
358359360361362363364365366367368
} catch (CamelExchangeException e) { assertEquals("Invalid correlation key. Exchange[Message: B]", e.getMessage()); } ap.process(e3); ap.process(e4); assertMockEndpointsSatisfied(); ap.stop(); }
396397398399400401402403404405406
Exchange e4 = new DefaultExchange(context); e4.getIn().setBody("C"); e4.getIn().setHeader("id", 123); ap.process(e1); ap.process(e2); ap.process(e3); try { ap.process(e4);
397398399400401402403404405406407
Exchange e4 = new DefaultExchange(context); e4.getIn().setBody("C"); e4.getIn().setHeader("id", 123); ap.process(e1); ap.process(e2); ap.process(e3); try { ap.process(e4); fail("Should have thrown an exception");
398399400401402403404405406407408
e4.getIn().setBody("C"); e4.getIn().setHeader("id", 123); ap.process(e1); ap.process(e2); ap.process(e3); try { ap.process(e4); fail("Should have thrown an exception"); } catch (CamelExchangeException e) {
401402403404405406407408409410411
ap.process(e1); ap.process(e2); ap.process(e3); try { ap.process(e4); fail("Should have thrown an exception"); } catch (CamelExchangeException e) { assertEquals("The correlation key [123] has been closed. Exchange[Message: C]", e.getMessage()); }
462463464465466467468469470471472
e5.getIn().setHeader("id", 123); e5.setProperty(Exchange.BATCH_INDEX, 2); e5.setProperty(Exchange.BATCH_SIZE, 3); e5.setProperty(Exchange.BATCH_COMPLETE, true); ap.process(e1); ap.process(e2); ap.process(e3); ap.process(e4); ap.process(e5);
463464465466467468469470471472473
e5.setProperty(Exchange.BATCH_INDEX, 2); e5.setProperty(Exchange.BATCH_SIZE, 3); e5.setProperty(Exchange.BATCH_COMPLETE, true); ap.process(e1); ap.process(e2); ap.process(e3); ap.process(e4); ap.process(e5); assertMockEndpointsSatisfied();