├── .gitignore ├── 2_Core_Engine ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── redhat │ │ └── gpte │ │ └── training │ │ └── camel │ │ └── HelloBean.java │ └── resources │ └── log4j.properties ├── 3_Core_Features ├── camel-dataformat │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── gpte │ │ │ │ └── training │ │ │ │ └── camel │ │ │ │ ├── FromCSVFileToBindyDataFormat.java │ │ │ │ ├── MyBean.java │ │ │ │ └── model │ │ │ │ └── Student.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── spring │ │ │ │ └── spring-camel-context.xml │ │ │ └── log4j.properties │ │ └── test │ │ └── resources │ │ ├── camel │ │ └── csv │ │ │ └── students.txt │ │ ├── log4j.properties │ │ └── spring-camel-context.xml ├── camel-exception │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── gpte │ │ │ │ └── training │ │ │ │ └── camel │ │ │ │ ├── MyBean.java │ │ │ │ └── RouteByCurrencyRouter.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── spring │ │ │ │ └── spring-camel-context.xml │ │ │ └── log4j.properties │ │ └── test │ │ └── resources │ │ ├── camel │ │ ├── in │ │ │ └── xml │ │ │ │ ├── EUPayments.xml │ │ │ │ └── USPayments.xml │ │ ├── out │ │ │ └── xml │ │ │ │ └── dummy.txt │ │ └── temp │ │ │ ├── USPayments.xml │ │ │ └── UnknownPayments.xml │ │ ├── log4j.properties │ │ └── spring-camel-context.xml ├── camel-expressions │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── MyRouteBuilder.java │ │ │ └── SpringMainApp.java │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── spring-camel-context.xml │ │ └── log4j.properties ├── camel-threads │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── MainAppASync.java │ │ │ ├── MainAppASyncConcurrent.java │ │ │ ├── MainAppSyncMultiThreads.java │ │ │ └── MainAppSyncOneThread.java │ │ └── resources │ │ └── log4j.properties ├── camel-typeconverter │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── MessageProducer.java │ │ │ ├── MyRouteBuilder.java │ │ │ ├── SpringMainApp.java │ │ │ ├── bean │ │ │ └── MyArray.java │ │ │ └── converter │ │ │ └── ArrayConverter.java │ │ └── resources │ │ ├── META-INF │ │ ├── services │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── camel │ │ │ │ └── TypeConverter │ │ └── spring │ │ │ └── spring-camel-context.xml │ │ └── log4j.properties └── pom.xml ├── 4_Camel_Project_Development ├── camel-spring-standalone │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── SpringMainApp.java │ │ │ └── bean │ │ │ └── MyBean.java │ │ └── resources │ │ └── log4j.properties ├── camel-standalone │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── CamelStandaloneApp.java │ │ │ └── bean │ │ │ └── MyBean.java │ │ └── resources │ │ └── log4j.properties ├── camel-test │ ├── pom.xml │ └── src │ │ └── test │ │ └── java │ │ └── com │ │ └── redhat │ │ └── gpte │ │ └── training │ │ └── camel │ │ └── SimpleCamelUnitTest.java ├── camel-undertow │ ├── pom.xml │ └── src │ │ ├── data │ │ ├── message1.xml │ │ ├── message2.xml │ │ └── message3.xml │ │ └── main │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── camel-context.xml │ │ └── log4j.properties ├── camel-web │ ├── pom.xml │ └── src │ │ ├── data │ │ ├── message1.xml │ │ ├── message2.xml │ │ └── message3.xml │ │ └── main │ │ ├── resources │ │ └── log4j.properties │ │ └── webapp │ │ └── WEB-INF │ │ ├── applicationContext.xml │ │ └── web.xml └── pom.xml ├── 5_Components ├── camel-rest │ ├── pom.xml │ └── src │ │ └── main │ │ ├── data │ │ └── marvel_ids.txt │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── MarvelUtil.java │ │ │ └── model │ │ │ ├── Comics.java │ │ │ ├── Data.java │ │ │ ├── Events.java │ │ │ ├── ItemComic.java │ │ │ ├── ItemSeries.java │ │ │ ├── ItemStories.java │ │ │ ├── Record.java │ │ │ ├── Result.java │ │ │ ├── Series.java │ │ │ ├── Stories.java │ │ │ ├── Thumbnail.java │ │ │ └── Url.java │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── camel-context.xml │ │ ├── log4j.properties │ │ └── marvel.properties ├── camel-sql │ ├── pom.xml │ └── src │ │ └── main │ │ ├── data │ │ └── sql-records.txt │ │ ├── java │ │ └── META-INF │ │ │ └── MANIFEST.MF │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ ├── camel-context.xml │ │ │ └── spring-database.xml │ │ ├── log4j.properties │ │ └── sql │ │ └── db-schema.sql ├── camel-webservice │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ └── BeanService.java │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── spring-camel-context.xml │ │ ├── data │ │ ├── curl_requests.txt │ │ ├── soap-getAllCustomers.xml │ │ ├── soap-getCustomerByName.xml │ │ └── soap-saveCustomer.xml │ │ ├── log4j.properties │ │ └── wsdl │ │ └── CustomerService.wsdl └── pom.xml ├── 6_EIP_Patterns ├── camel-aggregator │ ├── pom.xml │ └── src │ │ └── main │ │ ├── data │ │ └── in │ │ │ ├── EUPayments.xml │ │ │ └── USPayments.xml │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── BodyAppenderAggregator.java │ │ │ └── route │ │ │ └── PaymentsAggregatorRoute.java │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── camel-context.xml │ │ ├── log4j.properties │ │ └── xsd │ │ └── Payment.xsd ├── camel-cbr │ ├── pom.xml │ └── src │ │ └── main │ │ ├── data │ │ └── in │ │ │ ├── csv │ │ │ ├── EUPayments.txt │ │ │ └── USPayments.txt │ │ │ └── xml │ │ │ ├── EUPayments.xml │ │ │ ├── USPayments.xml │ │ │ └── UnknownPayments.xml │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── SimpleCBRRoute.java │ │ │ └── XpathCBRRoute.java │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── camel-context.xml │ │ ├── cbr.properties │ │ └── log4j.properties ├── camel-enricher │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── EnricherRoute.java │ │ │ └── SampleAggregator.java │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── camel-context.xml │ │ └── log4j.properties ├── camel-recipientlist │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ └── RecipientRoute.java │ │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ └── camel-context.xml │ │ └── log4j.properties └── pom.xml ├── 7_Advanced_features ├── camel-jdbc-jms-transaction │ ├── pom.xml │ ├── readme.txt │ └── src │ │ ├── main │ │ ├── data │ │ │ ├── in │ │ │ │ ├── VariousEUPayments.xml │ │ │ │ ├── VariousUSPayments.xml │ │ │ │ └── VariousUnknownPayments.xml │ │ │ └── out │ │ │ │ ├── VariousEUPayments.xml │ │ │ │ └── VariousUSPayments.xml │ │ ├── java │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── gpte │ │ │ │ └── training │ │ │ │ └── camel │ │ │ │ ├── PaymentBean.java │ │ │ │ ├── h2 │ │ │ │ ├── JdbcMessageIdRepository.java │ │ │ │ └── PaymentCurrencyWithTxRouter.java │ │ │ │ ├── mysql │ │ │ │ ├── JdbcMessageIdRepository.java │ │ │ │ └── PaymentCurrencyWithTxRouter.java │ │ │ │ └── postgresql │ │ │ │ ├── JdbcMessageIdRepository.java │ │ │ │ └── PaymentCurrencyWithTxRouter.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── spring │ │ │ │ └── spring-camel-context.xml │ │ │ ├── log4j.properties │ │ │ ├── sql │ │ │ ├── db-demo-setup-h2.sql │ │ │ ├── db-demo-setup-mysql.sql │ │ │ └── db-demo-setup-postgresql.sql │ │ │ └── xsd │ │ │ └── Payment.xsd │ │ └── test │ │ └── resources │ │ ├── camel │ │ ├── in │ │ │ ├── VariousEUPayments.xml │ │ │ ├── VariousUSPayments.xml │ │ │ └── VariousUnknownPayments.xml │ │ └── out │ │ │ └── dummy.txt │ │ ├── conf │ │ └── activemq.xml │ │ ├── log4j.properties │ │ ├── spring-camel-context-h2.xml │ │ ├── spring-camel-context-mysql.xml │ │ └── spring-camel-context-postgresql.xml ├── camel-jms-transaction │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── data │ │ │ ├── in │ │ │ │ ├── VariousEUPayments.xml │ │ │ │ ├── VariousUSPayments.xml │ │ │ │ └── VariousUnknownPayments.xml │ │ │ └── out │ │ │ │ ├── VariousEUPayments.xml │ │ │ │ └── VariousUSPayments.xml │ │ ├── java │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── gpte │ │ │ │ └── training │ │ │ │ └── camel │ │ │ │ └── PaymentBean.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── spring │ │ │ │ └── spring-camel-context.xml │ │ │ ├── log4j.properties │ │ │ └── xsd │ │ │ └── Payment.xsd │ │ └── test │ │ └── resources │ │ ├── conf │ │ └── activemq.xml │ │ └── log4j.properties ├── camel-mycomponent │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── MyComponent.java │ │ │ ├── MyComponentConsumer.java │ │ │ ├── MyComponentEndpoint.java │ │ │ └── MyComponentProducer.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ └── MyComponentTest.java │ │ └── resources │ │ └── log4j.properties ├── camel-routepolicy │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── redhat │ │ │ └── gpte │ │ │ └── training │ │ │ └── camel │ │ │ ├── ManagedRoute.java │ │ │ └── MyCustomRoutePolicy.java │ │ └── resources │ │ ├── log4j.properties │ │ └── spring │ │ └── camel-context.xml ├── camel-security │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── gpte │ │ │ │ └── training │ │ │ │ └── camel │ │ │ │ ├── JettySecuredRoute.java │ │ │ │ └── MySecurityHandler.java │ │ └── resources │ │ │ ├── log4j.properties │ │ │ └── myRealm.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── redhat │ │ └── gpte │ │ └── training │ │ └── camel │ │ ├── BaseJettyTest.java │ │ └── HttpBasicAuthTest.java └── pom.xml ├── 8_REST_DSL ├── data │ └── elasticsearch │ │ ├── backup.json │ │ ├── dashboard.json │ │ ├── entry.json │ │ ├── mapping.json │ │ └── query.json ├── kibana │ ├── pom.xml │ └── src │ │ └── main │ │ └── webapp │ │ ├── WEB-INF │ │ └── web.xml │ │ ├── app.js │ │ ├── app │ │ ├── app.js │ │ ├── components │ │ │ └── require.config.js │ │ ├── dashboards │ │ │ ├── blank.json │ │ │ ├── camel.json │ │ │ ├── default.json │ │ │ ├── fuse-lab.json │ │ │ ├── guided.json │ │ │ ├── logstash.js │ │ │ ├── logstash.json │ │ │ └── noted.json │ │ ├── factories │ │ │ └── store.js │ │ ├── panels │ │ │ ├── bettermap │ │ │ │ ├── editor.html │ │ │ │ ├── leaflet │ │ │ │ │ ├── images │ │ │ │ │ │ ├── layers-2x.png │ │ │ │ │ │ ├── layers.png │ │ │ │ │ │ ├── marker-icon-2x.png │ │ │ │ │ │ ├── marker-icon.png │ │ │ │ │ │ └── marker-shadow.png │ │ │ │ │ ├── leaflet.css │ │ │ │ │ ├── leaflet.ie.css │ │ │ │ │ ├── leaflet.js │ │ │ │ │ ├── plugins.css │ │ │ │ │ └── plugins.js │ │ │ │ ├── module.css │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── column │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ ├── module.js │ │ │ │ └── panelgeneral.html │ │ │ ├── dashcontrol │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── derivequeries │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── fields │ │ │ │ ├── editor.html │ │ │ │ ├── micropanel.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── filtering │ │ │ │ ├── editor.html │ │ │ │ ├── meta.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── goal │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── histogram │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ ├── module.js │ │ │ │ ├── queriesEditor.html │ │ │ │ └── styleEditor.html │ │ │ ├── hits │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── map │ │ │ │ ├── editor.html │ │ │ │ ├── lib │ │ │ │ │ ├── map.europe.js │ │ │ │ │ ├── map.usa.js │ │ │ │ │ └── map.world.js │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── query │ │ │ │ ├── editor.html │ │ │ │ ├── editors │ │ │ │ │ ├── lucene.html │ │ │ │ │ ├── regex.html │ │ │ │ │ └── topN.html │ │ │ │ ├── help │ │ │ │ │ ├── lucene.html │ │ │ │ │ ├── regex.html │ │ │ │ │ └── topN.html │ │ │ │ ├── helpModal.html │ │ │ │ ├── meta.html │ │ │ │ ├── module.html │ │ │ │ ├── module.js │ │ │ │ └── query.css │ │ │ ├── sparklines │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── stats │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── table │ │ │ │ ├── editor.html │ │ │ │ ├── micropanel.html │ │ │ │ ├── modal.html │ │ │ │ ├── module.html │ │ │ │ ├── module.js │ │ │ │ └── pagination.html │ │ │ ├── terms │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── text │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ │ ├── timepicker │ │ │ │ ├── custom.html │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ ├── module.js │ │ │ │ └── refreshctrl.html │ │ │ └── trends │ │ │ │ ├── editor.html │ │ │ │ ├── module.html │ │ │ │ └── module.js │ │ └── partials │ │ │ ├── connectionFailed.html │ │ │ ├── dashLoader.html │ │ │ ├── dashLoaderShare.html │ │ │ ├── dashboard.html │ │ │ ├── dasheditor.html │ │ │ ├── inspector.html │ │ │ ├── load.html │ │ │ ├── modal.html │ │ │ ├── paneladd.html │ │ │ ├── paneleditor.html │ │ │ ├── panelgeneral.html │ │ │ ├── querySelect.html │ │ │ └── roweditor.html │ │ ├── config.js │ │ ├── css │ │ ├── animate.min.css │ │ ├── bootstrap-responsive.min.css │ │ ├── bootstrap.dark.less │ │ ├── bootstrap.dark.min.css │ │ ├── bootstrap.light.less │ │ ├── bootstrap.light.min.css │ │ ├── font-awesome.min.css │ │ ├── normalize.min.css │ │ └── timepicker.css │ │ ├── favicon.ico │ │ ├── font │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ │ ├── img │ │ ├── annotation-icon.png │ │ ├── cubes.png │ │ ├── glyphicons-halflings-white.png │ │ ├── glyphicons-halflings.png │ │ ├── kibana.png │ │ ├── light.png │ │ ├── load.gif │ │ ├── load_big.gif │ │ └── small.png │ │ ├── index.html │ │ ├── package.json │ │ └── vendor │ │ ├── LICENSE.json │ │ ├── bootstrap │ │ └── less │ │ │ └── tests │ │ │ ├── buttons.html │ │ │ ├── css-tests.css │ │ │ ├── css-tests.html │ │ │ ├── forms-responsive.html │ │ │ ├── forms.html │ │ │ ├── navbar-fixed-top.html │ │ │ ├── navbar-static-top.html │ │ │ └── navbar.html │ │ ├── require │ │ ├── css-build.js │ │ ├── require.js │ │ └── tmpl.js │ │ └── timezone.js ├── pom.xml ├── routing │ ├── pom.xml │ └── src │ │ ├── data │ │ └── articles │ │ │ └── records.csv │ │ └── main │ │ ├── fabric8 │ │ ├── Readme.md │ │ ├── fuse-lab1.png │ │ └── org.jboss.fuse.demo.properties │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── org │ │ │ └── jboss │ │ │ └── fuse │ │ │ ├── model │ │ │ └── Blog.java │ │ │ ├── route │ │ │ ├── AddArticleToElasticRoute.java │ │ │ ├── DeleteArticleToElasticRoute.java │ │ │ ├── FileToAddServiceRoute.java │ │ │ ├── OnExceptionElasticSearch.java │ │ │ ├── RestToServicesRoute.java │ │ │ └── SearchArticleToElasticRoute.java │ │ │ └── service │ │ │ └── ElasticSearchService.java │ │ └── resources │ │ ├── OSGI-INF │ │ └── blueprint │ │ │ └── camel-context.xml │ │ └── log4j.properties ├── script │ ├── pom.xml │ └── src │ │ └── main │ │ └── resources │ │ ├── commands.script │ │ ├── demo-install.script │ │ ├── io.fabric8.elasticsearch-insight.cfg │ │ ├── oauth2-all-requests.sh │ │ ├── oauth2-role-reader.sh │ │ └── oauth2-role-writer.sh ├── security │ ├── export-json-schema.txt │ └── pom.xml └── swagger │ ├── pom.xml │ ├── run_jetty.sh │ └── src │ └── main │ ├── java │ └── org │ │ └── jboss │ │ └── fuse │ │ └── CORSFilter.java │ ├── resources │ ├── log4j.properties │ └── services.json │ └── webapp │ ├── WEB-INF │ └── web.xml │ ├── css │ ├── print.css │ ├── reset.css │ ├── screen.css │ ├── style.css │ └── typography.css │ ├── fonts │ ├── droid-sans-v6-latin-700.eot │ ├── droid-sans-v6-latin-700.svg │ ├── droid-sans-v6-latin-700.ttf │ ├── droid-sans-v6-latin-700.woff │ ├── droid-sans-v6-latin-700.woff2 │ ├── droid-sans-v6-latin-regular.eot │ ├── droid-sans-v6-latin-regular.svg │ ├── droid-sans-v6-latin-regular.ttf │ ├── droid-sans-v6-latin-regular.woff │ └── droid-sans-v6-latin-regular.woff2 │ ├── images │ ├── explorer_icons.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ ├── logo_small.png │ ├── pet_store_api.png │ ├── throbber.gif │ └── wordnik_api.png │ ├── index.html │ ├── lang │ ├── en.js │ ├── es.js │ ├── pt.js │ ├── ru.js │ └── translator.js │ ├── lib │ ├── backbone-min.js │ ├── handlebars-2.0.0.js │ ├── highlight.7.3.pack.js │ ├── jquery-1.8.0.min.js │ ├── jquery.ba-bbq.min.js │ ├── jquery.slideto.min.js │ ├── jquery.wiggle.min.js │ ├── marked.js │ ├── swagger-oauth.js │ ├── underscore-min.js │ └── underscore-min.map │ ├── log4j.properties │ ├── o2c.html │ ├── services.json │ ├── swagger-ui.js │ └── swagger-ui.min.js ├── 9_Camel-K ├── CaffeineCacheSample.java ├── README.adoc ├── RestWithRestlet.java ├── Sample.java ├── camel-caffeine.groovy ├── dns.js ├── feed.groovy ├── greetings-api.json ├── greetings.groovy ├── hello.xml ├── kotlin-routes.kts ├── messages-channel.yaml ├── printer.groovy ├── props.js ├── reader.groovy ├── resources-data.txt ├── resources-route.groovy ├── routes-rest.js ├── routes.flow ├── routes.groovy ├── routes.js ├── simple.groovy ├── simple.js ├── splitter.groovy ├── words-channel.yaml └── writer.groovy ├── features-exercises ├── pom.xml ├── readme.txt ├── settings.xml └── src │ └── main │ └── filtered-resources │ └── features.xml └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.tsv 3 | *.swp 4 | *~ 5 | ~lock.* 6 | ~$* 7 | .DS_Store 8 | *.svn/ 9 | *.nogit/ 10 | *project/ 11 | LMSClass/ 12 | *.nogit/ 13 | *audio/ 14 | *.ini 15 | *.classpath 16 | *.project 17 | *.settings/ 18 | build.metadata 19 | .metadata 20 | target/ 21 | .camel/ 22 | -------------------------------------------------------------------------------- /2_Core_Engine/src/main/java/com/redhat/gpte/training/camel/HelloBean.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | public class HelloBean { 4 | /* 5 | * Add a method to say Hello 6 | * Use as input the parameter the body received and concatenate it with "Hello World ! " text 7 | */ 8 | } 9 | -------------------------------------------------------------------------------- /2_Core_Engine/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used for testing 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | #log4j.logger.org.apache.camel=DEBUG 7 | 8 | # CONSOLE appender not used by default 9 | log4j.appender.out=org.apache.log4j.ConsoleAppender 10 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n 12 | #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 13 | 14 | # File appender 15 | log4j.appender.file=org.apache.log4j.FileAppender 16 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 17 | log4j.appender.file.layout.ConversionPattern=%d %-5p %c{1} - %m %n 18 | log4j.appender.file.file=target/camel-test.log 19 | -------------------------------------------------------------------------------- /3_Core_Features/camel-dataformat/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /3_Core_Features/camel-dataformat/src/main/java/com/redhat/gpte/training/camel/FromCSVFileToBindyDataFormat.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import com.redhat.gpte.training.camel.model.Student; 4 | import org.apache.camel.Endpoint; 5 | import org.apache.camel.EndpointInject; 6 | import org.apache.camel.builder.RouteBuilder; 7 | import org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | public class FromCSVFileToBindyDataFormat extends RouteBuilder { 12 | 13 | private static final Logger logger = LoggerFactory.getLogger(FromCSVFileToBindyDataFormat.class); 14 | private static int count = 0; 15 | 16 | @EndpointInject(ref = "csvDirectory") 17 | Endpoint sourceUri; 18 | 19 | public void configure() throws Exception { 20 | 21 | BindyCsvDataFormat df = new BindyCsvDataFormat(Student.class); 22 | 23 | from(sourceUri).routeId("dataformat") 24 | .split(body(String.class).tokenize("\n")) 25 | .log(">> Student : ${body}") 26 | .unmarshal(df) 27 | .beanRef("myBean") 28 | .marshal(df) 29 | .log(">> Student Registered : ${body}"); 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /3_Core_Features/camel-dataformat/src/main/java/com/redhat/gpte/training/camel/MyBean.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import java.util.*; 4 | //import java.util.HashMap; 5 | //import java.util.List; 6 | //import java.util.Random; 7 | 8 | import org.apache.camel.Body; 9 | import com.redhat.gpte.training.camel.model.Student; 10 | import org.slf4j.Logger; 11 | import org.slf4j.LoggerFactory; 12 | 13 | public class MyBean { 14 | 15 | private static final Logger logger = LoggerFactory.getLogger(MyBean.class); 16 | 17 | public Student process(Student student) throws Exception { 18 | 19 | student.setStatus(Status.getRandomStatus().toString()); 20 | student.setRoom("jboss-fuse-0123"); 21 | 22 | return student; 23 | } 24 | 25 | enum Status { 26 | Registered, 27 | Follow, 28 | Certified, 29 | Canceled; 30 | 31 | public static Status getRandomStatus() { 32 | Random random = new Random(); 33 | return values()[random.nextInt(values().length)]; 34 | } 35 | 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /3_Core_Features/camel-dataformat/src/main/java/com/redhat/gpte/training/camel/model/Student.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel.model; 2 | 3 | import org.apache.camel.dataformat.bindy.annotation.CsvRecord; 4 | import org.apache.camel.dataformat.bindy.annotation.DataField; 5 | 6 | @CsvRecord( separator = "," ) 7 | public class Student { 8 | 9 | @DataField(pos = 1, position = 1) private String Name; 10 | @DataField(pos = 2, position = 2) private String Course; 11 | @DataField(pos = 3, position = 3) private Integer code; 12 | @DataField(pos = 4, required = false, position = 4) private String Status; 13 | @DataField(pos = 5, required = false, position = 5) private String room; 14 | 15 | public String isStatus() { 16 | return Status; 17 | } 18 | 19 | public void setStatus(String status) { 20 | Status = status; 21 | } 22 | 23 | public String getRoom() { 24 | return room; 25 | } 26 | 27 | public void setRoom(String room) { 28 | this.room = room; 29 | } 30 | 31 | public String getName() { 32 | return Name; 33 | } 34 | 35 | public void setName(String name) { 36 | Name = name; 37 | } 38 | 39 | public String getCourse() { 40 | return Course; 41 | } 42 | 43 | public void setCourse(String course) { 44 | Course = course; 45 | } 46 | 47 | public Integer getCode() { 48 | return code; 49 | } 50 | 51 | public void setCode(Integer code) { 52 | this.code = code; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /3_Core_Features/camel-dataformat/src/main/resources/META-INF/spring/spring-camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | com.redhat.gpte.training.camel 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /3_Core_Features/camel-dataformat/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /3_Core_Features/camel-dataformat/src/test/resources/camel/csv/students.txt: -------------------------------------------------------------------------------- 1 | jeff,fuse-camel-traning,1 2 | chad,fuse-camel-traning,2 3 | samuel,fuse-camel-traning,3 4 | bernard,fuse-camel-traning,4 5 | satya,fuse-camel-traning,5 -------------------------------------------------------------------------------- /3_Core_Features/camel-dataformat/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /3_Core_Features/camel-dataformat/src/test/resources/spring-camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | com.redhat.gpte.training.camel 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/main/java/com/redhat/gpte/training/camel/MyBean.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | public class MyBean { 8 | 9 | private static final Logger logger = LoggerFactory.getLogger(MyBean.class); 10 | private int counter = 0; 11 | 12 | public void process(Exchange exchange) throws Exception { 13 | 14 | String payment = (String) exchange.getIn().getHeader("Payment"); 15 | 16 | if (payment.equals("EUR")) { 17 | counter++; 18 | logger.info(">>>> Exception created for : " + payment + ", counter = " + counter); 19 | throw new MyFunctionalException(">>>> MyFunctionalException created."); 20 | } else if (payment.equals("USD")) { 21 | counter++; 22 | logger.info(">>>> Exception created for : " + payment + ", counter = " + counter); 23 | throw new Exception("===> Exception created"); 24 | } 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/main/resources/META-INF/spring/spring-camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | com.redhat.gpte.training.camel 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/test/resources/camel/in/xml/EUPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | EUR 7 | 8 | 9 | ade 10 | jack 11 | 1000000.0 12 | 13 | 14 | jack 15 | jill 16 | 20.0 17 | 18 | 19 | ade 20 | jill 21 | 42.0 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/test/resources/camel/in/xml/USPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | USD 7 | 8 | 9 | paul 10 | ade 11 | 1000000.0 12 | 13 | 14 | daan 15 | jack 16 | 78.0 17 | 18 | 19 | pat 20 | jill 21 | 13.0 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/test/resources/camel/out/xml/dummy.txt: -------------------------------------------------------------------------------- 1 | This file is just here so that Maven is not ignoring it and copies it into the target directory. -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/test/resources/camel/temp/USPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | USD 7 | 8 | 9 | paul 10 | ade 11 | 1000000.0 12 | 13 | 14 | daan 15 | jack 16 | 78.0 17 | 18 | 19 | pat 20 | jill 21 | 13.0 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/test/resources/camel/temp/UnknownPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | ??? 6 | 7 | paul 8 | ade 9 | 1000000.0 10 | 11 | 12 | daan 13 | ade 14 | 78.0 15 | 16 | 17 | pat 18 | ade 19 | 13.0 20 | 21 | 22 | -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /3_Core_Features/camel-exception/src/test/resources/spring-camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | com.redhat.gpte.training.camel 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /3_Core_Features/camel-expressions/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /3_Core_Features/camel-expressions/src/main/java/com/redhat/gpte/training/camel/SpringMainApp.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.spring.Main; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | public class SpringMainApp { 8 | 9 | private static Logger logger = LoggerFactory.getLogger(SpringMainApp.class); 10 | 11 | private Main main; 12 | 13 | public static void main(String[] args) throws Exception { 14 | SpringMainApp app = new SpringMainApp(); 15 | app.boot(); 16 | } 17 | 18 | public void boot() throws Exception { 19 | // create a Main instance 20 | main = new Main(); 21 | 22 | // enable hangup support so you can press ctrl + c to terminate the JVM 23 | main.enableHangupSupport(); 24 | 25 | // set Spring application context 26 | main.setApplicationContextUri("META-INF/spring/spring-camel-context.xml"); 27 | 28 | // run until you terminate the JVM 29 | logger.info("Starting Spring Camel. Use ctrl + c to terminate the JVM.\n"); 30 | 31 | main.run(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /3_Core_Features/camel-expressions/src/main/resources/META-INF/spring/spring-camel-context.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /3_Core_Features/camel-expressions/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used during tests.. 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | #log4j.logger.org.apache.camel=INFO 7 | 8 | # CONSOLE appender not used by default 9 | log4j.appender.out=org.apache.log4j.ConsoleAppender 10 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 12 | 13 | # File appender 14 | log4j.appender.file=org.apache.log4j.FileAppender 15 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.file.file=target/file.log 17 | log4j.appender.file.append=true 18 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /3_Core_Features/camel-threads/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /3_Core_Features/camel-threads/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used during tests.. 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | #log4j.logger.org.apache.camel=INFO 7 | 8 | # CONSOLE appender not used by default 9 | log4j.appender.out=org.apache.log4j.ConsoleAppender 10 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 12 | 13 | # File appender 14 | log4j.appender.file=org.apache.log4j.FileAppender 15 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.file.file=target/file.log 17 | log4j.appender.file.append=true 18 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /3_Core_Features/camel-typeconverter/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /3_Core_Features/camel-typeconverter/src/main/java/com/redhat/gpte/training/camel/MessageProducer.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import com.redhat.gpte.training.camel.bean.MyArray; 4 | import org.apache.camel.CamelContext; 5 | import org.apache.camel.ProducerTemplate; 6 | 7 | public class MessageProducer { 8 | 9 | private CamelContext context; 10 | 11 | public MessageProducer() { 12 | } 13 | 14 | public void sendMessage() { 15 | 16 | // A ProducerTemplate is required to send a message to the direct endpoint 17 | ProducerTemplate template = context.createProducerTemplate(); 18 | 19 | // Create an array 20 | MyArray myArray = new MyArray(); 21 | myArray.add(0, "Hong"); 22 | myArray.add(1, "Jeff"); 23 | myArray.add(1, "Chad"); 24 | 25 | // send the message to the ednpoint 26 | template.sendBody("direct:typeconverter", myArray); 27 | } 28 | 29 | public void setContext(CamelContext context) { 30 | this.context = context; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /3_Core_Features/camel-typeconverter/src/main/java/com/redhat/gpte/training/camel/SpringMainApp.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.CamelContext; 4 | import org.apache.camel.Produce; 5 | import org.apache.camel.ProducerTemplate; 6 | import org.apache.camel.builder.RouteBuilder; 7 | import org.apache.camel.spring.Main; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | public class SpringMainApp { 12 | 13 | private static Logger logger = LoggerFactory.getLogger(SpringMainApp.class); 14 | 15 | private ProducerTemplate template; 16 | public static Main main; 17 | 18 | public static void main(String[] args) throws Exception { 19 | SpringMainApp app = new SpringMainApp(); 20 | app.boot(); 21 | 22 | // Send message to the direct endpoint 23 | MessageProducer messageProducer = (MessageProducer) main.getApplicationContext().getBean("messageProducer"); 24 | messageProducer.sendMessage(); 25 | main.run(); 26 | } 27 | 28 | public void boot() throws Exception { 29 | // create a Main instance 30 | main = new Main(); 31 | 32 | // enable hangup support so you can press ctrl + c to terminate the JVM 33 | main.enableHangupSupport(); 34 | 35 | // set Spring application context 36 | main.setApplicationContextUri("META-INF/spring/spring-camel-context.xml"); 37 | 38 | // Start Camel 39 | main.start(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /3_Core_Features/camel-typeconverter/src/main/java/com/redhat/gpte/training/camel/bean/MyArray.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel.bean; 2 | 3 | import java.util.ArrayList; 4 | 5 | /* 6 | A simple Bean extending ArrayList 7 | */ 8 | public class MyArray extends ArrayList { } -------------------------------------------------------------------------------- /3_Core_Features/camel-typeconverter/src/main/java/com/redhat/gpte/training/camel/converter/ArrayConverter.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel.converter; 2 | 3 | // import org.apache.camel.Converter; 4 | import com.redhat.gpte.training.camel.bean.MyArray; 5 | import org.apache.camel.Converter; 6 | import org.apache.camel.Exchange; 7 | import org.apache.camel.TypeConversionException; 8 | import org.apache.camel.support.TypeConverterSupport; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | import java.util.Vector; 13 | 14 | //@Converter 15 | public class ArrayConverter extends TypeConverterSupport { 16 | 17 | /* 18 | * 19 | @Converter 20 | 21 | public static Vector toVector(ArrayList aList) { 22 | return new Vector(aList); 23 | } 24 | */ 25 | 26 | @Override 27 | public T convertTo(Class type, Exchange exchange, Object value) throws TypeConversionException { 28 | MyArray l = (MyArray) value; 29 | Vector v = new Vector(l); 30 | return (T) v; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /3_Core_Features/camel-typeconverter/src/main/resources/META-INF/services/org/apache/camel/TypeConverter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/3_Core_Features/camel-typeconverter/src/main/resources/META-INF/services/org/apache/camel/TypeConverter -------------------------------------------------------------------------------- /3_Core_Features/camel-typeconverter/src/main/resources/META-INF/spring/spring-camel-context.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /3_Core_Features/camel-typeconverter/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used during tests.. 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | #log4j.logger.org.apache.camel=INFO 7 | 8 | # CONSOLE appender not used by default 9 | log4j.appender.out=org.apache.log4j.ConsoleAppender 10 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 12 | 13 | # File appender 14 | log4j.appender.file=org.apache.log4j.FileAppender 15 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.file.file=target/file.log 17 | log4j.appender.file.append=true 18 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /3_Core_Features/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | camel 7 | com.redhat.gpte.training 8 | 1.0 9 | 10 | 4.0.0 11 | 12 | camel-lab-3 13 | RedHat GPTE Training :: Camel :: Lab :: 3 :: Project 14 | pom 15 | 16 | 17 | camel-dataformat 18 | camel-exception 19 | camel-expressions 20 | camel-typeconverter 21 | camel-threads 22 | 23 | 24 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-spring-standalone/src/main/java/com/redhat/gpte/training/camel/SpringMainApp.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.spring.Main; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | public class SpringMainApp { 8 | 9 | private static Logger logger = LoggerFactory.getLogger(SpringMainApp.class); 10 | 11 | public static void main(String[] args) throws Exception { 12 | 13 | // create a Main instance 14 | Main main = new Main(); 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-spring-standalone/src/main/java/com/redhat/gpte/training/camel/bean/MyBean.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel.bean; 2 | 3 | import org.apache.camel.Body; 4 | 5 | public class MyBean { 6 | 7 | } -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-spring-standalone/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used during tests.. 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | #log4j.logger.org.apache.camel=INFO 7 | 8 | # CONSOLE appender not used by default 9 | log4j.appender.out=org.apache.log4j.ConsoleAppender 10 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 12 | 13 | # File appender 14 | log4j.appender.file=org.apache.log4j.FileAppender 15 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.file.file=target/file.log 17 | log4j.appender.file.append=true 18 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-standalone/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-standalone/src/main/java/com/redhat/gpte/training/camel/CamelStandaloneApp.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | import org.apache.camel.main.Main; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | public class CamelStandaloneApp { 9 | 10 | private static Logger logger = LoggerFactory.getLogger(CamelStandaloneApp.class); 11 | 12 | public static void main(String[] args) throws Exception { 13 | 14 | // create a Main instance 15 | Main main = new Main(); 16 | } 17 | 18 | private static class MyRouteBuilder extends RouteBuilder { 19 | 20 | @Override 21 | public void configure() throws Exception { 22 | 23 | } 24 | } 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-standalone/src/main/java/com/redhat/gpte/training/camel/bean/MyBean.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel.bean; 2 | 3 | import org.apache.camel.Body; 4 | 5 | public class MyBean { 6 | 7 | /* public String sayHello(@Body String to) { 8 | return "Hello : " + to; 9 | } */ 10 | 11 | } -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-standalone/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used during tests.. 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | #log4j.logger.org.apache.camel=INFO 7 | 8 | # CONSOLE appender not used by default 9 | log4j.appender.out=org.apache.log4j.ConsoleAppender 10 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 12 | 13 | # File appender 14 | log4j.appender.file=org.apache.log4j.FileAppender 15 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.file.file=target/file.log 17 | log4j.appender.file.append=true 18 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | camel-lab-4 7 | com.redhat.gpte.training 8 | 1.0 9 | 10 | 4.0.0 11 | 12 | camel-test 13 | RedHat GPTE Training :: Camel :: Lab :: 4 :: Unit Test 14 | 15 | 16 | 17 | 18 | org.apache.camel 19 | camel-core 20 | 21 | 22 | 23 | 24 | org.slf4j 25 | slf4j-api 26 | 27 | 28 | org.slf4j 29 | slf4j-log4j12 30 | 31 | 32 | log4j 33 | log4j 34 | 35 | 36 | 37 | 38 | org.apache.camel 39 | camel-test 40 | test 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-test/src/test/java/com/redhat/gpte/training/camel/SimpleCamelUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.EndpointInject; 4 | import org.apache.camel.Produce; 5 | import org.apache.camel.ProducerTemplate; 6 | import org.apache.camel.builder.RouteBuilder; 7 | import org.apache.camel.component.mock.MockEndpoint; 8 | import org.apache.camel.test.junit4.CamelTestSupport; 9 | import org.junit.Test; 10 | 11 | public class SimpleCamelUnitTest extends CamelTestSupport { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-undertow/src/data/message1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | James 4 | Strachan 5 | London 6 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-undertow/src/data/message2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hiram 4 | Chirino 5 | Tampa 6 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-undertow/src/data/message3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Jonathan 4 | Anstey 5 | St. John's 6 | 7 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-undertow/src/main/resources/META-INF/spring/camel-context.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-undertow/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used during tests.. 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | #log4j.logger.org.apache.camel=INFO 7 | 8 | # CONSOLE appender not used by default 9 | log4j.appender.out=org.apache.log4j.ConsoleAppender 10 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 12 | 13 | # File appender 14 | log4j.appender.file=org.apache.log4j.FileAppender 15 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.file.file=target/file.log 17 | log4j.appender.file.append=true 18 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-web/src/data/message1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | James 4 | Strachan 5 | London 6 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-web/src/data/message2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hiram 4 | Chirino 5 | Tampa 6 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-web/src/data/message3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Jonathan 4 | Anstey 5 | St. John's 6 | 7 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-web/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used during tests.. 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | #log4j.logger.org.apache.camel=INFO 7 | 8 | # CONSOLE appender not used by default 9 | log4j.appender.out=org.apache.log4j.ConsoleAppender 10 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 12 | 13 | # File appender 14 | log4j.appender.file=org.apache.log4j.FileAppender 15 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.file.file=target/file.log 17 | log4j.appender.file.append=true 18 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-web/src/main/webapp/WEB-INF/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/camel-web/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /4_Camel_Project_Development/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | camel 7 | com.redhat.gpte.training 8 | 1.0 9 | 10 | 4.0.0 11 | 12 | camel-lab-4 13 | RedHat GPTE Training :: Camel :: Lab :: 4 :: Project 14 | pom 15 | 16 | 17 | camel-spring-standalone 18 | camel-standalone 19 | camel-test 20 | camel-web 21 | camel-undertow 22 | 23 | 24 | -------------------------------------------------------------------------------- /5_Components/camel-rest/src/main/data/marvel_ids.txt: -------------------------------------------------------------------------------- 1 | 1009610,1009726,1009351,1009368,1009165 -------------------------------------------------------------------------------- /5_Components/camel-rest/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /5_Components/camel-rest/src/main/resources/META-INF/spring/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /5_Components/camel-rest/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /5_Components/camel-rest/src/main/resources/marvel.properties: -------------------------------------------------------------------------------- 1 | apiKey=108f278315cda02a5803401df0c0ee4a 2 | privateKey=a921cbf3c04d7b44b934279888a15ff34a9c8c5e -------------------------------------------------------------------------------- /5_Components/camel-sql/src/main/data/sql-records.txt: -------------------------------------------------------------------------------- 1 | 5;'Apache CXF';'ASF' 2 | 6;'JBoss Hibernate';'LGPL' 3 | 7;'JBoss WildFly';'GPL' 4 | 8;'Apache Deltaspike';'ASF' 5 | 9;'JBoss Drools';'ASF' 6 | 10;'JBoss Arquillian';'ASF' -------------------------------------------------------------------------------- /5_Components/camel-sql/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /5_Components/camel-sql/src/main/resources/META-INF/spring/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /5_Components/camel-sql/src/main/resources/META-INF/spring/spring-database.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /5_Components/camel-sql/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /5_Components/camel-sql/src/main/resources/sql/db-schema.sql: -------------------------------------------------------------------------------- 1 | create table projects ( 2 | id integer primary key, 3 | project varchar(50), 4 | license varchar(5) 5 | ); 6 | insert into projects values (1, 'Apache Camel', 'ASF'); 7 | insert into projects values (2, 'Apache ActiveMQ', 'ASF'); 8 | insert into projects values (3, 'Apache Karaf', 'ASF'); 9 | insert into projects values (4, 'JBoss Fabric8', 'ASF'); -------------------------------------------------------------------------------- /5_Components/camel-webservice/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /5_Components/camel-webservice/src/main/resources/META-INF/spring/spring-camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /5_Components/camel-webservice/src/main/resources/data/curl_requests.txt: -------------------------------------------------------------------------------- 1 | curl -X POST --header "content-type: text/xml" --header "SOAPAction:http://training.gpte.redhat.com/getAllCustomers" --data @soap-getAllCustomers.xml http://0.0.0.0:9090/training/WebService 2 | curl -X POST --header "content-type: text/xml" --header "SOAPAction:http://training.gpte.redhat.com/getCustomerByName" --data @soap-getCustomerByName.xml http://0.0.0.0:9090/training/WebService 3 | curl -X POST --header "content-type: text/xml" --header "SOAPAction:http://training.gpte.redhat.com/saveCustomer" --data @soap-saveCustomer.xml http://0.0.0.0:9090/training/WebService -------------------------------------------------------------------------------- /5_Components/camel-webservice/src/main/resources/data/soap-getAllCustomers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /5_Components/camel-webservice/src/main/resources/data/soap-getCustomerByName.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | redhat 6 | 7 | 8 | -------------------------------------------------------------------------------- /5_Components/camel-webservice/src/main/resources/data/soap-saveCustomer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Foo 7 |
my address 123
8 | 589 9 | 2750.0 10 | 100.0 11 | PRIVATE 12 |
13 |
14 |
15 |
-------------------------------------------------------------------------------- /5_Components/camel-webservice/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /5_Components/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | camel 7 | com.redhat.gpte.training 8 | 1.0 9 | 10 | 4.0.0 11 | 12 | camel-lab-5 13 | RedHat GPTE Training :: Camel :: Lab :: 5 :: Project 14 | pom 15 | 16 | 17 | camel-webservice 18 | camel-sql 19 | camel-rest 20 | 21 | 22 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-aggregator/src/main/data/in/EUPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | EUR 7 | 8 | 9 | chad-EUR 10 | jeff 11 | 1000000.0 12 | 13 | 14 | jeff-EUR 15 | chad 16 | 20.0 17 | 18 | 19 | bernard-EUR 20 | chad 21 | 42.0 22 | 23 | 24 | hong-EUR 25 | jeff 26 | 12345.0 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-aggregator/src/main/data/in/USPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | USD 7 | 8 | 9 | chad-USD 10 | jeff 11 | 1000000.0 12 | 13 | 14 | rachel-USD 15 | chad 16 | 78.0 17 | 18 | 19 | rachel-USD 20 | chad 21 | 13.0 22 | 23 | 24 | jingjing-USD 25 | jeff 26 | 10.0 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-aggregator/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-aggregator/src/main/java/com/redhat/gpte/training/camel/BodyAppenderAggregator.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.impl.DefaultExchange; 5 | import org.apache.camel.processor.aggregate.AggregationStrategy; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | public class BodyAppenderAggregator implements AggregationStrategy { 10 | private static final Logger LOG = LoggerFactory.getLogger(BodyAppenderAggregator.class); 11 | 12 | @Override 13 | public Exchange aggregate( Exchange oldExchange, Exchange newExchange ) { 14 | LOG.info("Old: " + (oldExchange == null ? "null" : oldExchange.getIn().getBody()) + ", new: " + newExchange.getIn().getBody()); 15 | if( oldExchange == null ) { 16 | return null; 17 | } else { 18 | return oldExchange; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-aggregator/src/main/java/com/redhat/gpte/training/camel/route/PaymentsAggregatorRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel.route; 2 | 3 | import com.redhat.gpte.training.camel.BodyAppenderAggregator; 4 | import org.apache.camel.Endpoint; 5 | import org.apache.camel.EndpointInject; 6 | import org.apache.camel.builder.RouteBuilder; 7 | import org.apache.camel.builder.xml.Namespaces; 8 | 9 | /** 10 | * This class defines a Camel Route that takes all files from a given directory 11 | * reads out their XML payments and splits them into single payments. Then it 12 | * will aggregate the individual payments into a new file ordered by the 13 | * receiver of the payment within the given timeout period. 14 | */ 15 | public class PaymentsAggregatorRoute extends RouteBuilder { 16 | 17 | @EndpointInject(ref = "sourceEndpoint") 18 | private Endpoint sourceUri; 19 | 20 | @EndpointInject(ref = "destinationEndpoint") 21 | private Endpoint destinationUri; 22 | 23 | private int aggregateTimeoutPeriodInSeconds = 5; 24 | 25 | @Override 26 | public void configure() throws Exception { 27 | 28 | // Define the namespace for the Payment XML 29 | Namespaces ns = new Namespaces("p", "http://training.gpte.redhat.com/payment") 30 | .add("xsd", "http://www.w3.org/2001/XMLSchema"); 31 | 32 | from(sourceUri).to("ADD_SPLITTER_AND_AGGREGATOR").to(destinationUri); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-aggregator/src/main/resources/META-INF/spring/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | com.redhat.gpte.training.camel.route 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-aggregator/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-aggregator/src/main/resources/xsd/Payment.xsd: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/data/in/csv/EUPayments.txt: -------------------------------------------------------------------------------- 1 | 12345467, 43211234, 10000.0 2 | 34563456, 87989877, 10000.0 -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/data/in/csv/USPayments.txt: -------------------------------------------------------------------------------- 1 | 00700700, 00100100, 10000.0 2 | 56565656, 89898989, 10000.0 -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/data/in/xml/EUPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | EUR 7 | 8 | 9 | ade 10 | jack 11 | 1000000.0 12 | 13 | 14 | jack 15 | jill 16 | 20.0 17 | 18 | 19 | ade 20 | jill 21 | 42.0 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/data/in/xml/USPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | USD 7 | 8 | 9 | paul 10 | ade 11 | 1000000.0 12 | 13 | 14 | daan 15 | jack 16 | 78.0 17 | 18 | 19 | pat 20 | jill 21 | 13.0 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/data/in/xml/UnknownPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ??? 7 | 8 | 9 | paul 10 | ade 11 | 1000000.0 12 | 13 | 14 | daan 15 | ade 16 | 78.0 17 | 18 | 19 | pat 20 | ade 21 | 13.0 22 | 23 | 24 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/java/com/redhat/gpte/training/camel/SimpleCBRRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.Endpoint; 4 | import org.apache.camel.EndpointInject; 5 | import org.apache.camel.builder.RouteBuilder; 6 | 7 | public class SimpleCBRRoute extends RouteBuilder { 8 | 9 | // @EndpointInject(ref="sourceDirectoryCsv") 10 | Endpoint sourceUri; 11 | 12 | // @EndpointInject(ref="euroSinkCsv") 13 | Endpoint euroSinkUri; 14 | 15 | // @EndpointInject(ref="usdSinkCsv") 16 | Endpoint usdSinkUri; 17 | 18 | // @EndpointInject(ref="otherSinkCsv") 19 | Endpoint otherSinkUri; 20 | 21 | @Override 22 | public void configure() throws Exception { 23 | 24 | from(sourceUri).to("ADD_CBR"); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/java/com/redhat/gpte/training/camel/XpathCBRRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.Endpoint; 4 | import org.apache.camel.EndpointInject; 5 | import org.apache.camel.builder.RouteBuilder; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | public class XpathCBRRoute extends RouteBuilder { 10 | 11 | private static final Logger logger = LoggerFactory.getLogger( XpathCBRRoute.class ); 12 | 13 | @EndpointInject(ref="sourceDirectoryXml") 14 | Endpoint sourceUri; 15 | 16 | @EndpointInject(ref="euroSinkXml") 17 | Endpoint euroSinkUri; 18 | 19 | @EndpointInject(ref="usdSinkXml") 20 | Endpoint usdSinkUri; 21 | 22 | @EndpointInject(ref="otherSinkXml") 23 | Endpoint otherSinkUri; 24 | 25 | public void configure() throws Exception { 26 | 27 | from( sourceUri ) 28 | .convertBodyTo(String.class) 29 | .choice() 30 | .when(xpath("/pay:Payments/pay:Currency = 'EUR'") 31 | .namespace("pay", "http://training.gpte.redhat.com/payment")) 32 | .log("This is an Euro Payment: ${file:onlyname}") 33 | .to(euroSinkUri) 34 | .when(xpath("/pay:Payments/pay:Currency = 'USD'") 35 | .namespace("pay", "http://training.gpte.redhat.com/payment")) 36 | .log("This is an USD Payment: ${file:onlyname}") 37 | .to(usdSinkUri) 38 | .otherwise() 39 | .log("This is an Other Currency Payment: ${file:onlyname}") 40 | .to(otherSinkUri); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/resources/META-INF/spring/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/resources/cbr.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Source 3 | # 4 | sourceDirectoryXmlUri=file:src/main/data/in/xml?noop=true 5 | sourceDirectoryCsvUri=file:src/main/data/in/csv?noop=true 6 | 7 | # 8 | # Destination 9 | # 10 | euroSinkXmlUri=file:src/main/data/out/xml/eur/?fileExist=Append&fileName=euro-${date:now:yyyyMMdd}.xml 11 | usdSinkXmlUri=file:src/main/data/out/xml/usd/?fileExist=Append&fileName=usd-${date:now:yyyyMMdd}.xml 12 | otherSinkXmlUri=file:src/main/data/out/xml/other/?fileExist=Append&fileName=other-${date:now:yyyyMMdd}.xml 13 | 14 | euroSinkCsvUri=file:src/main/data/out/csv/eur/?fileExist=Append&fileName=euro-${date:now:yyyyMMdd}.xml 15 | usdSinkCsvUri=file:src/main/data/out/csv/usd/?fileExist=Append&fileName=usd-${date:now:yyyyMMdd}.xml 16 | otherSinkCsvUri=file:src/main/data/out/csv/other/?fileExist=Append&fileName=other-${date:now:yyyyMMdd}.xml -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-cbr/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, stdout 2 | 3 | log4j.logger.org.apache.camel=INFO 4 | 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.stdout.threshold=TRACE 9 | 10 | # File appender 11 | log4j.appender.file=org.apache.log4j.FileAppender 12 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 13 | log4j.appender.file.file=target/camel-cbr.log 14 | log4j.appender.file.append=true 15 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 16 | 17 | # MDC 18 | #log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId} - %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-enricher/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-enricher/src/main/java/com/redhat/gpte/training/camel/EnricherRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.Endpoint; 4 | import org.apache.camel.EndpointInject; 5 | import org.apache.camel.ExchangePattern; 6 | import org.apache.camel.builder.RouteBuilder; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | public class EnricherRoute extends RouteBuilder { 11 | 12 | private static SampleAggregator aggregationStrategy = new SampleAggregator(); 13 | 14 | public void configure() throws Exception { 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-enricher/src/main/java/com/redhat/gpte/training/camel/SampleAggregator.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.processor.aggregate.AggregationStrategy; 5 | 6 | public class SampleAggregator implements AggregationStrategy { 7 | 8 | public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { 9 | if (newExchange == null) { 10 | return oldExchange; 11 | } 12 | Object oldBody = oldExchange.getIn().getBody(); 13 | Object newBody = newExchange.getIn().getBody(); 14 | oldExchange.getIn().setBody(oldBody + ":" + newBody); 15 | return oldExchange; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-enricher/src/main/resources/META-INF/spring/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | com.redhat.gpte.training.camel 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-enricher/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, stdout 2 | 3 | log4j.logger.org.apache.camel=INFO 4 | 5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.stdout.threshold=TRACE 9 | 10 | # File appender 11 | log4j.appender.file=org.apache.log4j.FileAppender 12 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 13 | log4j.appender.file.file=target/camel-enrich.log 14 | log4j.appender.file.append=true 15 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 16 | 17 | # MDC 18 | #log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId} - %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-recipientlist/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-recipientlist/src/main/java/com/redhat/gpte/training/camel/RecipientRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | public class RecipientRoute extends RouteBuilder { 6 | 7 | public void configure() throws Exception { 8 | 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-recipientlist/src/main/resources/META-INF/spring/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | com.redhat.gpte.training.camel 12 | 13 | 14 | -------------------------------------------------------------------------------- /6_EIP_Patterns/camel-recipientlist/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.threshold=TRACE 7 | 8 | # File appender 9 | log4j.appender.file=org.apache.log4j.FileAppender 10 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.file.file=target/camel-recipient.log 12 | log4j.appender.file.append=true 13 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 14 | 15 | # MDC 16 | #log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %-10.10X{camel.breadcrumbId} - %-10.10X{camel.exchangeId} - %-10.10X{camel.correlationId} - %-10.10X{camel.routeId} - %m%n 17 | 18 | log4j.logger.org.apache.camel=INFO -------------------------------------------------------------------------------- /6_EIP_Patterns/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | camel 7 | com.redhat.gpte.training 8 | 1.0 9 | 10 | 4.0.0 11 | 12 | camel-lab-6 13 | RedHat GPTE Training :: Camel :: Lab :: 6 :: Project 14 | pom 15 | 16 | 17 | camel-aggregator 18 | camel-cbr 19 | camel-enricher 20 | camel-recipientlist 21 | 22 | 23 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/data/in/VariousEUPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | EUR 6 | 7 | ade 8 | jack 9 | 1000000.0 10 | 11 | 12 | jack 13 | jill 14 | 20.0 15 | 16 | 17 | ade 18 | jill 19 | 42.0 20 | 21 | 22 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/data/in/VariousUSPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | USD 6 | 7 | paul 8 | ade 9 | 1000000.0 10 | 11 | 12 | daan 13 | ade 14 | 78.0 15 | 16 | 17 | pat 18 | ade 19 | 13.0 20 | 21 | 22 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/data/in/VariousUnknownPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | ??? 6 | 7 | paul 8 | ade 9 | 1000000.0 10 | 11 | 12 | daan 13 | ade 14 | 78.0 15 | 16 | 17 | pat 18 | ade 19 | 13.0 20 | 21 | 22 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/data/out/VariousEUPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | EUR 4 | 5 | ade 6 | jack 7 | 1000000.0 8 | 9 | 10 | jack 11 | jill 12 | 20.0 13 | 14 | 15 | ade 16 | jill 17 | 42.0 18 | 19 | 20 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/data/out/VariousUSPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | USD 4 | 5 | paul 6 | ade 7 | 1000000.0 8 | 9 | 10 | daan 11 | ade 12 | 78.0 13 | 14 | 15 | pat 16 | ade 17 | 13.0 18 | 19 | 20 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/resources/sql/db-demo-setup-h2.sql: -------------------------------------------------------------------------------- 1 | -- This Script only works if executed in a H2 shell otherwise create the user and Database as 2 | -- mentioned below, connect to them and open the SQL Editor to execute the Create Table statements 3 | 4 | -- Connect to H2 using this connection : jdbc:h2:tcp://localhost:9123/jbossfuse-demo 5 | 6 | DROP TABLE "Payments"; 7 | 8 | CREATE TABLE "Payments" 9 | ( 10 | "from" character varying(32), 11 | "to" character varying(32), 12 | "amount" double precision, 13 | "currency" character varying(32), 14 | id serial NOT NULL, 15 | CONSTRAINT primke PRIMARY KEY (id) 16 | ); 17 | 18 | DROP TABLE "ProcessedPayments"; 19 | 20 | CREATE TABLE "ProcessedPayments" 21 | ( 22 | "paymentIdentifier" character varying(32), 23 | id serial NOT NULL, 24 | CONSTRAINT processedpaymentspk PRIMARY KEY (id) 25 | ); 26 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/resources/sql/db-demo-setup-mysql.sql: -------------------------------------------------------------------------------- 1 | -- First create a MySQL Database with schema name = fuse_demo 2 | -- Next run the following script 3 | 4 | DROP SCHEMA fuse_demo; 5 | 6 | CREATE SCHEMA fuse_demo; 7 | 8 | CREATE TABLE `fuse_demo`.`Payments` ( 9 | `id` INT NOT NULL AUTO_INCREMENT , 10 | `from` VARCHAR(32) NULL , 11 | `to` VARCHAR(32) NULL , 12 | `amount` DOUBLE NULL , 13 | `currency` VARCHAR(32) NULL , 14 | PRIMARY KEY (`id`) ); 15 | 16 | CREATE TABLE `fuse_demo`.`ProcessedPayments` ( 17 | `id` INT NOT NULL AUTO_INCREMENT , 18 | `paymentIdentifier` VARCHAR(32) NULL , 19 | PRIMARY KEY (`id`) ); 20 | 21 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/resources/sql/db-demo-setup-postgresql.sql: -------------------------------------------------------------------------------- 1 | -- This Script only works if executed in a PostgreSQL shell otherwise create the user and Database as 2 | -- mentioned below, connect to them and open the SQL Editor to execute the Create Table statements 3 | 4 | CREATE USER fuse_user CREATEDB PASSWORD 'fuse_user'; 5 | 6 | CREATE DATABASE fuse_demo WITH OWNER = fuse_user; 7 | 8 | \connect fuse_demo; 9 | 10 | -- The rest of that script can be executed in the SQL Editor with the 'fuse_demo' database selected or in the shell 11 | -- if there is a need to recreate the DB 12 | 13 | DROP TABLE "Payments"; 14 | 15 | CREATE TABLE "Payments" 16 | ( 17 | "from" character varying(32), 18 | "to" character varying(32), 19 | "amount" double precision, 20 | "currency" character varying(32), 21 | id serial NOT NULL, 22 | CONSTRAINT primke PRIMARY KEY (id) 23 | ) 24 | WITH (OIDS=FALSE); 25 | ALTER TABLE "Payments" OWNER TO fuse_user; 26 | 27 | DROP TABLE "ProcessedPayments"; 28 | 29 | CREATE TABLE "ProcessedPayments" 30 | ( 31 | "paymentIdentifier" character varying(32), 32 | id serial NOT NULL, 33 | CONSTRAINT processedpaymentspk PRIMARY KEY (id) 34 | ) 35 | WITH (OIDS=FALSE); 36 | ALTER TABLE "ProcessedPayments" OWNER TO fuse_user; 37 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/main/resources/xsd/Payment.xsd: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/test/resources/camel/in/VariousEUPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | EUR 6 | 7 | ade 8 | jack 9 | 1000000.0 10 | 11 | 12 | jack 13 | jill 14 | 20.0 15 | 16 | 17 | ade 18 | jill 19 | 42.0 20 | 21 | 22 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/test/resources/camel/in/VariousUSPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | USD 6 | 7 | paul 8 | ade 9 | 1000000.0 10 | 11 | 12 | daan 13 | ade 14 | 78.0 15 | 16 | 17 | pat 18 | ade 19 | 13.0 20 | 21 | 22 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/test/resources/camel/in/VariousUnknownPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | ??? 6 | 7 | paul 8 | ade 9 | 1000000.0 10 | 11 | 12 | daan 13 | ade 14 | 78.0 15 | 16 | 17 | pat 18 | ade 19 | 13.0 20 | 21 | 22 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/test/resources/camel/out/dummy.txt: -------------------------------------------------------------------------------- 1 | This file is just here so that Maven is not ignoring it and copies it into the target directory. -------------------------------------------------------------------------------- /7_Advanced_features/camel-jdbc-jms-transaction/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /7_Advanced_features/camel-jms-transaction/src/main/data/in/VariousEUPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | EUR 6 | 7 | ade 8 | jack 9 | 1000000.0 10 | 11 | 12 | jack 13 | jill 14 | 20.0 15 | 16 | 17 | ade 18 | jill 19 | 42.0 20 | 21 | 22 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jms-transaction/src/main/data/in/VariousUSPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | USD 6 | 7 | paul 8 | ade 9 | 1000000.0 10 | 11 | 12 | daan 13 | ade 14 | 78.0 15 | 16 | 17 | pat 18 | ade 19 | 13.0 20 | 21 | 22 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jms-transaction/src/main/data/in/VariousUnknownPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | ??? 6 | 7 | paul 8 | ade 9 | 1000000.0 10 | 11 | 12 | daan 13 | ade 14 | 78.0 15 | 16 | 17 | pat 18 | ade 19 | 13.0 20 | 21 | 22 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jms-transaction/src/main/data/out/VariousEUPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | EUR 4 | 5 | ade 6 | jack 7 | 1000000.0 8 | 9 | 10 | jack 11 | jill 12 | 20.0 13 | 14 | 15 | ade 16 | jill 17 | 42.0 18 | 19 | 20 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jms-transaction/src/main/data/out/VariousUSPayments.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | USD 4 | 5 | paul 6 | ade 7 | 1000000.0 8 | 9 | 10 | daan 11 | ade 12 | 78.0 13 | 14 | 15 | pat 16 | ade 17 | 13.0 18 | 19 | 20 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jms-transaction/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jms-transaction/src/main/java/com/redhat/gpte/training/camel/PaymentBean.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import com.redhat.training.payment.Payments; 4 | import org.apache.camel.Body; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | public class PaymentBean { 9 | 10 | private static final Logger LOG = LoggerFactory.getLogger(PaymentBean.class); 11 | 12 | public void validate(@Body Payments payments) throws Exception { 13 | if (payments.getCurrency().equals("???")) { 14 | LOG.warn("Rejecting payments file with currency '???'"); 15 | throw new Exception("Rejecting payments file with currency '???'"); 16 | } else { 17 | LOG.info("Message looks good."); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jms-transaction/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /7_Advanced_features/camel-jms-transaction/src/main/resources/xsd/Payment.xsd: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-jms-transaction/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout.ConversionPattern=%t %p [%c] - %m%n 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.threshold=TRACE 6 | 7 | #log4j.logger.org.springframework.osgi=DEBUG 8 | #log4j.logger.org.springframework=DEBUG 9 | log4j.logger.org.jboss.fuse=DEBUG -------------------------------------------------------------------------------- /7_Advanced_features/camel-mycomponent/src/main/java/com/redhat/gpte/training/camel/MyComponent.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import java.util.Map; 4 | 5 | import org.apache.camel.Endpoint; 6 | import org.apache.camel.impl.DefaultComponent; 7 | 8 | /** 9 | * Represents the component that manages {@link MyComponentEndpoint}. 10 | */ 11 | public class MyComponent extends DefaultComponent { 12 | 13 | protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception { 14 | return new MyComponentEndpoint(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-mycomponent/src/main/java/com/redhat/gpte/training/camel/MyComponentConsumer.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.Processor; 5 | import org.apache.camel.impl.ScheduledPollConsumer; 6 | 7 | /** 8 | * The MyComponent consumer. 9 | */ 10 | public class MyComponentConsumer extends ScheduledPollConsumer { 11 | 12 | private final MyComponentEndpoint endpoint; 13 | 14 | public MyComponentConsumer(MyComponentEndpoint endpoint, Processor processor) { 15 | super(endpoint, processor); 16 | this.endpoint = endpoint; 17 | } 18 | 19 | @Override 20 | protected int poll() throws Exception { 21 | Exchange exchange = endpoint.createExchange(); 22 | /* Set exchange body with a message */ 23 | 24 | try { 25 | // send message to next processor in the route 26 | getProcessor().process(exchange); 27 | return 1; // number of messages polled 28 | } finally { 29 | // log exception if an exception occurred and was not handled 30 | if (exchange.getException() != null) { 31 | getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException()); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-mycomponent/src/main/java/com/redhat/gpte/training/camel/MyComponentEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.Consumer; 4 | import org.apache.camel.Processor; 5 | import org.apache.camel.Producer; 6 | import org.apache.camel.impl.DefaultEndpoint; 7 | 8 | /** 9 | * Represents a MyComponent endpoint. 10 | */ 11 | public class MyComponentEndpoint extends DefaultEndpoint { 12 | 13 | public MyComponentEndpoint() {} 14 | 15 | public MyComponentEndpoint(String uri, MyComponent component) { 16 | super(uri, component); 17 | } 18 | 19 | public MyComponentEndpoint(String endpointUri) { 20 | super(endpointUri); 21 | } 22 | 23 | public Producer createProducer() throws Exception { 24 | return new MyComponentProducer(this); 25 | } 26 | 27 | public Consumer createConsumer(Processor processor) throws Exception { 28 | return new MyComponentConsumer(this, processor); 29 | } 30 | 31 | public boolean isSingleton() { 32 | return true; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-mycomponent/src/main/java/com/redhat/gpte/training/camel/MyComponentProducer.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.impl.DefaultProducer; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | /** 9 | * The MyComponent producer. 10 | */ 11 | public class MyComponentProducer extends DefaultProducer { 12 | 13 | private static final transient Logger LOG = LoggerFactory.getLogger(MyComponentProducer.class); 14 | 15 | private MyComponentEndpoint endpoint; 16 | 17 | public MyComponentProducer(MyComponentEndpoint endpoint) { 18 | super(endpoint); 19 | this.endpoint = endpoint; 20 | } 21 | 22 | @Override 23 | public void process(Exchange exchange) throws Exception { 24 | /* 25 | Enrich the exchange with the header ("MyHeader = foo") 26 | and append to the body the message " What a crazy exercise !" 27 | */ 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-mycomponent/src/test/java/com/redhat/gpte/training/camel/MyComponentTest.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.camel.Exchange; 6 | import org.apache.camel.builder.RouteBuilder; 7 | import org.apache.camel.component.mock.MockEndpoint; 8 | import org.apache.camel.test.junit4.CamelTestSupport; 9 | import org.junit.Test; 10 | 11 | public class MyComponentTest extends CamelTestSupport { 12 | /* 13 | @Test 14 | public void testMyComponent() throws Exception { 15 | 16 | MockEndpoint mock = getMockEndpoint("mock:result"); 17 | mock.expectedMinimumMessageCount(1); 18 | assertMockEndpointsSatisfied(); 19 | 20 | List exchanges = mock.getReceivedExchanges(); 21 | Exchange exchange = exchanges.get(0); 22 | String myHeader = (String) exchange.getIn().getHeader("MyHeader"); 23 | assertEquals("foo", myHeader); 24 | 25 | String result = (String) exchange.getIn().getBody(); 26 | assertEquals("Hello World! What a crazy exercise !", result); 27 | 28 | } 29 | 30 | @Override 31 | protected RouteBuilder createRouteBuilder() throws Exception { 32 | return new RouteBuilder() { 33 | public void configure() { 34 | from("mycomponent://foo") 35 | .to("mycomponent://bar") 36 | .to("mock:result"); 37 | } 38 | }; 39 | } 40 | */ 41 | } 42 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-mycomponent/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | # uncomment the following line to turn on Camel debugging 7 | #log4j.logger.org.apache.camel=DEBUG 8 | 9 | # CONSOLE appender not used by default 10 | log4j.appender.out=org.apache.log4j.ConsoleAppender 11 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n 13 | #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 14 | 15 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-routepolicy/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-routepolicy/src/main/java/com/redhat/gpte/training/camel/MyCustomRoutePolicy.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.Route; 5 | import org.apache.camel.impl.RoutePolicySupport; 6 | 7 | public class MyCustomRoutePolicy extends RoutePolicySupport { 8 | 9 | @SuppressWarnings("deprecation") 10 | @Override 11 | public void onExchangeBegin(Route route, Exchange exchange) { 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-routepolicy/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used during tests.. 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | #log4j.logger.org.apache.camel=INFO 7 | 8 | # CONSOLE appender not used by default 9 | log4j.appender.out=org.apache.log4j.ConsoleAppender 10 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 12 | 13 | # File appender 14 | log4j.appender.file=org.apache.log4j.FileAppender 15 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.file.file=target/file.log 17 | log4j.appender.file.append=true 18 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-routepolicy/src/main/resources/spring/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | com.redhat.gpte.training.camel 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-security/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-security/src/main/java/com/redhat/gpte/training/camel/JettySecuredRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | import org.apache.camel.main.Main; 5 | 6 | public class JettySecuredRoute extends RouteBuilder { 7 | 8 | public static void main(String[] args) throws Exception { 9 | Main main = new Main(); 10 | main.addRouteBuilder(new JettySecuredRoute()); 11 | // Bind the SecurityHandler with the key myAuthHandler 12 | main.enableHangupSupport(); 13 | main.start(); 14 | } 15 | 16 | @Override 17 | public void configure() throws Exception { 18 | 19 | // Add the Jetty Secured Route 20 | 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-security/src/main/java/com/redhat/gpte/training/camel/MySecurityHandler.java: -------------------------------------------------------------------------------- 1 | package com.redhat.gpte.training.camel; 2 | 3 | import org.eclipse.jetty.security.ConstraintMapping; 4 | import org.eclipse.jetty.security.ConstraintSecurityHandler; 5 | import org.eclipse.jetty.security.HashLoginService; 6 | import org.eclipse.jetty.security.authentication.BasicAuthenticator; 7 | import org.eclipse.jetty.util.security.Constraint; 8 | 9 | import java.util.Arrays; 10 | 11 | public class MySecurityHandler { 12 | 13 | public static ConstraintSecurityHandler generate() { 14 | Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, "user"); 15 | constraint.setAuthenticate(true); 16 | 17 | ConstraintMapping cm = new ConstraintMapping(); 18 | cm.setPathSpec("/*"); 19 | cm.setConstraint(constraint); 20 | 21 | ConstraintSecurityHandler sh = new ConstraintSecurityHandler(); 22 | sh.setAuthenticator(new BasicAuthenticator()); 23 | sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[]{cm})); 24 | 25 | HashLoginService loginService = new HashLoginService("MyRealm", "src/main/resources/myRealm.properties"); 26 | sh.setLoginService(loginService); 27 | sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[]{cm})); 28 | 29 | return sh; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-security/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used during tests.. 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | #log4j.logger.org.apache.camel=INFO 7 | 8 | # CONSOLE appender not used by default 9 | log4j.appender.out=org.apache.log4j.ConsoleAppender 10 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 12 | 13 | # File appender 14 | log4j.appender.file=org.apache.log4j.FileAppender 15 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.file.file=target/file.log 17 | log4j.appender.file.append=true 18 | log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 19 | 20 | -------------------------------------------------------------------------------- /7_Advanced_features/camel-security/src/main/resources/myRealm.properties: -------------------------------------------------------------------------------- 1 | donald: duck, user -------------------------------------------------------------------------------- /7_Advanced_features/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | camel 7 | com.redhat.gpte.training 8 | 1.0 9 | 10 | 4.0.0 11 | 12 | camel-lab-7 13 | RedHat GPTE Training :: Camel :: Lab :: 7 :: Project 14 | pom 15 | 16 | 17 | camel-jdbc-jms-transaction 18 | camel-jms-transaction 19 | camel-mycomponent 20 | camel-routepolicy 21 | camel-security 22 | 23 | 24 | -------------------------------------------------------------------------------- /8_REST_DSL/data/elasticsearch/backup.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "fs", 3 | "settings": { 4 | "location": "/Users/chmoulli/RedHat/GPTE/GPTE-Courses/fuse-lab/chm_backup", 5 | "compress": true 6 | } 7 | } -------------------------------------------------------------------------------- /8_REST_DSL/data/elasticsearch/entry.json: -------------------------------------------------------------------------------- 1 | { "id":"0", "user": "hong", "postDate": "2015-08-10T10:10", "body": "Integration is hard. Integration should be easy.", "title": "On distributed search" } 2 | -------------------------------------------------------------------------------- /8_REST_DSL/data/elasticsearch/mapping.json: -------------------------------------------------------------------------------- 1 | { 2 | "article": { 3 | "properties": { 4 | "user": { 5 | "type": "string" 6 | }, 7 | "title": { 8 | "type": "string" 9 | }, 10 | "postDate": { 11 | "type": "date", 12 | "format": "yyyy-MM-dd'T'HH:mm" 13 | }, 14 | "body": { 15 | "type": "string" 16 | }, 17 | "id": { 18 | "type": "integer" 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /8_REST_DSL/data/elasticsearch/query.json: -------------------------------------------------------------------------------- 1 | { 2 | "aggs" : { 3 | "articles_over_time" : { 4 | "date_histogram" : { 5 | "field" : "postDate", 6 | "interval" : "month" 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | Kibana3 Web App 8 | 9 | 10 | index.html 11 | 12 | 13 | -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var cors = require('cors'); 3 | 4 | var app = express(); 5 | 6 | // Enable CORS for all requests 7 | app.use(cors()); 8 | 9 | // allow serving of static files from the public directory 10 | app.use(express.static(__dirname)); 11 | 12 | var port = 9090; 13 | var host = '0.0.0.0'; 14 | var server = app.listen(port, host, function() { 15 | console.log("App started at: " + new Date() + " on port: " + port); 16 | }); 17 | -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/dashboards/blank.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "New Dashboard", 3 | "services": { 4 | "query": { 5 | "list": { 6 | "0": { 7 | "query": "*", 8 | "alias": "", 9 | "color": "#7EB26D", 10 | "id": 0 11 | } 12 | }, 13 | "ids": [ 14 | 0 15 | ] 16 | }, 17 | "filter": { 18 | "list": {}, 19 | "ids": [] 20 | } 21 | }, 22 | "rows": [ 23 | ], 24 | "editable": true, 25 | "failover": false, 26 | "index": { 27 | "interval": "none", 28 | "pattern": "[logstash-]YYYY.MM.DD", 29 | "default": "_all", 30 | "warm_fields": false 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/factories/store.js: -------------------------------------------------------------------------------- 1 | /*! kibana - v3.1.2 - 2014-11-07 2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */ 3 | 4 | define(["angular","lodash"],function(a,b){var c=a.module("kibana.factories");c.factory("storeFactory",function(){return function(a,c,d){if(!b.isFunction(a.$watch))throw new TypeError("Invalid scope.");if(!b.isString(c))throw new TypeError("Invalid name, expected a string that the is unique to this store.");if(d&&!b.isPlainObject(d))throw new TypeError("Invalid defaults, expected a simple object or nothing");d=d||{};var e=localStorage.getItem(c);if(null!=e)try{e=JSON.parse(e)}catch(f){e=null}if(null==e)e=b.clone(d);else{if(!b.isPlainObject(e))throw new TypeError("Invalid store value"+e);b.defaults(e,d)}return a[c]=e,a.$watch(c,function(e){void 0===e?(localStorage.removeItem(c),a[c]=b.clone(d)):localStorage.setItem(c,JSON.stringify(e))},!0),e}})}); -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/editor.html: -------------------------------------------------------------------------------- 1 |
Coordinate FieldgeoJSON array! Long,Lat NOT Lat,Long
Tooltip Field
Max Points
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/images/layers-2x.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/images/layers.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/images/marker-icon-2x.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/images/marker-icon.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/images/marker-shadow.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/leaflet.ie.css: -------------------------------------------------------------------------------- 1 | .leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{display:inline}.leaflet-popup-tip{width:21px;_width:27px;margin:0 auto;_margin-top:-3px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678, M12=.70710678, M21=-.70710678, M22=.70710678);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"}.leaflet-popup-tip-container{margin-top:-1px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{border:1px solid #999}.leaflet-popup-content-wrapper{zoom:1}.leaflet-control-zoom,.leaflet-control-layers{border:3px solid #999}.leaflet-control-layers-toggle{}.leaflet-control-attribution,.leaflet-control-layers,.leaflet-control-scale-line{background:#fff}.leaflet-zoom-box{filter:alpha(opacity=50)}.leaflet-control-attribution{border-top:1px solid #bbb;border-left:1px solid #bbb} -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/leaflet/plugins.css: -------------------------------------------------------------------------------- 1 | .leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{-webkit-transition:-webkit-transform .2s ease-out,opacity .2s ease-in;-moz-transition:-moz-transform .2s ease-out,opacity .2s ease-in;-o-transition:-o-transform .2s ease-out,opacity .2s ease-in;transition:transform .2s ease-out,opacity .2s ease-in}.marker-cluster-small{background-color:rgba(181,226,140,.6)}.marker-cluster-small div{background-color:rgba(110,204,57,.6)}.marker-cluster-medium{background-color:rgba(241,211,87,.6)}.marker-cluster-medium div{background-color:rgba(240,194,12,.6)}.marker-cluster-large{background-color:rgba(253,156,115,.6)}.marker-cluster-large div{background-color:rgba(241,128,23,.6)}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{width:30px;height:30px;margin-left:5px;margin-top:5px;text-align:center;border-radius:15px;font:12px "Helvetica Neue",Arial,Helvetica,sans-serif}.marker-cluster span{line-height:30px}.leaflet-label{background:#1f1f1f;background-clip:padding-box;border-radius:4px;border-style:solid;border-width:0;display:block;font-weight:200;font-size:11pt;padding:5px;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;z-index:99999!important}.leaflet-label:before{border-right:6px solid #000;border-right-color:inherit;border-top:6px solid transparent;border-bottom:6px solid transparent;content:"";position:absolute;top:5px;left:-10px;display:none} -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/module.css: -------------------------------------------------------------------------------- 1 | .leaflet-marker-icon{color:#333} -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/bettermap/module.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/column/editor.html: -------------------------------------------------------------------------------- 1 |

Add Panel to Column

Select Type

Panels

TitleTypeHeightDeleteMoveHide
{{app.title}}{{app.type}}
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/column/module.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/column/module.js: -------------------------------------------------------------------------------- 1 | /*! kibana - v3.1.2 - 2014-11-07 2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */ 3 | 4 | define("panels/column/module",["angular","app","lodash","config"],function(a,b,c,d){var e=a.module("kibana.panels.column",[]);b.useModule(e),e.controller("column",["$scope","$rootScope","$timeout",function(a,b,d){a.panelMeta={status:"Stable",description:"A pseudo panel that lets you add other panels to be arranged in a column withdefined heights."};var e={panels:[]};c.defaults(a.panel,e),a.init=function(){a.reset_panel()},a.toggle_row=function(b){b.collapse=b.collapse?!1:!0,b.collapse||d(function(){a.send_render()})},a.send_render=function(){a.$broadcast("render")},a.add_panel=function(a,b){a.panels.push(b)},a.reset_panel=function(b){a.new_panel={loading:!1,error:!1,sizeable:!1,draggable:!1,removable:!1,span:10,height:"150px",editable:!0,type:b}}}]),e.directive("columnEdit",["$compile","$timeout",function(b,d){return{scope:{new_panel:"=panel",row:"=",config:"=",dashboards:"=",type:"=type"},link:function(e,f){e.$on("render",function(){d(function(){e.panel=e.new_panel;var d="
";c.isUndefined(e.type)||""===e.type||(d=d+"
"),f.html(b(a.element(d))(e))})})}}}]),e.filter("withoutColumn",function(){return function(){return c.without(d.panel_names,"column")}})}); -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/column/panelgeneral.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/dashcontrol/module.html: -------------------------------------------------------------------------------- 1 |
This panel has been removed. Please use the dashboard controls in the top right and remove this panel from your dashboard
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/derivequeries/editor.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/derivequeries/module.html: -------------------------------------------------------------------------------- 1 |

This panel has been removed and replaced with the new topN query type. Click the colored dot associated with a query to configure the, much improved, equivilent of a derived query.

-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/derivequeries/module.js: -------------------------------------------------------------------------------- 1 | /*! kibana - v3.1.2 - 2014-11-07 2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */ 3 | 4 | define("panels/derivequeries/module",["angular","app","lodash"],function(a,b,c){var d=a.module("kibana.panels.derivequeries",[]);b.useModule(d),d.controller("derivequeries",["$scope",function(a){a.panelMeta={status:"Deprecated",description:"This panel has been replaced with the 'topN' mode in the query pull down."};var b={loading:!1,label:"Search",query:"*",ids:[],field:"_type",fields:[],spyable:!0,rest:!1,size:5,mode:"terms only",exclude:[],history:[],remember:10};c.defaults(a.panel,b),a.init=function(){a.editing=!1}}])}); -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/fields/editor.html: -------------------------------------------------------------------------------- 1 |
Popup Position
List Arrangement
Font Size
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/fields/micropanel.html: -------------------------------------------------------------------------------- 1 | ×

Micro Analysis of {{micropanel.field}}
{{micropanel.count}} events in the table set

{{micropanel.field}}ActionIn set
{{{true: "__blank__",false:field[0]}[field[0] == ""]}} {{field[1]}}
{{field}} ({{Math.round((count / micropanel.count) * 100)}}%), -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/fields/module.html: -------------------------------------------------------------------------------- 1 |

The 'fields' panel is deprecated.

The table panel now integrates a field selector.
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/fields/module.js: -------------------------------------------------------------------------------- 1 | /*! kibana - v3.1.2 - 2014-11-07 2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */ 3 | 4 | define("panels/fields/module",["angular","app","lodash"],function(a,b,c){var d=a.module("kibana.panels.fields",[]);b.useModule(d),d.controller("fields",["$scope",function(a){a.panelMeta={status:"Deprecated",description:"You should not use this table, it does not work anymore. The table panel nowintegrates a field selector. This module will soon be removed."};var b={style:{},arrange:"vertical",micropanel_position:"right"};c.defaults(a.panel,b),a.init=function(){}}])}); -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/filtering/editor.html: -------------------------------------------------------------------------------- 1 |
No options here
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/filtering/meta.html: -------------------------------------------------------------------------------- 1 |
×
Query Alias
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/filtering/module.js: -------------------------------------------------------------------------------- 1 | /*! kibana - v3.1.2 - 2014-11-07 2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */ 3 | 4 | define("panels/filtering/module",["angular","app","lodash"],function(a,b,c){var d=a.module("kibana.panels.filtering",[]);b.useModule(d),d.controller("filtering",["$scope","filterSrv","$rootScope","dashboard",function(a,b,d,e){a.panelMeta={status:"Stable",description:"A controllable list of all filters currently applied to the dashboard. You almost certainly want one of these on your dashboard somewhere."};var f={};c.defaults(a.panel,f),a.dashboard=e,a.$on("filter",function(){a.row.notice=!0}),a.init=function(){a.filterSrv=b},a.remove=function(a){b.remove(a)},a.toggle=function(a){e.current.services.filter.list[a].active=!e.current.services.filter.list[a].active,e.refresh()},a.add=function(a){a=a||"*",b.set({editing:!0,type:"querystring",query:a,mandate:"must"},void 0,!0)},a.refresh=function(){e.refresh()},a.render=function(){d.$broadcast("render")},a.show_key=function(a){return!c.contains(["type","id","alias","mandate","active","editing"],a)},a.getFilterClass=function(a){if(a.active!==!0)return"muted";switch(a.mandate){case"must":return"text-success";case"mustNot":return"text-error";case"either":return"text-warning";default:return"text-info"}},a.isEditable=function(a){var b=["time"];return c.contains(b,a.type)?!1:!0}}])}); -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/goal/editor.html: -------------------------------------------------------------------------------- 1 |
Parameters
View Options
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/goal/module.html: -------------------------------------------------------------------------------- 1 |
{{query.label}} ({{query.data[0][1]}})
{{query.label}} ({{query.data[0][1]}})
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/hits/editor.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/map/editor.html: -------------------------------------------------------------------------------- 1 |
Field2 letter country or state code
MaxMaximum countries to plot
Map
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/query/editor.html: -------------------------------------------------------------------------------- 1 |
No options here
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/query/editors/lucene.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/app/panels/query/editors/lucene.html -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/query/editors/regex.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/app/panels/query/editors/regex.html -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/query/editors/topN.html: -------------------------------------------------------------------------------- 1 |



-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/query/help/regex.html: -------------------------------------------------------------------------------- 1 | The regex query allows you to use regular expressions to match terms in the _all field. A detailed overview of lucene's regex engine is available here: Regular expressions in Elasticsearch
A note on anchoring
Lucene’s patterns are always anchored. The pattern provided must match the entire string. For string "abcde":

ab.* will match
abcd will not match

-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/query/help/topN.html: -------------------------------------------------------------------------------- 1 | The topN query uses an Elasticsearch terms facet to find the most common terms in a field and build queries from the result. The topN query uses LUCENE query string syntax

Parameters

  • Field / The field to facet on. Fields with a large number of unique terms will use more memory to calculate.
  • Count / How many queries to generate. The resulting queries will use brightness variations on the original query's color for their own.
  • Union / The relation the generated queries have to the original. For example, if your field was set to 'extension', your original query was "user:B.Awesome" and your union was AND. Kibana might generate the following example query: extension:"html" AND (user:B.Awesome)
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/query/helpModal.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/query/meta.html: -------------------------------------------------------------------------------- 1 |
 About the {{dashboard.current.services.query.list[id].type}} query

-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/query/query.css: -------------------------------------------------------------------------------- 1 | .short-query{display:inline-block;margin-right:10px}.short-query input.search-query{width:280px}.begin-query{position:absolute;left:10px;top:5px}.end-query{position:absolute;right:10px;top:5px}.end-query i,.begin-query i{margin:0}.panel-query{padding-left:25px!important;height:31px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.query-disabled{opacity:.3}.form-search:hover .has-remove{padding-left:40px!important}.remove-query{opacity:0}.last-query{padding-right:45px!important}.form-search:hover .remove-query{opacity:1}.query-panel .pinned{margin-right:5px} -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/sparklines/editor.html: -------------------------------------------------------------------------------- 1 |
Values
Transform Series
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/sparklines/module.html: -------------------------------------------------------------------------------- 1 |
{{series.info.alias}}
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/stats/module.html: -------------------------------------------------------------------------------- 1 |

{{data.value|formatstats:panel.format}} {{panel.unit}} ({{panel.mode}})

{{panel.label_name}}{{stat}}
{{item.label}}{{item.value[stat]|formatstats:panel.format}} {{panel.unit}}
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/table/modal.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/table/pagination.html: -------------------------------------------------------------------------------- 1 |
Show Controls
Overflow
Per Page
 
Page limit
Pageable
= {{panel.size * panel.pages}}
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/text/editor.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/text/module.html: -------------------------------------------------------------------------------- 1 |
{{panel.content}}

-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/timepicker/editor.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/timepicker/refreshctrl.html: -------------------------------------------------------------------------------- 1 |

-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/trends/editor.html: -------------------------------------------------------------------------------- 1 |

Settings

-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/panels/trends/module.html: -------------------------------------------------------------------------------- 1 |
{{query.percent}}% ({{query.info.alias}})
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/partials/connectionFailed.html: -------------------------------------------------------------------------------- 1 |

Connection Failed

Possibility #1: Your elasticsearch server is down or unreachable
This can be caused by a network outage, or a failure of the Elasticsearch process. If you have recently run a query that required a terms facet to be executed it is possible the process has run out of memory and stopped. Be sure to check your Elasticsearch logs for any sign of memory pressure.
Possibility #2: You are running Elasticsearch 1.4 or higher
Elasticsearch 1.4 ships with a security setting that prevents Kibana from connecting. You will need to set the following in your elasticsearch.yml:

  1. http.cors.enabled: true
  2. http.cors.allow-origin to the correct protocol, hostname, and port (if not 80) that your access Kibana from. Note that if you are running Kibana in a sub-url, you should exclude the sub-url path and only include the protocol, hostname and port. For example, http://mycompany.com:8080, not http://mycompany.com:8080/kibana.

Click back, or the home button, when you have resolved the connection issue

-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/partials/dashLoaderShare.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/partials/inspector.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/partials/load.html: -------------------------------------------------------------------------------- 1 |
type:{{type}}
id:{{id}}
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/partials/modal.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/partials/paneladd.html: -------------------------------------------------------------------------------- 1 |
{{tab.title}}
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/partials/paneleditor.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/partials/panelgeneral.html: -------------------------------------------------------------------------------- 1 |
{{panelMeta.status}} //
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/app/partials/querySelect.html: -------------------------------------------------------------------------------- 1 |
{{querySrv.list()[id].alias || querySrv.list()[id].query}}
-------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/favicon.ico -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/font/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/font/FontAwesome.otf -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/img/annotation-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/img/annotation-icon.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/img/cubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/img/cubes.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/img/kibana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/img/kibana.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/img/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/img/light.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/img/load.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/img/load.gif -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/img/load_big.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/img/load_big.gif -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/img/small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/kibana/src/main/webapp/img/small.png -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kibana-node", 3 | "private": true, 4 | "version": "0.1.0", 5 | "dependencies": { 6 | "express": "4.0.0", 7 | "body-parser": "1.14.1", 8 | "cors": "2.2.0" 9 | }, 10 | "engines": { 11 | "node": ">=0.8.0" 12 | }, 13 | "scripts": {}, 14 | "license": "Apache-2.0" 15 | } 16 | -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/vendor/require/css-build.js: -------------------------------------------------------------------------------- 1 | /*! kibana - v3.1.2 - 2014-11-07 2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */ 3 | 4 | define([],function(){function a(a,b){var d=c.readFileSync(a,"utf8");0===d.indexOf("")&&(d=d.substring(1)),b(d)}function b(a){return a.replace(/[\r\n]+/g," ").replace(/[\t]/g," ")}var c=require.nodeRequire("fs"),d={},e=!1,f={load:function(c,e,f,g){f(!0),a(g.baseUrl+c,function(a){d[c]=b(a)})},write:function(a,b,c){e||(e=!0,c("define('"+a+"-embed', function()\n{\n function embed_css(content)\n {\n var head = document.getElementsByTagName('head')[0],\n style = document.createElement('style'),\n rules = document.createTextNode(content);\n style.type = 'text/css';\n if(style.styleSheet)\n style.styleSheet.cssText = rules.nodeValue;\n else style.appendChild(rules);\n head.appendChild(style);\n }\n return embed_css;\n});\n")),c("define('"+a+"!"+b+"', ['"+a+"-embed'], \nfunction(embed)\n{\n embed(\n '"+d[b].replace(/'/g,"\\'")+"'\n );\n return true;\n});\n")},writeFile:function(){},onLayerEnd:function(){}};return f}); -------------------------------------------------------------------------------- /8_REST_DSL/kibana/src/main/webapp/vendor/require/tmpl.js: -------------------------------------------------------------------------------- 1 | /*! kibana - v3.1.2 - 2014-11-07 2 | * Copyright (c) 2014 Rashid Khan; Licensed Apache License */ 3 | 4 | define(["module"],function(a){var b=a.config&&a.config()||{};return{load:function(a,c,d){var e=c.toUrl(a);c(["text!"+a],function(a){b.registerTemplate&&b.registerTemplate(e,a),d(a)})}}}); -------------------------------------------------------------------------------- /8_REST_DSL/routing/src/main/fabric8/Readme.md: -------------------------------------------------------------------------------- 1 | # GPTE JBoss Fuse Lab 2 | 3 | This JBoss Fuse lab will demonstrate how the new Apache Camel REST DSL syntax can be used to expose REST Services that we will use to add, search or delete 4 | articles for a blog into a nosql Elasticsearch database. The use case has been enriched to expose a file endpoint, as you can see within the following picture, which 5 | is responsible to poll a folder, to consumes csv files and insert all the articles into the database. The Apache Camel Elasticsearch component is called from different routes 6 | and will communicate with the ElasticSearch Database to perform the CRUD operations. 7 | 8 | [](fuse-lab1.png) 9 | 10 | The Elasticsearch database and the Apache Camel projects will be deployed into different Fuse Managed Containers operated by a JBoss Fuse Fabric Server. 11 | 12 | The CRUD services can be accessed using the new Camel REST component and the file component. To do a bulk import of articles, you will create a CSV file containing this 13 | record structure `id,user,blog description,title`. All the records will be uploaded by the file endpoint, transformed using the `Apache Camel Bindy` Dataformat to a collection of Blog objects. 14 | Next, each Blog object will be used as input to issue a request to insert a new record within the Elasticsearch database. 15 | 16 | For the REST Service, a JSON article `{ "user": "hong" "postDate": "2015-12-12", "body": "Integration is hard.", "title": "On distributed search" }` message is expected by the Jetty REST endpoint `/blog/article/id` 17 | The body content will be used as input to also issue a request to the same Service used by the file endpoint to consume CSV records. 18 | -------------------------------------------------------------------------------- /8_REST_DSL/routing/src/main/fabric8/fuse-lab1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/routing/src/main/fabric8/fuse-lab1.png -------------------------------------------------------------------------------- /8_REST_DSL/routing/src/main/fabric8/org.jboss.fuse.demo.properties: -------------------------------------------------------------------------------- 1 | clustername=insight 2 | address=localhost 3 | port=9200 4 | indexname=blog 5 | indextype=post 6 | fileUri=file://articles?noop=true -------------------------------------------------------------------------------- /8_REST_DSL/routing/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /8_REST_DSL/routing/src/main/java/org/jboss/fuse/route/FileToAddServiceRoute.java: -------------------------------------------------------------------------------- 1 | package org.jboss.fuse.route; 2 | 3 | import org.jboss.fuse.model.Blog; 4 | import org.apache.camel.LoggingLevel; 5 | import org.apache.camel.builder.RouteBuilder; 6 | import org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat; 7 | import org.elasticsearch.client.transport.NoNodeAvailableException; 8 | 9 | public class FileToAddServiceRoute extends RouteBuilder { 10 | @Override 11 | public void configure() throws Exception { 12 | 13 | BindyCsvDataFormat csv = new BindyCsvDataFormat(Blog.class); 14 | 15 | from("{{fileUri}}").id(("file-marshal-split-service")) 16 | .onException(NoNodeAvailableException.class).maximumRedeliveries(2).to("direct://error").handled(true).end() 17 | .log(LoggingLevel.DEBUG, "Records received : ${body}") 18 | .unmarshal(csv) 19 | .split(body()) 20 | .setHeader("id").simple("${body.id}") 21 | .to("direct:add"); 22 | 23 | from("direct://error") 24 | .log("No node Elasticsearch server is available"); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /8_REST_DSL/routing/src/main/java/org/jboss/fuse/route/OnExceptionElasticSearch.java: -------------------------------------------------------------------------------- 1 | package org.jboss.fuse.route; 2 | 3 | import org.jboss.fuse.service.ElasticSearchService; 4 | import org.apache.camel.Exchange; 5 | import org.apache.camel.builder.RouteBuilder; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | public abstract class OnExceptionElasticSearch extends RouteBuilder { 10 | 11 | final static Logger LOG = LoggerFactory.getLogger(ElasticSearchService.class); 12 | 13 | @Override 14 | public void configure() throws Exception { 15 | 16 | onException(org.elasticsearch.client.transport.NoNodeAvailableException.class) 17 | .handled(true) 18 | .setBody().constant("ElasticSearch server is not available, not started, network issue , ... ") 19 | .setHeader(Exchange.CONTENT_TYPE).constant("text/plain") 20 | .setHeader(Exchange.HTTP_RESPONSE_CODE).constant(400) 21 | .log(">> Exception message : ${exception.message}") 22 | .log(">> Stack trace : ${exception.stacktrace}"); 23 | 24 | onException(org.elasticsearch.indices.IndexMissingException.class) 25 | .handled(true) 26 | .setBody().constant("The [blog] index is missing into the Elasticsearch Database") 27 | .setHeader(Exchange.CONTENT_TYPE).constant("text/plain") 28 | .setHeader(Exchange.HTTP_RESPONSE_CODE).constant(400) 29 | .log(">> Exception message : ${exception.message}") 30 | .log(">> Stack trace : ${exception.stacktrace}"); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /8_REST_DSL/routing/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | org.jboss.fuse.route 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /8_REST_DSL/routing/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used for testing 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | log4j.logger.org.apache.camel=INFO 7 | # log4j.org.apache.camel.component.elasticsearch=INFO 8 | # log4j.logger.org.apache.camel.impl.DefaultCamelContext=DEBUG 9 | 10 | # CONSOLE appender not used by default 11 | log4j.appender.out=org.apache.log4j.ConsoleAppender 12 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 13 | log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n 14 | #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 15 | 16 | # File appender 17 | log4j.appender.file=org.apache.log4j.FileAppender 18 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 19 | log4j.appender.file.layout.ConversionPattern=%d %-5p %c{1} - %m %n 20 | log4j.appender.file.file=target/camel.log -------------------------------------------------------------------------------- /8_REST_DSL/script/src/main/resources/demo-install.script: -------------------------------------------------------------------------------- 1 | fabric:create --clean -m 127.0.0.1 -r manualip --wait-for-provisioning 2 | 3 | fabric:profile-edit --pid io.fabric8.elasticsearch-insight/network.host=127.0.0.1 insight-elasticsearch.datastore 4 | 5 | fabric:container-create-child --profile insight-elasticsearch.datastore root elasticsearch-node 6 | fabric:container-create-child --profile feature-camel root demo -------------------------------------------------------------------------------- /8_REST_DSL/script/src/main/resources/io.fabric8.elasticsearch-insight.cfg: -------------------------------------------------------------------------------- 1 | network.host=127.0.0.1 -------------------------------------------------------------------------------- /8_REST_DSL/security/export-json-schema.txt: -------------------------------------------------------------------------------- 1 | # Doc 2 | 3 | Interesting links 4 | 5 | http://www.apiman.io/blog/gateway/security/oauth2/keycloak/authentication/authorization/2015/06/09/keycloak-oauth2.html 6 | https://keycloak.github.io/docs/userguide/html/direct-access-grants.html 7 | 8 | # Instructions to run Apiman & Keycloak 9 | 10 | mkdir ~/apiman-1.1.7.Final 11 | cd ~/apiman-1.1.7.Final 12 | curl http://downloads.jboss.org/wildfly/8.2.0.Final/wildfly-8.2.0.Final.zip -o wildfly-8.2.0.Final.zip 13 | curl http://downloads.jboss.org/apiman/1.1.7.Final/apiman-distro-wildfly8-1.1.7.Final-overlay.zip -o apiman-distro-wildfly8-1.1.7.Final-overlay.zip 14 | unzip wildfly-8.2.0.Final.zip 15 | unzip -o apiman-distro-wildfly8-1.1.7.Final-overlay.zip -d wildfly-8.2.0.Final 16 | cd wildfly-8.2.0.Final 17 | 18 | bin/standalone.sh -c standalone-apiman.xml 19 | 20 | # Instruction to export json config 21 | 22 | bin/standalone.sh -Dkeycloak.migration.action=export -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=demo.json -Dkeycloak.migration.realmName=demo -c standalone-apiman.xml -------------------------------------------------------------------------------- /8_REST_DSL/security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | camel-lab-8 7 | com.redhat.gpte 8 | 1.0 9 | 10 | 4.0.0 11 | 12 | security 13 | 14 | RedHat GPTE Training :: Camel :: Lab :: 8 :: Security 15 | 16 | 17 | -------------------------------------------------------------------------------- /8_REST_DSL/swagger/run_jetty.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # rm -rf src/main/webapp/* 4 | mvn clean 5 | mvn package 6 | mvn install 7 | 8 | mvn jetty:run 9 | 10 | -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used for testing 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | log4j.logger.org.eclipse.jetty.servlets=DEBUG 7 | # log4j.org.apache.camel.component.elasticsearch=INFO 8 | # log4j.logger.org.apache.camel.impl.DefaultCamelContext=DEBUG 9 | 10 | # CONSOLE appender not used by default 11 | log4j.appender.out=org.apache.log4j.ConsoleAppender 12 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 13 | log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n 14 | #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 15 | 16 | # File appender 17 | log4j.appender.file=org.apache.log4j.FileAppender 18 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 19 | log4j.appender.file.layout.ConversionPattern=%d %-5p %c{1} - %m %n 20 | log4j.appender.file.file=target/camel.log -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | CORSFilter 7 | org.jboss.fuse.CORSFilter 8 | 9 | 10 | 11 | CORSFilter 12 | /* 13 | 14 | 15 | -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/css/typography.css: -------------------------------------------------------------------------------- 1 | /* droid-sans-regular - latin */ 2 | @font-face { 3 | font-family: 'Droid Sans'; 4 | font-style: normal; 5 | font-weight: 400; 6 | src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */ 7 | src: local('Droid Sans'), local('DroidSans'), 8 | url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ 9 | url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ 10 | url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */ 11 | url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ 12 | url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */ 13 | } 14 | /* droid-sans-700 - latin */ 15 | @font-face { 16 | font-family: 'Droid Sans'; 17 | font-style: normal; 18 | font-weight: 700; 19 | src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */ 20 | src: local('Droid Sans Bold'), local('DroidSans-Bold'), 21 | url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ 22 | url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ 23 | url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */ 24 | url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ 25 | url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */ 26 | } 27 | -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.eot -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.ttf -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.woff -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-700.woff2 -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.eot -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.ttf -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.woff -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/fonts/droid-sans-v6-latin-regular.woff2 -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/images/explorer_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/images/explorer_icons.png -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/images/favicon-16x16.png -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/images/favicon-32x32.png -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/images/favicon.ico -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/images/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/images/logo_small.png -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/images/pet_store_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/images/pet_store_api.png -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/images/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/images/throbber.gif -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/images/wordnik_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpe-mw-training/camel-labs/083faf1b3d4376ddb6861d917fa52a845ffc6322/8_REST_DSL/swagger/src/main/webapp/images/wordnik_api.png -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/lang/translator.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Translator for documentation pages. 5 | * 6 | * To enable translation you should include one of language-files in your index.html 7 | * after . 8 | * For example - 9 | * 10 | * If you wish to translate some new texsts you should do two things: 11 | * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too. 12 | * 2. Mark that text it templates this way New Phrase or . 13 | * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate. 14 | * 15 | */ 16 | window.SwaggerTranslator = { 17 | 18 | _words:[], 19 | 20 | translate: function(sel) { 21 | var $this = this; 22 | sel = sel || '[data-sw-translate]'; 23 | 24 | $(sel).each(function() { 25 | $(this).html($this._tryTranslate($(this).html())); 26 | 27 | $(this).val($this._tryTranslate($(this).val())); 28 | $(this).attr('title', $this._tryTranslate($(this).attr('title'))); 29 | }); 30 | }, 31 | 32 | _tryTranslate: function(word) { 33 | return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word; 34 | }, 35 | 36 | learn: function(wordsMap) { 37 | this._words = wordsMap; 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/lib/jquery.slideto.min.js: -------------------------------------------------------------------------------- 1 | (function(b){b.fn.slideto=function(a){a=b.extend({slide_duration:"slow",highlight_duration:3E3,highlight:true,highlight_color:"#FFFF99"},a);return this.each(function(){obj=b(this);b("body").animate({scrollTop:obj.offset().top},a.slide_duration,function(){a.highlight&&b.ui.version&&obj.effect("highlight",{color:a.highlight_color},a.highlight_duration)})})}})(jQuery); 2 | -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/lib/jquery.wiggle.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | jQuery Wiggle 3 | Author: WonderGroup, Jordan Thomas 4 | URL: http://labs.wondergroup.com/demos/mini-ui/index.html 5 | License: MIT (http://en.wikipedia.org/wiki/MIT_License) 6 | */ 7 | jQuery.fn.wiggle=function(o){var d={speed:50,wiggles:3,travel:5,callback:null};var o=jQuery.extend(d,o);return this.each(function(){var cache=this;var wrap=jQuery(this).wrap('
').css("position","relative");var calls=0;for(i=1;i<=o.wiggles;i++){jQuery(this).animate({left:"-="+o.travel},o.speed).animate({left:"+="+o.travel*2},o.speed*2).animate({left:"-="+o.travel},o.speed,function(){calls++;if(jQuery(cache).parent().hasClass('wiggle-wrap')){jQuery(cache).parent().replaceWith(cache);} 8 | if(calls==o.wiggles&&jQuery.isFunction(o.callback)){o.callback();}});}});}; -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The logging properties used for testing 3 | # 4 | log4j.rootLogger=INFO, out 5 | 6 | log4j.logger.org.eclipse.jetty.servlets=DEBUG 7 | # log4j.org.apache.camel.component.elasticsearch=INFO 8 | # log4j.logger.org.apache.camel.impl.DefaultCamelContext=DEBUG 9 | 10 | # CONSOLE appender not used by default 11 | log4j.appender.out=org.apache.log4j.ConsoleAppender 12 | log4j.appender.out.layout=org.apache.log4j.PatternLayout 13 | log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n 14 | #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n 15 | 16 | # File appender 17 | log4j.appender.file=org.apache.log4j.FileAppender 18 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 19 | log4j.appender.file.layout.ConversionPattern=%d %-5p %c{1} - %m %n 20 | log4j.appender.file.file=target/camel.log -------------------------------------------------------------------------------- /8_REST_DSL/swagger/src/main/webapp/o2c.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /9_Camel-K/RestWithRestlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | // 19 | // To run this integrations use: 20 | // 21 | // kamel run --name=rest-with-restlet --dependency=camel-restlet examples/RestWithRestlet.java 22 | // 23 | public class RestWithRestlet extends org.apache.camel.builder.RouteBuilder { 24 | @Override 25 | public void configure() throws Exception { 26 | restConfiguration() 27 | .component("restlet") 28 | .host("0.0.0.0") 29 | .port("8080"); 30 | 31 | rest() 32 | .get("/hello") 33 | .to("direct:hello"); 34 | 35 | from("direct:hello") 36 | .transform().simple("Hello World"); 37 | } 38 | } -------------------------------------------------------------------------------- /9_Camel-K/Sample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import org.apache.camel.builder.RouteBuilder; 19 | 20 | public class Sample extends RouteBuilder { 21 | @Override 22 | public void configure() throws Exception { 23 | from("timer:tick") 24 | .log("Hello Camel K!"); 25 | } 26 | } -------------------------------------------------------------------------------- /9_Camel-K/dns.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | // 17 | // To run this integrations use: 18 | // 19 | // kamel run -d camel:dns examples/dns.js 20 | // 21 | // Or simply (since dependency auto-detection is enabled by default): 22 | // 23 | // kamel run examples/dns.js 24 | // 25 | 26 | from('timer:dns?period=1s') 27 | .routeId('dns') 28 | .setHeader('dns.domain') 29 | .constant('www.google.com') 30 | .to('dns:ip') 31 | .to('log:dns'); 32 | -------------------------------------------------------------------------------- /9_Camel-K/feed.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | from('timer:clock?period=3s') 19 | .setBody().constant("Hello World from Camel K") 20 | .to('knative:channel/messages') 21 | .log('sent message to messages channel') -------------------------------------------------------------------------------- /9_Camel-K/greetings-api.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger" : "2.0", 3 | "info" : { 4 | "version" : "1.0", 5 | "title" : "Greeting REST API" 6 | }, 7 | "host" : "", 8 | "basePath" : "/camel/", 9 | "tags" : [ { 10 | "name" : "greetings", 11 | "description" : "Greeting to {name}" 12 | } ], 13 | "schemes" : [ "http" ], 14 | "paths" : { 15 | "/greetings/{name}" : { 16 | "get" : { 17 | "tags" : [ "greetings" ], 18 | "operationId" : "greeting-api", 19 | "parameters" : [ { 20 | "name" : "name", 21 | "in" : "path", 22 | "required" : true, 23 | "type" : "string" 24 | } ], 25 | "responses" : { 26 | "200" : { 27 | "description" : "Output type", 28 | "schema" : { 29 | "$ref" : "#/definitions/Greetings" 30 | } 31 | } 32 | } 33 | } 34 | } 35 | }, 36 | "definitions" : { 37 | "Greetings" : { 38 | "type" : "object", 39 | "properties" : { 40 | "greetings" : { 41 | "type" : "string" 42 | } 43 | } 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /9_Camel-K/greetings.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | // 19 | // kamel run --dev --name greetings --dependency camel-undertow --property camel.rest.port=8080 --open-api examples/greetings-api.json --logging-level org.apache.camel.k=DEBUG examples/greetings.groovy 20 | // 21 | 22 | from('direct:greeting-api') 23 | .to('log:api?showAll=true&multiline=true') 24 | .setBody() 25 | .simple('Hello from ${headers.name}') 26 | -------------------------------------------------------------------------------- /9_Camel-K/hello.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 24 | 25 | Hello World!!! 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /9_Camel-K/kotlin-routes.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | // 19 | // To run this integrations use: 20 | // 21 | // kamel run --runtime kotlin examples/kotlin-routes.kts 22 | // 23 | // Or leveraging runtime detection 24 | // 25 | // kamel run examples/kotlin-routes.kts 26 | // 27 | 28 | val rnd = java.util.Random() 29 | 30 | from("timer:kotlin?period=1s") 31 | .routeId("kotlin") 32 | .setBody() 33 | .constant("Hello Camel K!") 34 | .process().message { 35 | it.headers["RandomValue"] = rnd.nextInt() 36 | } 37 | .to("log:info?showAll=true&multiline=true") -------------------------------------------------------------------------------- /9_Camel-K/messages-channel.yaml: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # --------------------------------------------------------------------------- 17 | 18 | apiVersion: eventing.knative.dev/v1alpha1 19 | kind: Channel 20 | metadata: 21 | name: messages 22 | spec: 23 | provisioner: 24 | apiVersion: eventing.knative.dev/v1alpha1 25 | kind: ClusterChannelProvisioner 26 | name: in-memory -------------------------------------------------------------------------------- /9_Camel-K/printer.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | from('knative:channel/words') 19 | .convertBodyTo(String.class) 20 | .to('log:info') 21 | -------------------------------------------------------------------------------- /9_Camel-K/props.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | // 17 | // To run this integrations use: 18 | // 19 | // kamel run -p my.message=test-props examples/props.js 20 | // 21 | 22 | from('timer:props?period=1s') 23 | .routeId('props') 24 | .log('{{my.message}}') -------------------------------------------------------------------------------- /9_Camel-K/reader.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | from('knative:endpoint/messages') 19 | .log('got ${body}') -------------------------------------------------------------------------------- /9_Camel-K/resources-data.txt: -------------------------------------------------------------------------------- 1 | the file body -------------------------------------------------------------------------------- /9_Camel-K/resources-route.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | // 19 | // To run this integrations use: 20 | // 21 | // kamel run --resource examples/resources-data.txt examples/resources-route.groovy 22 | // 23 | 24 | from('timer:resources') 25 | .routeId('resources') 26 | .setBody() 27 | .simple("resource:classpath:resources-data.txt") 28 | .log('file content is: ${body}') 29 | -------------------------------------------------------------------------------- /9_Camel-K/routes.flow: -------------------------------------------------------------------------------- 1 | - steps: 2 | - kind: "endpoint" 3 | uri: "timer:tick?period=5s" 4 | - kind: "endpoint" 5 | uri: "log:info" 6 | -------------------------------------------------------------------------------- /9_Camel-K/routes.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | // **************** 17 | // 18 | // Setup 19 | // 20 | // **************** 21 | 22 | //l = components.get('log') 23 | //l.exchangeFormatter = function(e) { 24 | // return "log - body=" + e.in.body + ", headers=" + e.in.headers 25 | //} 26 | 27 | // **************** 28 | // 29 | // Functions 30 | // 31 | // **************** 32 | 33 | function proc(e) { 34 | e.getIn().setHeader('RandomValue', Math.floor((Math.random() * 100) + 1)) 35 | } 36 | 37 | // **************** 38 | // 39 | // Route 40 | // 41 | // **************** 42 | 43 | from('timer:js?period=1s') 44 | .routeId('js') 45 | .setBody() 46 | .constant('Hello Camel K') 47 | .process(proc) 48 | .to('log:info') -------------------------------------------------------------------------------- /9_Camel-K/simple.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | from('timer:groovy?period=1s') 19 | .routeId('groovy') 20 | .setBody() 21 | .simple('Hello Camel K from ${routeId}') 22 | .to('log:info?showAll=false') 23 | -------------------------------------------------------------------------------- /9_Camel-K/simple.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | from('timer:js?period=1s') 17 | .routeId('js') 18 | .setBody() 19 | .simple('Hello Camel K from ${routeId}') 20 | .to('log:info?multiline=true') -------------------------------------------------------------------------------- /9_Camel-K/splitter.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | from('knative:channel/messages') 19 | .split().tokenize(" ") 20 | .log('sending ${body} to words channel') 21 | .to('knative:channel/words') -------------------------------------------------------------------------------- /9_Camel-K/words-channel.yaml: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------- 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # --------------------------------------------------------------------------- 17 | 18 | apiVersion: eventing.knative.dev/v1alpha1 19 | kind: Channel 20 | metadata: 21 | name: words 22 | spec: 23 | provisioner: 24 | apiVersion: eventing.knative.dev/v1alpha1 25 | kind: ClusterChannelProvisioner 26 | name: in-memory -------------------------------------------------------------------------------- /9_Camel-K/writer.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | from('timer:messages?period=10s') 19 | .setBody().constant('the-body') 20 | .to('knative:endpoint/reader') --------------------------------------------------------------------------------