├── .asf.yaml ├── .github └── workflows │ ├── master-pr-build.yml │ └── master-push-build.yml ├── .gitignore ├── .mvn └── wrapper │ └── maven-wrapper.properties ├── README.adoc ├── activemq ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── SampleAmqApplication.java │ │ │ └── SampleAutowiredActiveMQRoute.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── sample │ └── camel │ └── SampleAmqApplicationTests.java ├── actuator-http-metrics ├── pom.xml ├── readme.adoc └── src │ └── main │ ├── java │ └── sample │ │ └── camel │ │ ├── Application.java │ │ └── MyRouteBuilder.java │ └── resources │ └── application.properties ├── amqp ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── data │ │ └── ReadMe.txt │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── AmqpConfig.java │ │ │ ├── SampleAmqApplication.java │ │ │ └── SampleAutowiredAmqpRoute.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── sample │ └── camel │ └── SampleAmqApplicationTests.java ├── aot-basic ├── pom.xml ├── readme.adoc ├── routes │ ├── demo-route.camel.yaml │ └── my-route.xml └── src │ └── main │ ├── java │ └── sample │ │ └── camel │ │ ├── Application.java │ │ ├── MyBean.java │ │ └── MyCamelRouter.java │ └── resources │ └── application.properties ├── arangodb ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── springboot │ │ └── arangodb │ │ ├── Application.java │ │ ├── CamelRoute.java │ │ └── MyBeanService.java │ └── resources │ └── application.properties ├── artemis ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── data │ │ └── readme.adoc │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── SampleAmqApplication.java │ │ │ └── SampleJmsRoute.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── sample │ └── camel │ └── SampleAmqApplicationTests.java ├── aws-secrets-manager ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── springboot │ │ └── aws │ │ ├── Application.java │ │ └── CamelRoute.java │ └── resources │ ├── application.properties │ └── logback.xml ├── aws2-s3 ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── springboot │ │ └── aws2s3 │ │ ├── Application.java │ │ └── CamelRoute.java │ └── resources │ ├── application.properties │ └── logback.xml ├── azure ├── camel-example-spring-boot-azure-eventhubs │ ├── README.adoc │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── camel │ │ │ └── sample │ │ │ ├── EventhubsRouteBuilder.java │ │ │ ├── MessageReceiver.java │ │ │ └── SampleCamelEventhubsApplication.java │ │ └── resources │ │ └── application.yml ├── camel-example-spring-boot-azure-servicebus │ ├── README.adoc │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── camel │ │ │ └── sample │ │ │ ├── MessageReceiver.java │ │ │ ├── SampleCamelServiceBusApplication.java │ │ │ └── ServicebusRouteBuilder.java │ │ └── resources │ │ └── application.yml └── pom.xml ├── dynamic-router-eip ├── README.adoc ├── dynamic-router-eip-single │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── example │ │ │ └── springboot │ │ │ └── numbers │ │ │ ├── Application.java │ │ │ ├── config │ │ │ ├── DynamicRouterComponentConfig.java │ │ │ └── ExampleConfig.java │ │ │ ├── participants │ │ │ ├── PredicateConstants.java │ │ │ └── RoutingParticipant.java │ │ │ ├── service │ │ │ ├── NumbersService.java │ │ │ └── ResultsService.java │ │ │ └── web │ │ │ └── NumbersController.java │ │ └── resources │ │ ├── application.yml │ │ └── logback.xml ├── dynamic-router-eip-stack │ ├── all-numbers-service │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── camel │ │ │ │ └── example │ │ │ │ └── springboot │ │ │ │ └── numbers │ │ │ │ └── all │ │ │ │ ├── Application.java │ │ │ │ └── service │ │ │ │ └── ProcessAllNumbersRoutingParticipant.java │ │ │ └── resources │ │ │ └── application.yaml │ ├── even-numbers-service │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── camel │ │ │ │ └── example │ │ │ │ └── springboot │ │ │ │ └── numbers │ │ │ │ └── even │ │ │ │ ├── Application.java │ │ │ │ └── service │ │ │ │ └── ProcessEvenNumbersRoutingParticipant.java │ │ │ └── resources │ │ │ └── application.yaml │ ├── main-router │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── camel │ │ │ │ └── example │ │ │ │ └── springboot │ │ │ │ └── numbers │ │ │ │ └── mainrouter │ │ │ │ ├── Application.java │ │ │ │ ├── config │ │ │ │ ├── DynamicRouterComponentConfig.java │ │ │ │ ├── MainRouterConfig.java │ │ │ │ ├── StateMachineActionConfig.java │ │ │ │ └── StateMachineConfig.java │ │ │ │ ├── model │ │ │ │ └── StateMachineEvent.java │ │ │ │ ├── routing │ │ │ │ └── NumberStatisticsRoutingParticipant.java │ │ │ │ ├── service │ │ │ │ ├── NumberGeneratorService.java │ │ │ │ ├── NumberStatisticsService.java │ │ │ │ ├── StateMachineEventTriggerService.java │ │ │ │ ├── SubscribersService.java │ │ │ │ └── WarmUpService.java │ │ │ │ ├── util │ │ │ │ └── MainRouterUtil.java │ │ │ │ └── web │ │ │ │ ├── NumberGeneratorController.java │ │ │ │ ├── NumberStatisticsController.java │ │ │ │ └── SubscribersController.java │ │ │ └── resources │ │ │ └── application.yaml │ ├── numbers-common │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── camel │ │ │ │ └── example │ │ │ │ └── springboot │ │ │ │ └── numbers │ │ │ │ └── common │ │ │ │ ├── config │ │ │ │ ├── CommonConfig.java │ │ │ │ └── YamlPropertySourceFactory.java │ │ │ │ ├── model │ │ │ │ └── CommandMessage.java │ │ │ │ ├── service │ │ │ │ ├── ProcessNumbersRoutingParticipant.java │ │ │ │ ├── RoutingParticipant.java │ │ │ │ └── StringValueHeaderDeserializer.java │ │ │ │ └── util │ │ │ │ └── NumbersCommonUtil.java │ │ │ └── resources │ │ │ └── common.yaml │ ├── odd-numbers-service │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── camel │ │ │ │ └── example │ │ │ │ └── springboot │ │ │ │ └── numbers │ │ │ │ └── odd │ │ │ │ ├── Application.java │ │ │ │ └── service │ │ │ │ └── ProcessOddNumbersRoutingParticipant.java │ │ │ └── resources │ │ │ └── application.yaml │ ├── pom.xml │ └── project-resources │ │ └── docker │ │ └── compose.yaml └── pom.xml ├── endpointdsl ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── MyBean.java │ │ │ └── MyCamelApplication.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── sample │ └── camel │ └── MyCamelApplicationJUnit5Test.java ├── fhir-auth-tx ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── data │ │ └── patients.csv │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── MyCamelApplication.java │ │ │ └── MyCamelRouter.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── sample │ └── camel │ └── MyCamelApplicationTest.java ├── fhir ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── data │ │ └── hl7v2.patient │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── MyCamelApplication.java │ │ │ └── MyCamelRouter.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── sample │ └── camel │ ├── MyCamelApplicationTest.java │ └── MyCamelTestRouter.java ├── health-checks ├── pom.xml ├── readme.adoc └── src │ └── main │ ├── java │ └── sample │ │ └── camel │ │ ├── Application.java │ │ ├── MonkeyHealthCheck.java │ │ ├── MyConfiguration.java │ │ └── MyRouteBuilder.java │ └── resources │ └── application.properties ├── http-ssl ├── .gitignore ├── README.adoc ├── generate-certificates.sh ├── pom.xml ├── ssl-camel-server │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── springboot │ │ │ └── example │ │ │ └── httpssl │ │ │ ├── HttpSslCamelServerApplication.java │ │ │ ├── HttpSslCamelServerRouter.java │ │ │ └── SSLConfiguration.java │ │ └── resources │ │ └── application.properties ├── ssl-client │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── springboot │ │ │ └── example │ │ │ └── httpssl │ │ │ ├── HttpSslClientApplication.java │ │ │ ├── HttpSslClientRouter.java │ │ │ └── SSLConfiguration.java │ │ └── resources │ │ ├── application-oneway.properties │ │ ├── application-twoways.properties │ │ └── application.properties └── ssl-server │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── springboot │ │ └── example │ │ └── httpssl │ │ ├── HttpSslServerApplication.java │ │ └── HttpSslServerRouter.java │ └── resources │ ├── application-oneway.properties │ ├── application-twoways.properties │ └── application.properties ├── infinispan ├── README.adoc ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── example │ │ │ └── springboot │ │ │ └── infinispan │ │ │ ├── Application.java │ │ │ └── CamelInfinispanRoute.java │ └── resources │ │ └── application.properties │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── springboot │ │ └── infinispan │ │ ├── ApplicationTest.java │ │ └── TestRoute.java │ └── resources │ └── infinispan.xml ├── jira ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── jira │ │ ├── AddIssueRoute.java │ │ ├── Application.java │ │ ├── AttachFileRoute.java │ │ └── NewCommentsRoute.java │ └── resources │ ├── application.properties │ └── logback.xml ├── jolokia ├── README.adoc ├── docs │ ├── add-connection.png │ └── route-monitor.png ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ ├── MySpringBean.java │ │ ├── MySpringBootApplication.java │ │ └── MySpringBootRouter.java │ └── resources │ ├── META-INF │ ├── LICENSE.txt │ └── NOTICE.txt │ └── application.properties ├── kafka-avro ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── kafka │ │ └── avro │ │ ├── Application.java │ │ ├── AvroRouteBuilder.java │ │ ├── CustomKafkaAvroDeserializer.java │ │ ├── CustomKafkaAvroSerializer.java │ │ ├── KafkaAvroMessageConsumerProcessor.java │ │ ├── KafkaAvroMessageProcessor.java │ │ └── KafkaAvroProcessor.java │ └── resources │ ├── application.properties │ ├── avro │ └── employee.avsc │ ├── log4j2.properties │ ├── register_schema.py │ └── spring │ └── camel-context.xml ├── kafka-oauth ├── README.adoc ├── containers │ ├── certificates │ │ ├── ca-truststore.p12 │ │ ├── ca.crt │ │ ├── ca.key │ │ └── gen-ca.sh │ ├── kafka │ │ ├── certificates │ │ │ ├── cluster.keystore.p12 │ │ │ ├── cluster.truststore.p12 │ │ │ └── gen-kafka-certs.sh │ │ ├── config │ │ │ ├── ca-truststore.p12 │ │ │ └── log4j.properties │ │ └── scripts │ │ │ ├── functions.sh │ │ │ ├── simple_kafka_config.sh │ │ │ └── start.sh │ └── keycloak │ │ ├── certificates │ │ ├── ca-truststore.p12 │ │ ├── gen-keycloak-certs.sh │ │ └── keycloak.server.keystore.p12 │ │ ├── compose.yml │ │ └── realms │ │ └── demo-realm.json ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── example │ │ │ └── kafka │ │ │ ├── Application.java │ │ │ └── Route.java │ │ └── resources │ │ └── application.properties ├── start_kafka.sh └── start_keycloak.sh ├── kafka-offsetrepository ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── kafka │ │ └── offsetRepository │ │ ├── KafkaProcessor.java │ │ └── OffsetRepoApp.java │ └── resources │ ├── application.properties │ ├── log4j2.properties │ ├── offsetStateRepo.dat │ └── spring │ └── camel-context.xml ├── kamelet-chucknorris ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── MyCamelApplication.java │ │ │ └── MyRoute.java │ └── resources │ │ ├── application.yaml │ │ └── kamelets │ │ └── chuck-norris-source.kamelet.yaml │ └── test │ └── java │ └── sample │ └── camel │ └── MyCamelApplicationJUnit5Test.java ├── load-balancer-eip ├── README.adoc ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── springboot │ │ │ └── example │ │ │ ├── Application.java │ │ │ ├── CustomLoadBalancer.java │ │ │ ├── LoadBalancerEIPRouter.java │ │ │ └── MyException.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── org │ └── apache │ └── camel │ └── springboot │ └── example │ └── LoadBalancerEIPTest.java ├── mail-ms-exchange-oauth2 ├── Readme.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── mail │ │ └── oauth2 │ │ ├── ApplicationConfiguration.java │ │ ├── CamelApplication.java │ │ └── Oauth2ExchangeMailAuthenticator.java │ └── resources │ └── application.properties ├── master ├── pom.xml ├── readme.adoc └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── examples │ │ └── master │ │ ├── MasterNode.java │ │ └── MasterNodeConfiguration.java │ └── resources │ ├── application-file.properties │ ├── application-openshift.properties │ └── application.properties ├── metrics ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── spring │ │ └── boot │ │ └── metrics │ │ └── Application.java │ └── resources │ └── application.properties ├── multi-datasource-2pc ├── .gitignore ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── DataSourcesConfig.java │ │ │ ├── MyCamelApplication.java │ │ │ └── MyCamelRouter.java │ └── resources │ │ ├── application.properties │ │ ├── schema-ds1.sql │ │ └── schema-ds2.sql │ └── test │ ├── java │ └── sample │ │ └── camel │ │ └── MyCamelApplicationJUnit5Test.java │ └── resources │ └── application-test.properties ├── mvnw ├── mvnw.cmd ├── observation ├── README.adoc ├── adoc │ └── img │ │ └── trace.jpeg ├── client │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── ClientApplication.java │ │ │ ├── ClientRoute.java │ │ │ └── CounterBean.java │ │ └── resources │ │ ├── META-INF │ │ ├── LICENSE.txt │ │ ├── NOTICE.txt │ │ └── beans.xml │ │ ├── application.properties │ │ └── logback.xml ├── containers │ ├── docker-compose.yml │ └── docker │ │ └── config │ │ ├── grafana │ │ └── provisioning │ │ │ ├── dashboards │ │ │ ├── dashboard.yml │ │ │ └── example.json │ │ │ └── datasources │ │ │ └── datasource.yml │ │ └── prometheus │ │ └── prometheus.yml ├── loggingtracer │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── sample │ │ │ └── observation │ │ │ └── logging │ │ │ ├── LoggingSpanHandler.java │ │ │ └── MetricsPrinter.java │ │ └── resources │ │ ├── META-INF │ │ ├── LICENSE.txt │ │ ├── NOTICE.txt │ │ └── beans.xml │ │ └── log4j2.properties ├── pom.xml ├── service1 │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── Service1Application.java │ │ │ └── Service1Route.java │ │ └── resources │ │ ├── META-INF │ │ ├── LICENSE.txt │ │ └── NOTICE.txt │ │ ├── application.properties │ │ └── logback.xml └── service2 │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── sample │ │ └── camel │ │ ├── Service2Application.java │ │ └── Service2Route.java │ └── resources │ ├── META-INF │ ├── LICENSE.txt │ └── NOTICE.txt │ ├── application.properties │ └── logback.xml ├── openapi-contract-first ├── daisy.json ├── pom.xml ├── readme.adoc └── src │ └── main │ ├── java │ └── sample │ │ └── petstore │ │ ├── MyPetStoreApplication.java │ │ └── PetStoreRoute.java │ └── resources │ ├── application.properties │ └── petstore.json ├── opentelemetry ├── .gitignore ├── CarBooking │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── demo │ │ │ │ ├── AvailableCars.java │ │ │ │ ├── DemoApplication.java │ │ │ │ └── MySimpleCamelRouter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── demo │ │ └── DemoApplicationTests.java ├── FlightBooking │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── demo │ │ │ │ ├── AvailableFlights.java │ │ │ │ ├── DemoApplication.java │ │ │ │ └── MySimpleCamelRouter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── demo │ │ └── DemoApplicationTests.java ├── HotelBooking │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── demo │ │ │ │ ├── AvailableHotels.java │ │ │ │ ├── DemoApplication.java │ │ │ │ └── MySimpleCamelRouter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── demo │ │ └── DemoApplicationTests.java ├── README.adoc ├── TripBooking │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── demo │ │ │ ├── DemoApplication.java │ │ │ ├── MergeAggregationStrategy.java │ │ │ └── MySimpleCamelRouter.java │ │ └── resources │ │ ├── application.properties │ │ └── logback.xml ├── adoc │ └── img │ │ ├── example.jpeg │ │ ├── metrics.png │ │ ├── trace-async-dag.png │ │ ├── trace-async.png │ │ ├── trace-sync-dag.png │ │ └── trace-sync.png ├── containers │ ├── compose.yaml │ └── docker │ │ ├── otel-collector-config.yaml │ │ └── prometheusConfig.yml └── pom.xml ├── paho-mqtt5-shared-subscriptions ├── README.adoc ├── img │ ├── nonSharedSubscription.gif │ └── sharedSubscription.gif ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── spring │ │ └── boot │ │ └── paho │ │ └── mqtt5 │ │ ├── Application.java │ │ └── PahoMqtt5RouteBuilder.java │ └── resources │ └── application.properties ├── platform-http ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── springboot │ │ ├── Application.java │ │ ├── CamelRouter.java │ │ ├── Todo.java │ │ ├── TodoService.java │ │ └── TodoServiceImpl.java │ └── resources │ └── application.properties ├── pojo ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── sample │ │ └── camel │ │ ├── Application.java │ │ ├── MagicNumber.java │ │ ├── NumberPojo.java │ │ └── NumberRoute.java │ └── resources │ └── application.properties ├── pom.xml ├── quartz ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── sample │ │ └── camel │ │ ├── Application.java │ │ └── QuartzRoute.java │ └── resources │ └── application.properties ├── rabbitmq ├── pom.xml ├── readme.adoc └── src │ └── main │ ├── java │ └── sample │ │ └── camel │ │ ├── SampleCamelApplication.java │ │ └── SampleCamelRouter.java │ └── resources │ └── application.properties ├── reactive-streams ├── pom.xml ├── readme.adoc └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── reactive │ │ └── streams │ │ ├── BasicCamelToReactorExample.java │ │ ├── BasicCamelToReactorInOutExample.java │ │ ├── BasicReactorToCamelExample.java │ │ ├── BasicReactorToCamelInOutExample.java │ │ ├── ClientAPIRestExample.java │ │ ├── ClientAPIWorkflowExample.java │ │ ├── RestExample.java │ │ └── app │ │ └── ReactiveStreamsSpringBootApp.java │ └── resources │ ├── META-INF │ ├── LICENSE.txt │ ├── NOTICE.txt │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ └── application.yml ├── resilience4j ├── README.adoc ├── client │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── ClientApplication.java │ │ │ ├── ClientRoute.java │ │ │ └── CounterBean.java │ │ └── resources │ │ ├── META-INF │ │ ├── LICENSE.txt │ │ ├── NOTICE.txt │ │ └── beans.xml │ │ ├── application.properties │ │ └── log4j2.properties ├── client2 │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── Client2Application.java │ │ │ ├── Client2Route.java │ │ │ └── CounterBean.java │ │ └── resources │ │ ├── META-INF │ │ ├── LICENSE.txt │ │ ├── NOTICE.txt │ │ └── beans.xml │ │ ├── application.properties │ │ └── log4j2.properties ├── pom.xml ├── service1 │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── Service1Application.java │ │ │ └── Service1Route.java │ │ └── resources │ │ ├── META-INF │ │ ├── LICENSE.txt │ │ └── NOTICE.txt │ │ └── application.properties └── service2 │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── sample │ │ └── camel │ │ ├── Service2Application.java │ │ └── Service2Route.java │ └── resources │ ├── META-INF │ ├── LICENSE.txt │ └── NOTICE.txt │ ├── application.properties │ └── log4j2.properties ├── rest-cxf-opentelemetry ├── README.adoc ├── containers │ ├── docker-compose.yml │ ├── env.sh │ └── otel-collector.yml ├── docs │ ├── jaeger.png │ └── overview.png ├── pom.xml ├── rest-cxf-otel-common │ ├── pom.xml │ └── src │ │ ├── generated │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── camel │ │ │ │ └── example │ │ │ │ └── springboot │ │ │ │ └── cxf │ │ │ │ └── otel │ │ │ │ ├── InputStreamConverterLoader.java │ │ │ │ └── IntegerConverterLoader.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── TypeConverterLoader │ │ └── main │ │ └── java │ │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── springboot │ │ └── cxf │ │ └── otel │ │ ├── Constants.java │ │ ├── CxfConfig.java │ │ ├── InputStreamConverter.java │ │ ├── IntegerConverter.java │ │ └── RandomNumber.java ├── rest-cxf-otel-even │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── example │ │ │ └── springboot │ │ │ └── cxf │ │ │ └── otel │ │ │ ├── Application.java │ │ │ ├── CamelRouter.java │ │ │ ├── EvenService.java │ │ │ └── EvenServiceImpl.java │ │ └── resources │ │ └── application.properties ├── rest-cxf-otel-odd │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── example │ │ │ └── springboot │ │ │ └── cxf │ │ │ └── otel │ │ │ ├── Application.java │ │ │ ├── CamelRouter.java │ │ │ ├── OddService.java │ │ │ └── OddServiceImpl.java │ │ └── resources │ │ └── application.properties └── rest-cxf-otel-random │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── springboot │ │ └── cxf │ │ └── otel │ │ ├── Application.java │ │ ├── CamelRouter.java │ │ ├── RandomService.java │ │ ├── RandomServiceImpl.java │ │ └── Results.java │ └── resources │ └── application.properties ├── rest-cxf ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── springboot │ │ └── cxf │ │ ├── Application.java │ │ ├── CamelRouter.java │ │ ├── CxfConfig.java │ │ ├── User.java │ │ ├── UserService.java │ │ └── UserServiceImpl.java │ └── resources │ └── application.properties ├── rest-openapi-simple ├── README.adoc ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── apache │ └── camel │ └── example │ └── RestOpenApiApplication.java ├── rest-openapi-springdoc ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── springboot │ │ ├── Application.java │ │ ├── CamelRouter.java │ │ ├── User.java │ │ ├── UserService.java │ │ └── UserServiceImpl.java │ └── resources │ └── application.properties ├── rest-openapi ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── springboot │ │ ├── Application.java │ │ ├── CamelRouter.java │ │ ├── User.java │ │ ├── UserService.java │ │ └── UserServiceImpl.java │ └── resources │ └── application.properties ├── route-reload ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ └── SampleCamelApplication.java │ └── resources │ │ ├── application.properties │ │ └── camel │ │ └── my-route.xml │ └── test │ └── java │ └── sample │ └── camel │ └── SampleCamelApplicationTest.java ├── routes-configuration ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── MyCamelApplication.java │ │ │ ├── MyJavaErrorHandler.java │ │ │ └── MyJavaRouteBuilder.java │ └── resources │ │ ├── application.yaml │ │ ├── myerror │ │ ├── xml-error.xml │ │ └── yaml-error.yaml │ │ ├── myinterceptor │ │ └── xml-interceptor.xml │ │ └── myroutes │ │ ├── my-xml-route.xml │ │ └── my-yaml-route.camel.yaml │ └── test │ └── java │ └── sample │ └── camel │ └── MyCamelApplicationJUnit5Test.java ├── routetemplate-xml ├── README.adoc ├── pom.xml └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ └── MyCamelApplication.java │ └── resources │ │ ├── application.yaml │ │ ├── builders │ │ └── my-builder.xml │ │ └── templates │ │ └── my-template.xml │ └── test │ └── java │ └── sample │ └── camel │ └── MyCamelApplicationJUnit5Test.java ├── routetemplate ├── README.adoc ├── pom.xml └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── MyCamelApplication.java │ │ │ ├── MyRouteTemplates.java │ │ │ └── MyTemplateBuilder.java │ └── resources │ │ ├── application-xml.yaml │ │ ├── application.yaml │ │ └── mycamel │ │ └── my-template.xml │ └── test │ └── java │ └── sample │ └── camel │ └── MyCamelApplicationJUnit5Test.java ├── saga ├── doc-resources │ ├── compesate-diagram.png │ ├── logic-diagram.png │ └── tech-diagram.png ├── install-ocp-ephemeral.sh ├── install-ocp.sh ├── local-resources │ └── compose.yaml ├── ocp-resources │ ├── amq-broker-ephemeral.yaml │ ├── amq-broker.yaml │ ├── lra-coordinator-ephemeral.yaml │ └── lra-coordinator.yaml ├── pom.xml ├── readme.adoc ├── run-local.sh ├── saga-app │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── example │ │ │ └── saga │ │ │ ├── CamelSagaApplication.java │ │ │ └── SagaRoute.java │ │ ├── jkube │ │ └── deployment.yml │ │ └── resources │ │ └── application.yml ├── saga-flight-service │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── example │ │ │ └── saga │ │ │ ├── CamelSagaFlightService.java │ │ │ └── FlightRoute.java │ │ ├── jkube │ │ └── deployment.yml │ │ └── resources │ │ └── application.yml ├── saga-payment-service │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── example │ │ │ └── saga │ │ │ ├── CamelSagaPaymentService.java │ │ │ └── PaymentRoute.java │ │ ├── jkube │ │ └── deployment.yml │ │ └── resources │ │ └── application.yml ├── saga-train-service │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── example │ │ │ └── saga │ │ │ ├── CamelSagaTrainService.java │ │ │ └── TrainRoute.java │ │ ├── jkube │ │ └── deployment.yml │ │ └── resources │ │ └── application.yml └── stop-local.sh ├── salesforce ├── .gitignore ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── salesforce │ │ ├── SalesforceApp.java │ │ └── SalesforceRouter.java │ └── resources │ └── application.properties.example ├── soap-cxf ├── README.adoc ├── pom.xml └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── Application.java │ │ │ ├── ContactServiceInMemoryImpl.java │ │ │ ├── MyPojoRouteBuilder.java │ │ │ ├── MyWsdlRouteBuilder.java │ │ │ ├── adapter │ │ │ └── DataTypeAdapter.java │ │ │ ├── repository │ │ │ └── CustomerRepository.java │ │ │ └── service │ │ │ ├── Address.java │ │ │ ├── Contact.java │ │ │ ├── ContactRequest.java │ │ │ ├── ContactService.java │ │ │ ├── ContactType.java │ │ │ ├── GetContactsResponse.java │ │ │ └── NoSuchContactException.java │ └── resources │ │ ├── META-INF │ │ ├── LICENSE.txt │ │ └── NOTICE.txt │ │ ├── application.properties │ │ ├── binding.xml │ │ └── wsdl │ │ └── CustomerService.wsdl │ └── test │ └── java │ └── sample │ └── camel │ ├── PojoClientTest.java │ └── WsdlClientTest.java ├── splitter-eip ├── README.adoc ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ └── example │ │ │ └── spring │ │ │ └── boot │ │ │ ├── AggregationStrategyPojo.java │ │ │ ├── Application.java │ │ │ ├── MyMessageTransformer.java │ │ │ └── SplitterRouter.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── CamelSplitterEIPTests.java ├── spring-boot ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── MyBean.java │ │ │ ├── MyCamelApplication.java │ │ │ └── MyCamelRouter.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── sample │ └── camel │ └── MyCamelApplicationJUnit5Test.java ├── spring-jdbc ├── pom.xml ├── readme.adoc └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── spring │ │ └── jdbc │ │ ├── CamelSpringJdbcApplication.java │ │ └── SpringJdbcRoute.java │ └── resources │ ├── application.properties │ └── schema.sql ├── strimzi ├── .gitignore ├── README.adoc ├── pom.xml ├── prepare-truststore.sh ├── route-diagram.png └── src │ └── main │ ├── fabric8 │ └── deployment.yml │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── strimzi │ │ ├── Application.java │ │ └── StrimziRouteBuilder.java │ └── resources │ ├── application-local.properties │ ├── application.properties │ ├── kafka-ephemeral-kubernetes.yaml │ └── kafka-ephemeral-openshift.yaml ├── supervising-route-controller ├── pom.xml ├── readme.adoc └── src │ └── main │ ├── java │ └── sample │ │ └── camel │ │ ├── Application.java │ │ └── ApplicationRoutes.java │ └── resources │ └── application.properties ├── tomcat-jdbc ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── MyBean.java │ │ │ ├── MyCamelApplication.java │ │ │ └── MyCamelRouter.java │ └── resources │ │ ├── application.properties │ │ └── schema.sql │ └── test │ └── java │ └── sample │ └── camel │ └── MyCamelApplicationJUnit5Test.java ├── twitter-salesforce ├── README.adoc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ ├── example │ │ └── mention │ │ │ ├── TwitterSalesforceApplication.java │ │ │ └── TwitterSalesforceRoute.java │ │ └── salesforce │ │ └── draftdto │ │ └── Contact.java │ └── resources │ ├── META-INF │ ├── LICENSE.txt │ └── NOTICE.txt │ └── application.properties ├── type-converter ├── README.adoc ├── pom.xml └── src │ ├── generated │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ └── CustomGeneratedConverterLoader.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org │ │ └── apache │ │ └── camel │ │ └── TypeConverterLoader │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── Application.java │ │ │ ├── CustomGeneratedConverter.java │ │ │ ├── CustomRuntimeConverter.java │ │ │ ├── DataTypeConverterRouter.java │ │ │ └── Person.java │ └── resources │ │ ├── META-INF │ │ └── services │ │ │ └── org │ │ │ └── apache │ │ │ └── camel │ │ │ ├── TypeConverter │ │ │ └── TypeConverterLoader │ │ └── application.properties │ └── test │ └── java │ └── sample │ └── camel │ ├── CustomConverterGeneratedTest.java │ └── CustomConverterRuntimeTest.java ├── validator ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── GreetingValidator.java │ │ │ ├── SampleBean.java │ │ │ ├── SampleCamelApplication.java │ │ │ └── SampleCamelRouter.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── sample │ └── camel │ └── SampleCamelApplicationTest.java ├── variables ├── pom.xml └── src │ └── main │ ├── java │ └── sample │ │ └── camel │ │ ├── MyRoute.java │ │ └── SampleCamelApplication.java │ └── resources │ └── application.properties ├── vault ├── img │ └── secret-database.png ├── pom.xml ├── readme.adoc └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── spring │ │ └── vault │ │ └── CamelSpringVaultApplication.java │ └── resources │ ├── application.properties │ └── camel │ ├── cars-api.yaml │ ├── cars-datasource.yaml │ └── cars-routes.yaml ├── webhook ├── pom.xml ├── readme.adoc └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── camel │ │ └── example │ │ └── webhook │ │ └── Application.java │ └── resources │ └── application.properties ├── widget-gadget ├── README.adoc ├── pom.xml └── src │ └── main │ ├── data │ ├── order1.json │ └── order2.json │ ├── java │ └── sample │ │ └── camel │ │ ├── AmqpConfig.java │ │ ├── OrderRoute.java │ │ ├── WidgetGadgetApp.java │ │ └── WidgetGadgetRoute.java │ └── resources │ └── application.properties ├── xml-import ├── pom.xml ├── readme.adoc └── src │ ├── main │ ├── java │ │ └── sample │ │ │ └── camel │ │ │ ├── SampleBean.java │ │ │ └── SampleCamelApplication.java │ └── resources │ │ ├── application.properties │ │ └── my-camel.xml │ └── test │ └── java │ └── sample │ └── camel │ └── SampleCamelApplicationTest.java └── xml ├── pom.xml ├── readme.adoc └── src ├── main ├── java │ └── sample │ │ └── camel │ │ ├── SampleBean.java │ │ └── SampleCamelApplication.java └── resources │ ├── application.properties │ └── camel │ └── my-route.xml └── test └── java └── sample └── camel └── SampleCamelApplicationTest.java /.asf.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 | github: 19 | description: "Apache Camel Spring Boot Examples" 20 | homepage: https://camel.apache.org 21 | labels: 22 | - camel 23 | - integration 24 | - java 25 | - spring-boot 26 | enabled_merge_buttons: 27 | merge: false 28 | rebase: true 29 | squash: true 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.iml 3 | *.ipr 4 | *.iws 5 | .idea 6 | .DS_Store 7 | .classpath 8 | .ekstazi 9 | .project 10 | .settings 11 | .checkstyle 12 | *.log 13 | test-salesforce-login.properties 14 | dependency-reduced-pom.xml 15 | id_file 16 | components/camel-solr/data 17 | *.epoch 18 | .factorypath 19 | .pmd 20 | .sts4-cache 21 | log-camel-lsp.out 22 | .vscode 23 | *.code-workspace 24 | components/camel-cxf/activemq-data 25 | *.swp 26 | .flattened-pom.xml 27 | .java-version 28 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | wrapperVersion=3.3.2 18 | distributionType=only-script 19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip 20 | -------------------------------------------------------------------------------- /activemq/readme.adoc: -------------------------------------------------------------------------------- 1 | == Camel Example Spring Boot and ActiveMQ 2 | 3 | This example shows how to work with a simple Apache Camel application using Spring Boot and Apache ActiveMQ. 4 | In contrast to the amqp example in this repo, it uses ActiveMQs openwire protocol and the 5 | camel-activemq component. 6 | 7 | === Preparing ActiveMQ brokers 8 | 9 | From Apache ActiveMQ you can download the broker as a `.zip` or `.tar.gz` file. 10 | 11 | Unzip/tar the archive, and start a terminal. 12 | 13 | Change directory to the unzipped directory and start the broker. 14 | 15 | bin/activemq console 16 | 17 | Which runs the broker in the foreground and logs to the console. 18 | 19 | === How to run the example 20 | 21 | You can run this example using 22 | 23 | mvn spring-boot:run 24 | 25 | === Using Camel components 26 | 27 | Apache Camel provides 200+ components which you can use to integrate and route messages between many systems 28 | and data formats. To use any of these Camel components, add the component as a dependency to your project. 29 | 30 | === Help and contributions 31 | 32 | If you hit any problem using Camel or have some feedback, then please 33 | https://camel.apache.org/support.html[let us know]. 34 | 35 | We also love contributors, so 36 | https://camel.apache.org/contributing.html[get involved] :-) 37 | 38 | The Camel riders! 39 | -------------------------------------------------------------------------------- /amqp/readme.adoc: -------------------------------------------------------------------------------- 1 | == Camel Example Spring Boot and ActiveMQ AMQP 2 | 3 | This example shows how to work with a simple Apache Camel application using Spring Boot and Apache ActiveMQ. 4 | 5 | === Preparing ActiveMQ brokers 6 | 7 | From Apache ActiveMQ you can download the broker as a `.zip` or `.tar.gz` file. 8 | 9 | Unzip/tar the archive, and start a terminal. 10 | 11 | Change directory to the unzipped directory and start the broker. 12 | 13 | bin/activemq console 14 | 15 | Which runs the broker in the foreground and logs to the console. 16 | 17 | === How to run the example 18 | 19 | You can run this example using 20 | 21 | mvn spring-boot:run 22 | 23 | === Using Camel components 24 | 25 | Apache Camel provides 200+ components which you can use to integrate and route messages between many systems 26 | and data formats. To use any of these Camel components, add the component as a dependency to your project. 27 | 28 | === Help and contributions 29 | 30 | If you hit any problem using Camel or have some feedback, then please 31 | https://camel.apache.org/support.html[let us know]. 32 | 33 | We also love contributors, so 34 | https://camel.apache.org/contributing.html[get involved] :-) 35 | 36 | The Camel riders! 37 | -------------------------------------------------------------------------------- /amqp/src/main/data/ReadMe.txt: -------------------------------------------------------------------------------- 1 | Example project which connects to A-MQ 7, using the standard AMQP protocol. 2 | 3 | There is the code, from that project, which instantiates component, and sends message 4 | 5 | public class CamelRoute extends RouteBuilder { 6 | 7 | @Override 8 | public void configure() throws Exception { 9 | from("timer:bar") 10 | .id("timer-consumer-route") 11 | .setBody(constant("Hello from Camel")) 12 | .to("amqp:queue:SCIENCEQUEUE") 13 | .log("Message sent from route ${routeId} to SCIENCEQUEUE"); 14 | } 15 | } 16 | 17 | Please also see the pom file, no need to specify pom versions, 18 | because they come from the imported BOM. 19 | 20 | 21 | org.apache.camel.springboot 22 | camel-amqp-starter 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /amqp/src/main/java/sample/camel/SampleAmqApplication.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 | package sample.camel; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | //CHECKSTYLE:OFF 23 | @SpringBootApplication 24 | public class SampleAmqApplication { 25 | 26 | public static void main(String[] args) { 27 | SpringApplication.run(SampleAmqApplication.class, args); 28 | } 29 | } 30 | // CHECKSTYLE:ON 31 | -------------------------------------------------------------------------------- /aot-basic/routes/demo-route.camel.yaml: -------------------------------------------------------------------------------- 1 | - route: 2 | id: helloYAML 3 | from: 4 | uri: timer://yaml?period=2000 5 | steps: 6 | - log: 7 | message: "Hello World from YAML at ${header.CamelTimerFiredTime}" 8 | 9 | -------------------------------------------------------------------------------- /arangodb/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | camel.main.name=ArangoDB 18 | camel.springboot.main-run-controller=true 19 | camel.component.arangodb.documentCollection=foo 20 | camel.component.arangodb.user=root 21 | camel.component.arangodb.password=openSesame 22 | 23 | 24 | -------------------------------------------------------------------------------- /artemis/readme.adoc: -------------------------------------------------------------------------------- 1 | == Camel Example Spring Boot and ActiveMQ Artemis 2 | 3 | This example shows how to work with a simple Apache Camel application using Spring Boot and Apache ActiveMQ Artemis. 4 | 5 | === How to run the example 6 | 7 | You can run this example using 8 | 9 | mvn spring-boot:run 10 | 11 | === Using Camel components 12 | 13 | Apache Camel provides 200+ components which you can use to integrate and route messages between many systems 14 | and data formats. To use any of these Camel components, add the component as a dependency to your project. 15 | 16 | === Help and contributions 17 | 18 | If you hit any problem using Camel or have some feedback, then please 19 | https://camel.apache.org/support.html[let us know]. 20 | 21 | We also love contributors, so 22 | https://camel.apache.org/contributing.html[get involved] :-) 23 | 24 | The Camel riders! 25 | -------------------------------------------------------------------------------- /artemis/src/main/data/readme.adoc: -------------------------------------------------------------------------------- 1 | 2 | == Camel Example Spring Boot and ActiveMQ Artemis == 3 | The APACHE Camel riders! 4 | 5 | -------------------------------------------------------------------------------- /artemis/src/main/java/sample/camel/SampleAmqApplication.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 | package sample.camel; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | //CHECKSTYLE:OFF 23 | @SpringBootApplication 24 | public class SampleAmqApplication { 25 | public static void main(String[] args) { 26 | SpringApplication.run(SampleAmqApplication.class, args); 27 | } 28 | } 29 | // CHECKSTYLE:ON 30 | -------------------------------------------------------------------------------- /aws-secrets-manager/README.adoc: -------------------------------------------------------------------------------- 1 | == Spring Boot Example with AWS Secrets Manager 2 | 3 | === Introduction 4 | 5 | This example demonstrates how you can use Camel-AWS-Secrets-Manager Starter component, in particular the properties source feature. 6 | 7 | === Credentials 8 | 9 | First of all you'll need to correctly populate the camel.vault.aws.* properties in the application properties. 10 | 11 | In your AWS Secret Manager account, create a finnhub-token secret, with a plain finnhub.io token. 12 | 13 | === Build 14 | 15 | You can build this example using: 16 | 17 | $ mvn package 18 | 19 | === Run 20 | 21 | You can run this example following these steps using: 22 | 23 | In application.properties set all the AWS credentials and the bucket name 24 | 25 | Run the app 26 | 27 | $ mvn spring-boot:run 28 | 29 | And you should see output in the console. 30 | 31 | === Help and contributions 32 | 33 | If you hit any problem using Camel or have some feedback, then please 34 | https://camel.apache.org/community/support/[let us know]. 35 | 36 | We also love contributors, so 37 | https://camel.apache.org/community/contributing/[get involved] :-) 38 | 39 | The Camel riders! 40 | -------------------------------------------------------------------------------- /aws-secrets-manager/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | camel.vault.aws.accessKey= 19 | camel.vault.aws.secretKey= 20 | camel.vault.aws.region= 21 | camel.springboot.main-run-controller=true 22 | logging.config=classpath:logback.xml 23 | stock=AMZN 24 | 25 | -------------------------------------------------------------------------------- /aws2-s3/README.adoc: -------------------------------------------------------------------------------- 1 | == Spring Boot Example with AWS2-S3 2 | 3 | === Introduction 4 | 5 | This example demonstrates how you can use Camel-AWS2-S3 Starter component. The example is really simple: load file into your bucket and consume it. 6 | 7 | === Build 8 | 9 | You can build this example using: 10 | 11 | $ mvn package 12 | 13 | === Run 14 | 15 | You can run this example following these steps using: 16 | 17 | In application.properties set all the AWS credentials and the bucket name 18 | 19 | Run the app 20 | 21 | $ mvn spring-boot:run 22 | 23 | And you should see output in the console. 24 | 25 | === Help and contributions 26 | 27 | If you hit any problem using Camel or have some feedback, then please 28 | https://camel.apache.org/community/support/[let us know]. 29 | 30 | We also love contributors, so 31 | https://camel.apache.org/community/contributing/[get involved] :-) 32 | 33 | The Camel riders! 34 | -------------------------------------------------------------------------------- /aws2-s3/src/main/java/org/apache/camel/example/springboot/aws2s3/CamelRoute.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 | package org.apache.camel.example.springboot.aws2s3; 18 | 19 | import org.apache.camel.builder.RouteBuilder; 20 | import org.springframework.stereotype.Component; 21 | 22 | @Component 23 | public class CamelRoute extends RouteBuilder { 24 | 25 | @Override 26 | public void configure() throws Exception { 27 | 28 | from("aws2-s3://{{bucketName}}") 29 | .log("Received body: ${body}"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /aws2-s3/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | camel.component.aws2-s3.accessKey=xxxx 18 | camel.component.aws2-s3.secretKey=yyyy 19 | camel.component.aws2-s3.region=region 20 | camel.springboot.main-run-controller=true 21 | logging.config=classpath:logback.xml 22 | bucketName=camel-kafka-connector 23 | 24 | -------------------------------------------------------------------------------- /azure/camel-example-spring-boot-azure-eventhubs/src/main/java/camel/sample/MessageReceiver.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 | package camel.sample; 18 | 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | import org.springframework.stereotype.Component; 22 | 23 | 24 | @Component 25 | public class MessageReceiver { 26 | 27 | private static final Logger logger = LoggerFactory.getLogger(MessageReceiver.class); 28 | 29 | public void onMessage(String message) { 30 | logger.info("Received: {}", message); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /azure/camel-example-spring-boot-azure-eventhubs/src/main/java/camel/sample/SampleCamelEventhubsApplication.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 | package camel.sample; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class SampleCamelEventhubsApplication { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(SampleCamelEventhubsApplication.class, args); 27 | } 28 | 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /azure/camel-example-spring-boot-azure-eventhubs/src/main/resources/application.yml: -------------------------------------------------------------------------------- 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 | camel: 17 | component: 18 | azure-eventhubs: 19 | # connectionstring for eventhubs instance, with ;EntityPath= in the end 20 | connection-string: [EVENT_HUBS_CONNECTION_STRING];EntityPath=[EVENT_HUB_NAME] 21 | blob-account-name: [STORAGE_ACCOUNT_NAME] 22 | blob-access-key: [STORAGE_ACCOUNT_ACCESS_KEY] 23 | blob-container-name: [STORAGE_CONTAINER_NAME] 24 | 25 | namespaceName: [EVENT_HUBS_NAMESPACE] 26 | eventhubsName: [EVENT_HUB_NAME] 27 | -------------------------------------------------------------------------------- /azure/camel-example-spring-boot-azure-servicebus/src/main/java/camel/sample/MessageReceiver.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 | package camel.sample; 18 | 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | import org.springframework.stereotype.Component; 22 | 23 | @Component 24 | public class MessageReceiver { 25 | 26 | private static final Logger logger = LoggerFactory.getLogger(MessageReceiver.class); 27 | 28 | public void onMessage(String message) { 29 | logger.info("Received: {}", message); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /azure/camel-example-spring-boot-azure-servicebus/src/main/java/camel/sample/SampleCamelServiceBusApplication.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 | package camel.sample; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class SampleCamelServiceBusApplication { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(SampleCamelServiceBusApplication.class, args); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /azure/camel-example-spring-boot-azure-servicebus/src/main/resources/application.yml: -------------------------------------------------------------------------------- 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 | spring: 18 | output: 19 | ansi: 20 | enabled: ALWAYS 21 | camel: 22 | component: 23 | azure-servicebus: 24 | connection-string: [SERVICEBUS_CONNECTION_STRING] 25 | service-bus-type: queue 26 | 27 | queueName: [SERVICEBUS_QUEUE_NAME] 28 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-single/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | org.apache.camel.springboot.example 8 | camel-example-spring-boot-dynamic-router-eip 9 | 4.13.0-SNAPSHOT 10 | 11 | 12 | camel-example-spring-boot-dynamic-router-eip-single 13 | jar 14 | 15 | Camel SB Examples :: Dynamic Router EIP :: Examples :: Single JVM Example 16 | An example on how to use the Dynamic Router EIP component in a single Spring Boot application 17 | 18 | 19 | 20 | org.springdoc 21 | springdoc-openapi-starter-webflux-ui 22 | ${springdoc-version} 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-single/src/main/java/org/apache/camel/example/springboot/numbers/web/NumbersController.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.example.springboot.numbers.web; 2 | 3 | import org.apache.camel.example.springboot.numbers.service.NumbersService; 4 | import org.springframework.web.bind.annotation.PutMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import reactor.core.publisher.Mono; 8 | 9 | @RestController 10 | public class NumbersController { 11 | 12 | private final NumbersService numbersService; 13 | 14 | public NumbersController(NumbersService numbersService) { 15 | this.numbersService = numbersService; 16 | } 17 | 18 | @PutMapping(path = "/generate") 19 | public Mono generate(@RequestParam("limit") int limit) throws InterruptedException { 20 | return Mono.just(numbersService.start(limit)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-single/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %8.8relative %highlight(%5.-5level) %15.-15c{0} - %m%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-stack/all-numbers-service/src/main/resources/application.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 | app: 18 | name: "all-numbers" 19 | port: 8911 20 | id: "numbers_all" 21 | predicate: "{headers.command == 'processNumber' or headers.command == 'resetStats'}" 22 | priority: 5 23 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-stack/even-numbers-service/src/main/resources/application.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 | app: 18 | name: "even-numbers" 19 | port: 8902 20 | id: "numbers_even" 21 | predicate: "{(headers.command == 'processNumber' and headers.number matches '\\d*[02468]') or headers.command == 'resetStats'}" 22 | priority: 10 23 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-stack/main-router/src/main/java/org/apache/camel/example/springboot/numbers/mainrouter/model/StateMachineEvent.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.example.springboot.numbers.mainrouter.model; 2 | 3 | import org.apache.camel.example.springboot.numbers.mainrouter.util.MainRouterUtil.Events; 4 | import org.springframework.context.ApplicationEvent; 5 | import org.springframework.messaging.Message; 6 | 7 | public class StateMachineEvent extends ApplicationEvent { 8 | 9 | private final transient Message message; 10 | 11 | public StateMachineEvent(Object source, Message message) { 12 | super(source); 13 | this.message = message; 14 | } 15 | 16 | public Message getMessage() { 17 | return message; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-stack/main-router/src/main/java/org/apache/camel/example/springboot/numbers/mainrouter/service/StateMachineEventTriggerService.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.example.springboot.numbers.mainrouter.service; 2 | 3 | import org.apache.camel.example.springboot.numbers.mainrouter.model.StateMachineEvent; 4 | import org.apache.camel.example.springboot.numbers.mainrouter.util.MainRouterUtil; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.context.event.EventListener; 8 | import org.springframework.statemachine.StateMachine; 9 | import org.springframework.stereotype.Service; 10 | 11 | @Service 12 | public class StateMachineEventTriggerService { 13 | 14 | private static final Logger LOG = LoggerFactory.getLogger(StateMachineEventTriggerService.class); 15 | 16 | private final StateMachine stateMachine; 17 | 18 | public StateMachineEventTriggerService(StateMachine stateMachine) { 19 | this.stateMachine = stateMachine; 20 | } 21 | 22 | @EventListener 23 | public void onEvent(StateMachineEvent event) { 24 | LOG.info("Received state machine event: {}", event.getMessage().getPayload().name()); 25 | MainRouterUtil.sendEventAndMapResponse.apply(stateMachine, event.getMessage()).subscribe(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-stack/main-router/src/main/java/org/apache/camel/example/springboot/numbers/mainrouter/service/SubscribersService.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.example.springboot.numbers.mainrouter.service; 2 | 3 | import org.apache.camel.ProducerTemplate; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class SubscribersService { 10 | 11 | private static final Logger LOG = LoggerFactory.getLogger(SubscribersService.class); 12 | 13 | private final ProducerTemplate producerTemplate; 14 | 15 | public SubscribersService(final ProducerTemplate producerTemplate) { 16 | this.producerTemplate = producerTemplate; 17 | producerTemplate.start(); 18 | } 19 | 20 | public String listSubscriptions(final String channel) { 21 | LOG.info("Getting subscriptions list for channel '{}'", channel); 22 | return producerTemplate.requestBodyAndHeader( 23 | "direct:list", "", "subscribeChannel", channel, String.class); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-stack/main-router/src/main/java/org/apache/camel/example/springboot/numbers/mainrouter/web/SubscribersController.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.example.springboot.numbers.mainrouter.web; 2 | 3 | import org.apache.camel.example.springboot.numbers.mainrouter.service.SubscribersService; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import reactor.core.publisher.Mono; 8 | 9 | @RestController 10 | public class SubscribersController { 11 | 12 | private final SubscribersService subscribersService; 13 | 14 | public SubscribersController(SubscribersService subscribersService) { 15 | this.subscribersService = subscribersService; 16 | } 17 | 18 | @GetMapping(path = "/list/{channel}") 19 | public Mono listSubscriptions(@PathVariable("channel") String channel) { 20 | return Mono.just(subscribersService.listSubscriptions(channel)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-stack/numbers-common/src/main/java/org/apache/camel/example/springboot/numbers/common/util/NumbersCommonUtil.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.example.springboot.numbers.common.util; 2 | 3 | /** 4 | * Common constants and methods. 5 | */ 6 | public abstract class NumbersCommonUtil { 7 | 8 | private NumbersCommonUtil() {} 9 | 10 | public static final String ENDPOINT_DIRECT_COMMAND = "direct:command"; 11 | 12 | public static final String ENDPOINT_DIRECT_LIST = "direct:list"; 13 | 14 | public static final String COMMAND_PROCESS_NUMBER = "processNumber"; 15 | 16 | public static final String COMMAND_RESET_STATS = "resetStats"; 17 | 18 | public static final String COMMAND_STATS = "stats"; 19 | 20 | public static final String HEADER_COMMAND = "command"; 21 | 22 | public static final String HEADER_EVENT_LIMIT = "limit"; 23 | 24 | public static final String HEADER_NUMBER = "number"; 25 | } 26 | -------------------------------------------------------------------------------- /dynamic-router-eip/dynamic-router-eip-stack/odd-numbers-service/src/main/resources/application.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 | app: 18 | name: "odd-numbers" 19 | port: 8901 20 | id: "numbers_odd" 21 | predicate: "{(headers.command == 'processNumber' and headers.number matches '\\d*[13579]') or headers.command == 'resetStats'}" 22 | priority: 10 23 | -------------------------------------------------------------------------------- /endpointdsl/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # the name of Camel 19 | camel.main.name = MyCamel 20 | 21 | # what to say 22 | greeting = Hello World 23 | -------------------------------------------------------------------------------- /fhir-auth-tx/src/main/data/patients.csv: -------------------------------------------------------------------------------- 1 | 1a,Bob,Smith 2 | 2a,Simon,Smith -------------------------------------------------------------------------------- /fhir/src/main/data/hl7v2.patient: -------------------------------------------------------------------------------- 1 | MSH|^~\&|Amalga HIS|BUM|New Tester|MS|20111121103141||ORU^R01|2847970-201111211031|P|2.4|||AL|NE|764|ASCII||| PID||100005056|100005056||Freeman^Vincent^""^^""|""|19810813000000|F||CA|Street 1^""^""^""^34000^SGP^^""~""^""^""^""^Danling Street 5th^THA^^""||326-2275^PRN^PH^^66^675~476-5059^ORN^CP^^66^359~(123)456-7890^ORN^FX^^66^222~^NET^X.400^a@a.a~^NET^X.400^dummy@hotmail.com|(123)456-7890^WPN^PH^^66|UNK|S|BUD||BP000111899|D99999^""||CA|Bangkok|||THA||THA|""|N PV1||OPD ||||""^""^""||||CNSLT|||||C|VIP|||6262618|PB1||||||||||||||||||||||||20101208134638 PV2|||^Unknown|""^""||||""|""|0||""|||||||||||||||||||||||||||||HP1 ORC|NW|""|BMC1102771601|""|CM||^^^^^""|||||||||""^""^^^"" OBR|1|""|BMC1102771601|""^Brain (CT)||20111028124215||||||||||||||||||CTSCAN|F||^^^^^ROUTINE|||""||||||""|||||||||||^"" OBX|1|FT|""^Brain (CT)||++++ text of report goes here +++|||REQAT|||FINAL|||20111121103040||75929^Gosselin^Angelina -------------------------------------------------------------------------------- /fhir/src/test/java/sample/camel/MyCamelTestRouter.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 | package sample.camel; 18 | 19 | import org.apache.camel.builder.RouteBuilder; 20 | 21 | import org.springframework.stereotype.Component; 22 | 23 | @Component 24 | public class MyCamelTestRouter extends RouteBuilder { 25 | 26 | @Override 27 | public void configure() throws Exception { 28 | from("direct:start") 29 | .to("fhir://read/resourceById?resourceClass=Patient&stringId=1&serverUrl={{serverUrl}}&fhirVersion={{fhirVersion}}") 30 | .to("mock:result"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /health-checks/readme.adoc: -------------------------------------------------------------------------------- 1 | == Camel Health Checks and Spring Boot 2 | 3 | This example shows how to work with a simple Apache Camel application using Spring Boot. 4 | 5 | NOTE: Some routes fail intentionally to have health check monitor their failures 6 | 7 | === How to run 8 | 9 | [source,console] 10 | ---- 11 | mvn compile spring-boot:run 12 | ---- 13 | 14 | === Health Check 15 | 16 | You can query the health check of the application using Spring Boot actuator: 17 | 18 | [source,console] 19 | ---- 20 | $ http://localhost:8080/actuator/health 21 | ---- 22 | 23 | The returned response should include the health checks from Apache Camel, 24 | and as well two custom checks. 25 | 26 | === JMX Management 27 | 28 | You can from JMX see the health-check status in the Camel tree under health and 29 | find the DefaultHealthCheck MBean. 30 | 31 | === Help and contributions 32 | 33 | If you hit any problem using Camel or have some feedback, then please 34 | https://camel.apache.org/support.html[let us know]. 35 | 36 | We also love contributors, so 37 | https://camel.apache.org/contributing.html[get involved] :-) 38 | 39 | The Camel riders! 40 | -------------------------------------------------------------------------------- /health-checks/src/main/java/sample/camel/MyConfiguration.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 | package sample.camel; 18 | 19 | import org.springframework.context.annotation.Bean; 20 | import org.springframework.context.annotation.Configuration; 21 | 22 | @Configuration 23 | public class MyConfiguration { 24 | 25 | @Bean(name = "monkey") 26 | public MonkeyHealthCheck newMonkey() { 27 | return new MonkeyHealthCheck(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /http-ssl/.gitignore: -------------------------------------------------------------------------------- 1 | ssl 2 | *.jks 3 | *.pem 4 | -------------------------------------------------------------------------------- /http-ssl/ssl-camel-server/src/main/java/org/apache/camel/springboot/example/httpssl/HttpSslCamelServerApplication.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 | package org.apache.camel.springboot.example.httpssl; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class HttpSslCamelServerApplication { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(HttpSslCamelServerApplication.class, args); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /http-ssl/ssl-camel-server/src/main/java/org/apache/camel/springboot/example/httpssl/HttpSslCamelServerRouter.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 | package org.apache.camel.springboot.example.httpssl; 18 | 19 | import org.apache.camel.builder.RouteBuilder; 20 | 21 | import org.springframework.stereotype.Component; 22 | 23 | @Component 24 | public class HttpSslCamelServerRouter extends RouteBuilder { 25 | @Override 26 | public void configure() throws Exception { 27 | from("undertow:https://localhost:8443/ping") 28 | .setBody().constant("pong"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /http-ssl/ssl-camel-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | camel.main.name=ssl-camel-server 19 | camel.component.undertow.ssl-context-parameters=#serverConfig 20 | camel.component.undertow.use-global-ssl-context-parameters=true 21 | keystore-password=pass123 22 | logging.level.org.apache.camel.support.jsse=TRACE 23 | -------------------------------------------------------------------------------- /http-ssl/ssl-client/src/main/java/org/apache/camel/springboot/example/httpssl/HttpSslClientApplication.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 | package org.apache.camel.springboot.example.httpssl; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class HttpSslClientApplication { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(HttpSslClientApplication.class, args); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /http-ssl/ssl-client/src/main/resources/application-oneway.properties: -------------------------------------------------------------------------------- 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 | camel.component.http.ssl-context-parameters=#clientConfigOneWay 19 | -------------------------------------------------------------------------------- /http-ssl/ssl-client/src/main/resources/application-twoways.properties: -------------------------------------------------------------------------------- 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 | camel.component.http.ssl-context-parameters=#clientConfigTwoWays 19 | -------------------------------------------------------------------------------- /http-ssl/ssl-client/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | spring.profiles.active = ${sbProfile} 19 | camel.main.name=ssl-client 20 | camel.component.http.use-global-ssl-context-parameters=true 21 | management.endpoint.camelroutes.enabled=true 22 | management.endpoint.camelroutes.read-only=true 23 | management.endpoint.health.enabled=true 24 | management.endpoints.web.exposure.include=info,health,camelroutes 25 | keystore-password=pass123 26 | logging.level.org.apache.camel.support.jsse=TRACE 27 | -------------------------------------------------------------------------------- /http-ssl/ssl-server/src/main/java/org/apache/camel/springboot/example/httpssl/HttpSslServerApplication.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 | package org.apache.camel.springboot.example.httpssl; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class HttpSslServerApplication { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(HttpSslServerApplication.class, args); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /http-ssl/ssl-server/src/main/resources/application-oneway.properties: -------------------------------------------------------------------------------- 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 | server.ssl.client-auth=NONE 19 | -------------------------------------------------------------------------------- /http-ssl/ssl-server/src/main/resources/application-twoways.properties: -------------------------------------------------------------------------------- 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 | server.ssl.client-auth=NEED 19 | spring.ssl.bundle.jks.server.truststore.location=classpath:server-truststore.jks 20 | spring.ssl.bundle.jks.server.truststore.password=pass123 21 | spring.ssl.bundle.jks.server.truststore.type=PKCS12 22 | -------------------------------------------------------------------------------- /infinispan/README.adoc: -------------------------------------------------------------------------------- 1 | == Spring Boot Example with Infinispan 2 | 3 | === Introduction 4 | 5 | This example demonstrates how you can use Camel-Infinispan Starter component. The example is really simple: put a key/value pair in a remote cache and get the same key. 6 | This example starts an Infinispan server with Infinispan Docker Image, so it can run OOTB. 7 | 8 | === Build and test 9 | 10 | You can build this example using: 11 | 12 | $ mvn package 13 | 14 | === Run 15 | 16 | Start Infinispan container in a separate terminal: 17 | 18 | $ docker run --rm -e USER=admin -e PASS=password -p 11222:11222 -v $PWD/src/test/resources:/user-config/ quay.io/infinispan/server:15.0.5.Final -c /user-config/infinispan.xml 19 | 20 | You can run this example using: 21 | 22 | $ mvn spring-boot:run 23 | 24 | And you should see output in the console. 25 | 26 | === Help and contributions 27 | 28 | If you hit any problem using Camel or have some feedback, then please 29 | https://camel.apache.org/community/support/[let us know]. 30 | 31 | We also love contributors, so 32 | https://camel.apache.org/community/contributing/[get involved] :-) 33 | 34 | The Camel riders! 35 | -------------------------------------------------------------------------------- /infinispan/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | camel.main.name=Infinispan 19 | camel.springboot.main-run-controller=true 20 | camel.component.infinispan.hosts=localhost:11222 21 | camel.component.infinispan.username=admin 22 | camel.component.infinispan.password=password 23 | camel.component.infinispan.security-server-name=infinispan 24 | camel.component.infinispan.secure=true 25 | 26 | -------------------------------------------------------------------------------- /infinispan/src/test/java/org/apache/camel/example/springboot/infinispan/TestRoute.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.example.springboot.infinispan; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class TestRoute extends RouteBuilder { 9 | @Override 10 | public void configure() throws Exception { 11 | from("direct:test") 12 | .to("direct:put-cache") 13 | .to("mock:result"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /jira/README.adoc: -------------------------------------------------------------------------------- 1 | == Jira API Example 2 | 3 | This example shows how to use Jira Camel Endpoint to retrieve new comments, add issue and add an attachment. 4 | 5 | === How to run 6 | 7 | You can run this example using 8 | 9 | mvn compile exec:java 10 | 11 | === OAuth configuration 12 | 13 | This example uses OAuth authentication mechanism, then you should set the verificationCode, privateKey, accessToken in "application.properties" file. 14 | 15 | === More information 16 | 17 | You can find more information about Apache Camel at the website: http://camel.apache.org/ 18 | 19 | === Help and contributions 20 | 21 | If you hit any problem using Camel or have some feedback, then please 22 | https://camel.apache.org/community/support/[let us know]. 23 | 24 | We also love contributors, so 25 | https://camel.apache.org/community/contributing/[get involved] :-) 26 | 27 | The Camel riders! 28 | -------------------------------------------------------------------------------- /jira/src/main/java/org/apache/camel/example/jira/Application.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 | package org.apache.camel.example.jira; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | //CHECKSTYLE:OFF 23 | @SpringBootApplication 24 | public class Application { 25 | 26 | /** 27 | * A main method to start this application. 28 | */ 29 | public static void main(String[] args) { 30 | SpringApplication.run(Application.class, args); 31 | } 32 | 33 | } 34 | //CHECKSTYLE:ON 35 | -------------------------------------------------------------------------------- /jolokia/docs/add-connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/jolokia/docs/add-connection.png -------------------------------------------------------------------------------- /jolokia/docs/route-monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/jolokia/docs/route-monitor.png -------------------------------------------------------------------------------- /jolokia/src/main/java/org/apache/camel/example/MySpringBootApplication.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 | package org.apache.camel.example; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class MySpringBootApplication { 24 | 25 | /** 26 | * A main method to start this application. 27 | */ 28 | public static void main(String[] args) { 29 | SpringApplication.run(MySpringBootApplication.class, args); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /jolokia/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /kafka-avro/src/main/resources/avro/employee.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "type": "record", 3 | "name": "Employee", 4 | "namespace": "com.example.kafkatutorials", 5 | "fields": [ 6 | { 7 | "name": "firstName", 8 | "type": "string" 9 | }, 10 | { 11 | "name": "lastName", 12 | "type": "string" 13 | }, 14 | { 15 | "name": "birthDate", 16 | "type": "long" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /kafka-avro/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 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 | appender.out.type = Console 19 | appender.out.name = out 20 | appender.out.layout.type = PatternLayout 21 | appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n 22 | rootLogger.level = INFO 23 | rootLogger.appenderRef.out.ref = out 24 | -------------------------------------------------------------------------------- /kafka-oauth/containers/certificates/ca-truststore.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/kafka-oauth/containers/certificates/ca-truststore.p12 -------------------------------------------------------------------------------- /kafka-oauth/containers/certificates/gen-ca.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | # create CA key 5 | openssl genrsa -out ca.key 4096 6 | 7 | # create CA certificate 8 | openssl req -x509 -new -nodes -sha256 -days 3650 -subj "/CN=strimzi.io" -key ca.key -out ca.crt 9 | 10 | 11 | PASSWORD=changeit 12 | 13 | # create p12 truststore 14 | keytool -keystore ca-truststore.p12 -storetype pkcs12 -alias ca -storepass $PASSWORD -keypass $PASSWORD -import -file ca.crt -noprompt 15 | 16 | # copy the certificate to client dirs 17 | cp ca-truststore.p12 ../kafka-oauth-strimzi/kafka/config/ 18 | cp ca-truststore.p12 ../keycloak-import/config/ -------------------------------------------------------------------------------- /kafka-oauth/containers/kafka/certificates/cluster.keystore.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/kafka-oauth/containers/kafka/certificates/cluster.keystore.p12 -------------------------------------------------------------------------------- /kafka-oauth/containers/kafka/certificates/cluster.truststore.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/kafka-oauth/containers/kafka/certificates/cluster.truststore.p12 -------------------------------------------------------------------------------- /kafka-oauth/containers/kafka/certificates/gen-kafka-certs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | STOREPASS=Z_pkTh9xgZovK4t34cGB2o6afT4zZg0L 6 | 7 | echo "#### Generate broker keystore" 8 | keytool -keystore cluster.keystore.p12 -alias localhost -validity 3650 -genkey -keyalg RSA -ext SAN=DNS:kafka -dname "CN=my-cluster-kafka,O=io.strimzi" -deststoretype pkcs12 -storepass $STOREPASS -keypass $STOREPASS 9 | 10 | echo "#### Add the CA to the brokers’ truststore" 11 | keytool -keystore cluster.truststore.p12 -deststoretype pkcs12 -storepass $STOREPASS -alias CARoot -importcert -file ../../../certificates/ca.crt -noprompt 12 | 13 | echo "#### Export the certificate from the keystore" 14 | keytool -keystore cluster.keystore.p12 -storetype pkcs12 -alias localhost -certreq -file cert-file -storepass $STOREPASS 15 | 16 | echo "#### Sign the certificate with the CA" 17 | openssl x509 -req -CA ../../../certificates/ca.crt -CAkey ../../../certificates/ca.key -in cert-file -out cert-signed -days 3650 -CAcreateserial -passin pass:$STOREPASS 18 | 19 | echo "#### Import the CA and the signed certificate into the broker keystore" 20 | keytool -keystore cluster.keystore.p12 -deststoretype pkcs12 -alias CARoot -import -file ../../../certificates/ca.crt -storepass $STOREPASS -noprompt 21 | keytool -keystore cluster.keystore.p12 -deststoretype pkcs12 -alias localhost -import -file cert-signed -storepass $STOREPASS -noprompt 22 | -------------------------------------------------------------------------------- /kafka-oauth/containers/kafka/config/ca-truststore.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/kafka-oauth/containers/kafka/config/ca-truststore.p12 -------------------------------------------------------------------------------- /kafka-oauth/containers/kafka/scripts/functions.sh: -------------------------------------------------------------------------------- 1 | 2 | wait_for_url() { 3 | URL=$1 4 | MSG=$2 5 | 6 | if [[ $URL == https* ]]; then 7 | CMD="curl -k -sL -o /dev/null -w %{http_code} $URL" 8 | else 9 | CMD="curl -sL -o /dev/null -w %{http_code} $URL" 10 | fi 11 | 12 | until [ "200" == "`$CMD`" ] 13 | do 14 | echo "$MSG ($URL)" 15 | sleep 2 16 | done 17 | } -------------------------------------------------------------------------------- /kafka-oauth/containers/kafka/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source functions.sh 5 | 6 | URI=${KEYCLOAK_URI} 7 | if [ "" == "${URI}" ]; then 8 | URI="http://${KEYCLOAK_HOST:-keycloak}:8080" 9 | fi 10 | 11 | wait_for_url $URI "Waiting for Keycloak to start" 12 | 13 | wait_for_url "$URI/realms/${REALM:-demo}" "Waiting for realm '${REALM}' to be available" 14 | 15 | if [ "$SERVER_PROPERTIES_FILE" == "" ]; then 16 | echo "Generating a new strimzi.properties file using ENV vars" 17 | ./simple_kafka_config.sh $1 | tee /tmp/strimzi.properties 18 | else 19 | echo "Using provided server.properties file: $SERVER_PROPERTIES_FILE" 20 | cp $SERVER_PROPERTIES_FILE /tmp/strimzi.properties 21 | fi 22 | 23 | if [[ "$1" == "--kraft" ]]; then 24 | KAFKA_CLUSTER_ID="$(/opt/kafka/bin/kafka-storage.sh random-uuid)" 25 | /opt/kafka/bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c /tmp/strimzi.properties 26 | fi 27 | 28 | # add Strimzi kafka-oauth-* jars and their dependencies to classpath 29 | export CLASSPATH="/opt/kafka/libs/strimzi/*:$CLASSPATH" 30 | 31 | exec /opt/kafka/bin/kafka-server-start.sh /tmp/strimzi.properties -------------------------------------------------------------------------------- /kafka-oauth/containers/keycloak/certificates/ca-truststore.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/kafka-oauth/containers/keycloak/certificates/ca-truststore.p12 -------------------------------------------------------------------------------- /kafka-oauth/containers/keycloak/certificates/keycloak.server.keystore.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/kafka-oauth/containers/keycloak/certificates/keycloak.server.keystore.p12 -------------------------------------------------------------------------------- /kafka-oauth/containers/keycloak/compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | 3 | keycloak: 4 | image: quay.io/keycloak/keycloak:26.0 5 | ports: 6 | - "8080:8080" 7 | - "8443:8443" 8 | volumes: 9 | - ./realms:/opt/keycloak/data/import 10 | - ./certificates/keycloak.server.keystore.p12:/opt/keycloak/data/certs/keycloak.server.keystore.p12 11 | 12 | command: "-v start --import-realm --features=token-exchange,authorization,scripts --https-key-store-file=/opt/keycloak/data/certs/keycloak.server.keystore.p12 --https-key-store-password=changeit" 13 | 14 | environment: 15 | - KC_BOOTSTRAP_ADMIN_USERNAME=admin 16 | - KC_BOOTSTRAP_ADMIN_PASSWORD=admin 17 | - KC_HOSTNAME=keycloak 18 | - KC_HOSTNAME_ADMIN_URL=https://keycloak:8443 19 | - KC_HTTP_ENABLED=true -------------------------------------------------------------------------------- /kafka-oauth/start_keycloak.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd containers/keycloak 4 | podman run -it --rm \ 5 | -v ./realms:/opt/keycloak/data/import:Z \ 6 | -v ./certificates/keycloak.server.keystore.p12:/opt/keycloak/data/certs/keycloak.server.keystore.p12:Z \ 7 | -p 8080:8080 -p 8443:8443 \ 8 | -e KC_BOOTSTRAP_ADMIN_USERNAME=admin \ 9 | -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin \ 10 | -e KC_HOSTNAME=keycloak \ 11 | -e KC_HOSTNAME_ADMIN_URL=https://keycloak:8443 \ 12 | -e KC_HTTP_ENABLED=true \ 13 | --name keycloak \ 14 | --network host \ 15 | quay.io/keycloak/keycloak:26.0 \ 16 | -v start --import-realm --features=token-exchange,authorization,scripts --https-key-store-file=/opt/keycloak/data/certs/keycloak.server.keystore.p12 --https-key-store-password=changeit 17 | cd - 18 | -------------------------------------------------------------------------------- /kafka-offsetrepository/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 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 | appender.out.type = Console 19 | appender.out.name = out 20 | appender.out.layout.type = PatternLayout 21 | appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n 22 | rootLogger.level = INFO 23 | rootLogger.appenderRef.out.ref = out 24 | -------------------------------------------------------------------------------- /kafka-offsetrepository/src/main/resources/offsetStateRepo.dat: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kamelet-chucknorris/readme.adoc: -------------------------------------------------------------------------------- 1 | == Camel Example Kamelet Chuck Norris 2 | 3 | === Introduction 4 | 5 | This example shows how you can build a simple Kamelet and use with your Camel applications. 6 | 7 | The kamelet is created as a YAML file in the `src/main/resources/kamelets` directory. 8 | We have developed a Chuck Norris Kamelet that periodically gets a joke from the Chuck Norris internet database. 9 | 10 | A Camel routes is coded in Java in the `src/main/java/samples/camel/MyRoute.java` file 11 | that uses the Kamelet, and log the result from the Kamelet to the console. 12 | 13 | === How to run 14 | 15 | You can run this example using 16 | 17 | mvn spring-boot:run 18 | 19 | === Help and contributions 20 | 21 | If you hit any problem using Camel or have some feedback, then please 22 | https://camel.apache.org/support.html[let us know]. 23 | 24 | We also love contributors, so 25 | https://camel.apache.org/contributing.html[get involved] :-) 26 | 27 | The Camel riders! 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /kamelet-chucknorris/src/main/java/sample/camel/MyRoute.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 | package sample.camel; 18 | 19 | import org.apache.camel.builder.RouteBuilder; 20 | import org.springframework.stereotype.Component; 21 | 22 | /** 23 | * Java route that uses the kamelet and logs the response. 24 | */ 25 | @Component 26 | public class MyRoute extends RouteBuilder { 27 | 28 | @Override 29 | public void configure() throws Exception { 30 | from("kamelet:chuck-norris-source") 31 | .log("${body}"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kamelet-chucknorris/src/main/resources/application.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 | camel: 19 | springboot: 20 | name: ChuckCamel 21 | # keep the application running 22 | main-run-controller: true 23 | -------------------------------------------------------------------------------- /load-balancer-eip/src/main/java/org/apache/camel/springboot/example/Application.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 | package org.apache.camel.springboot.example; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class Application { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(Application.class, args); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /load-balancer-eip/src/main/java/org/apache/camel/springboot/example/MyException.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 | package org.apache.camel.springboot.example; 18 | 19 | public class MyException extends RuntimeException { 20 | 21 | MyException() { 22 | } 23 | 24 | MyException(String message) { 25 | super(message); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /load-balancer-eip/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # the name of Camel 2 | camel.main.name = CamelLoadBalancerExample 3 | 4 | # to configure logging levels 5 | logging.level.org.springframework = INFO 6 | logging.level.org.apache.camel.spring.boot = INFO 7 | logging.level.org.apache.camel.impl = INFO 8 | logging.level.org.apache.camel = INFO 9 | logging.level.sample.camel = INFO 10 | #logging.level.sample.camel = DEBUG 11 | -------------------------------------------------------------------------------- /master/src/main/resources/application-openshift.properties: -------------------------------------------------------------------------------- 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 | node.id = ${HOSTNAME} 19 | node.namespace = ${KUBERNETES_NAMESPACE} 20 | -------------------------------------------------------------------------------- /metrics/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | wrapperVersion=3.3.2 18 | distributionType=only-script 19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip 20 | -------------------------------------------------------------------------------- /metrics/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | info.build.name=Example of sending camel metrics to Graphite 19 | camel.main.name=camel-example-spring-boot-metrics 20 | -------------------------------------------------------------------------------- /multi-datasource-2pc/.gitignore: -------------------------------------------------------------------------------- 1 | transaction-logs 2 | test-transactions-logs -------------------------------------------------------------------------------- /multi-datasource-2pc/src/main/resources/schema-ds1.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS names; 2 | CREATE TABLE names ( 3 | name VARCHAR(255) 4 | ); 5 | -------------------------------------------------------------------------------- /multi-datasource-2pc/src/main/resources/schema-ds2.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS names; 2 | CREATE TABLE names ( 3 | name VARCHAR(255) UNIQUE DEFERRABLE INITIALLY DEFERRED 4 | ); 5 | -------------------------------------------------------------------------------- /multi-datasource-2pc/src/test/resources/application-test.properties: -------------------------------------------------------------------------------- 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 | # test profile properties 19 | 20 | myPeriod = 1000 21 | narayana.log-dir = test-transactions-logs 22 | -------------------------------------------------------------------------------- /observation/adoc/img/trace.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/observation/adoc/img/trace.jpeg -------------------------------------------------------------------------------- /observation/client/src/main/java/sample/camel/CounterBean.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 | package sample.camel; 18 | 19 | import org.springframework.stereotype.Component; 20 | 21 | @Component 22 | public class CounterBean { 23 | 24 | private int counter; 25 | 26 | public String someMethod(String body) { 27 | return "" + ++counter; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /observation/client/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /observation/client/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /observation/client/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | %d{HH:mm:ss.SSS} %-5level %logger - %msg%n 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /observation/containers/docker/config/grafana/provisioning/dashboards/dashboard.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | providers: 4 | - name: dashboards 5 | type: file 6 | disableDeletion: true 7 | editable: true 8 | options: 9 | path: /etc/grafana/provisioning/dashboards 10 | foldersFromFilesStructure: true 11 | -------------------------------------------------------------------------------- /observation/containers/docker/config/grafana/provisioning/datasources/datasource.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | datasources: 4 | - name: Prometheus 5 | type: prometheus 6 | access: proxy 7 | url: http://host.docker.internal:9090 8 | editable: false 9 | jsonData: 10 | httpMethod: POST 11 | exemplarTraceIdDestinations: 12 | - name: trace_id 13 | url: http://localhost:9411/zipkin/traces/$${__value.raw} 14 | -------------------------------------------------------------------------------- /observation/containers/docker/config/prometheus/prometheus.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s 3 | evaluation_interval: 15s 4 | 5 | scrape_configs: 6 | - job_name: 'prometheus' 7 | static_configs: 8 | - targets: ['host.docker.internal:9090'] 9 | - job_name: 'webservices' 10 | metrics_path: '/actuator/prometheus' 11 | static_configs: 12 | - targets: ['host.docker.internal:6543','host.docker.internal:7654','host.docker.internal:5432'] 13 | -------------------------------------------------------------------------------- /observation/loggingtracer/src/main/resources/META-INF/LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/observation/loggingtracer/src/main/resources/META-INF/LICENSE.txt -------------------------------------------------------------------------------- /observation/loggingtracer/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/observation/loggingtracer/src/main/resources/META-INF/NOTICE.txt -------------------------------------------------------------------------------- /observation/loggingtracer/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/observation/loggingtracer/src/main/resources/META-INF/beans.xml -------------------------------------------------------------------------------- /observation/loggingtracer/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/observation/loggingtracer/src/main/resources/log4j2.properties -------------------------------------------------------------------------------- /observation/service1/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /observation/service1/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | %d{HH:mm:ss.SSS} %-5level %logger - %msg%n 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /observation/service2/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /observation/service2/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | %d{HH:mm:ss.SSS} %-5level %logger - %msg%n 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /openapi-contract-first/daisy.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 555, 3 | "name": "Daisy the parrot" 4 | } -------------------------------------------------------------------------------- /opentelemetry/.gitignore: -------------------------------------------------------------------------------- 1 | ### IntelliJ IDEA ### 2 | out/ 3 | !**/src/main/**/out/ 4 | !**/src/test/**/out/ 5 | 6 | ### Eclipse ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | bin/ 15 | !**/src/main/**/bin/ 16 | !**/src/test/**/bin/ 17 | 18 | ### NetBeans ### 19 | /nbproject/private/ 20 | /nbbuild/ 21 | /dist/ 22 | /nbdist/ 23 | /.nb-gradle/ 24 | 25 | ### VS Code ### 26 | .vscode/ 27 | 28 | ### Mac OS ### 29 | .DS_Store -------------------------------------------------------------------------------- /opentelemetry/CarBooking/src/main/java/com/example/demo/DemoApplication.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 | package com.example.demo; 18 | 19 | import org.apache.camel.opentelemetry.starter.CamelOpenTelemetry; 20 | import org.springframework.boot.SpringApplication; 21 | import org.springframework.boot.autoconfigure.SpringBootApplication; 22 | 23 | @CamelOpenTelemetry 24 | @SpringBootApplication 25 | public class DemoApplication { 26 | 27 | public static void main(String[] args) { 28 | SpringApplication.run(DemoApplication.class, args); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /opentelemetry/CarBooking/src/test/java/com/example/demo/DemoApplicationTests.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 | package com.example.demo; 18 | 19 | import org.junit.jupiter.api.Test; 20 | import org.springframework.boot.test.context.SpringBootTest; 21 | 22 | @SpringBootTest 23 | class DemoApplicationTests { 24 | 25 | @Test 26 | void contextLoads() { 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /opentelemetry/FlightBooking/src/test/java/com/example/demo/DemoApplicationTests.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 | package com.example.demo; 18 | 19 | import org.junit.jupiter.api.Test; 20 | import org.springframework.boot.test.context.SpringBootTest; 21 | 22 | @SpringBootTest 23 | class DemoApplicationTests { 24 | 25 | @Test 26 | void contextLoads() { 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /opentelemetry/HotelBooking/src/test/java/com/example/demo/DemoApplicationTests.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 | package com.example.demo; 18 | 19 | import org.junit.jupiter.api.Test; 20 | import org.springframework.boot.test.context.SpringBootTest; 21 | 22 | @SpringBootTest 23 | class DemoApplicationTests { 24 | 25 | @Test 26 | void contextLoads() { 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /opentelemetry/TripBooking/src/main/java/com/example/demo/DemoApplication.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 | package com.example.demo; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | import org.apache.camel.opentelemetry.starter.CamelOpenTelemetry; 22 | 23 | @CamelOpenTelemetry 24 | @SpringBootApplication 25 | public class DemoApplication { 26 | 27 | public static void main(String[] args) { 28 | SpringApplication.run(DemoApplication.class, args); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /opentelemetry/adoc/img/example.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/opentelemetry/adoc/img/example.jpeg -------------------------------------------------------------------------------- /opentelemetry/adoc/img/metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/opentelemetry/adoc/img/metrics.png -------------------------------------------------------------------------------- /opentelemetry/adoc/img/trace-async-dag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/opentelemetry/adoc/img/trace-async-dag.png -------------------------------------------------------------------------------- /opentelemetry/adoc/img/trace-async.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/opentelemetry/adoc/img/trace-async.png -------------------------------------------------------------------------------- /opentelemetry/adoc/img/trace-sync-dag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/opentelemetry/adoc/img/trace-sync-dag.png -------------------------------------------------------------------------------- /opentelemetry/adoc/img/trace-sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/opentelemetry/adoc/img/trace-sync.png -------------------------------------------------------------------------------- /opentelemetry/containers/docker/prometheusConfig.yml: -------------------------------------------------------------------------------- 1 | #Global configurations 2 | global: 3 | scrape_interval: 5s # Set the scrape interval to every 5 seconds. 4 | evaluation_interval: 5s # Evaluate rules every 5 seconds. 5 | scrape_configs: 6 | - job_name: 'jaeger' 7 | metrics_path: '/metrics' 8 | static_configs: 9 | - targets: ['jaeger:14269'] 10 | - job_name: 'otel-collector' 11 | scrape_interval: 10s 12 | static_configs: 13 | - targets: ['otel-collector:8889'] 14 | - targets: ['otel-collector:8888'] -------------------------------------------------------------------------------- /paho-mqtt5-shared-subscriptions/img/nonSharedSubscription.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/paho-mqtt5-shared-subscriptions/img/nonSharedSubscription.gif -------------------------------------------------------------------------------- /paho-mqtt5-shared-subscriptions/img/sharedSubscription.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/paho-mqtt5-shared-subscriptions/img/sharedSubscription.gif -------------------------------------------------------------------------------- /paho-mqtt5-shared-subscriptions/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | logging.level.org.eclipse.paho.mqttv5.client.internal=WARN 19 | 20 | broker.url=tcp://broker.emqx.io:1883 21 | 22 | consumer.topic=$share/gr1/topic 23 | 24 | producer.topic=topic 25 | 26 | producer.period=1000 27 | -------------------------------------------------------------------------------- /platform-http/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # the name of Camel 19 | camel.main.name = MyCamel 20 | -------------------------------------------------------------------------------- /pojo/README.adoc: -------------------------------------------------------------------------------- 1 | == Spring Boot Example with POJO Routing 2 | 3 | === Introduction 4 | 5 | This example demonstrates how you can use POJO Routing with Camel's `@Consume` and `@Produce` annotations 6 | on your Java beans. The example will generate a series of random numbers that are routed to either a low 7 | or high method call. The method then constructs a new message that is routed to another POJO that is 8 | hidden by an interface. 9 | 10 | === Build 11 | 12 | You can build this example using: 13 | 14 | $ mvn package 15 | 16 | === Run 17 | 18 | You can run this example using: 19 | 20 | $ mvn spring-boot:run 21 | 22 | And you should see output in the console with high and low numbers. The example will self stop after one minute. 23 | 24 | === Help and contributions 25 | 26 | If you hit any problem using Camel or have some feedback, then please 27 | https://camel.apache.org/community/support/[let us know]. 28 | 29 | We also love contributors, so 30 | https://camel.apache.org/community/contributing/[get involved] :-) 31 | 32 | The Camel riders! 33 | -------------------------------------------------------------------------------- /pojo/src/main/java/sample/camel/MagicNumber.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 | package sample.camel; 18 | 19 | /** 20 | * A interface to hide Camel pojo producer 21 | */ 22 | public interface MagicNumber { 23 | 24 | /** 25 | * When we have a message with a new number 26 | */ 27 | void onMagicNumber(String message); 28 | } 29 | -------------------------------------------------------------------------------- /pojo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # give Camel a name 19 | camel.main.name = PojoExample 20 | 21 | # keep camel running 22 | camel.springboot.main-run-controller = true 23 | 24 | # automatic shutdown after 60 seconds 25 | camel.springboot.duration-max-seconds = 60 26 | -------------------------------------------------------------------------------- /quartz/README.adoc: -------------------------------------------------------------------------------- 1 | == Spring Boot Example with Quartz and Log 2 | 3 | === Introduction 4 | 5 | This example demonstrates how to use Quartz Starter with Log Starter. 6 | 7 | === Build 8 | 9 | You can build this example using: 10 | 11 | $ mvn package 12 | 13 | === Run 14 | 15 | You can run this example using: 16 | 17 | $ mvn spring-boot:run 18 | 19 | And you should see output in the console with high and low numbers. The example will self stop after one minute. 20 | 21 | === Help and contributions 22 | 23 | If you hit any problem using Camel or have some feedback, then please 24 | https://camel.apache.org/community/support/[let us know]. 25 | 26 | We also love contributors, so 27 | https://camel.apache.org/community/contributing/[get involved] :-) 28 | 29 | The Camel riders! 30 | -------------------------------------------------------------------------------- /quartz/src/main/java/sample/camel/QuartzRoute.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 | package sample.camel; 18 | 19 | import org.apache.camel.builder.RouteBuilder; 20 | import org.springframework.stereotype.Component; 21 | 22 | @Component 23 | public class QuartzRoute extends RouteBuilder { 24 | 25 | @Override 26 | public void configure() throws Exception { 27 | from("quartz://myGroup/myTimerName?cron=0/5+*+*+*+*+?") 28 | .setBody(constant("Test")) 29 | .to("log:info"); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /quartz/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # give Camel a name 19 | camel.main.name = Quartz-to-Log 20 | 21 | # keep camel running 22 | camel.springboot.main-run-controller = true 23 | 24 | # automatic shutdown after 60 seconds 25 | camel.springboot.duration-max-seconds = 60 26 | -------------------------------------------------------------------------------- /rabbitmq/readme.adoc: -------------------------------------------------------------------------------- 1 | == Camel Example RabbitMQ 2 | 3 | This example shows how to work with a simple Apache Camel application that routes message to RabbitMQ. 4 | 5 | The example generates messages using timer trigger, routes them via RabbitMQ and logs to message. 6 | 7 | === Configuring RabbitMQ 8 | 9 | The sample application uses `localhost:5672` to connect to the RabbitMQ broker. 10 | This can be configured in the `application.properties` file. 11 | 12 | The login information is the default `guest/guest` account, which can be configured 13 | in the `application.properties` file as well. 14 | 15 | === How to run 16 | 17 | The sample requires a RabbitMQ broker to be running. 18 | 19 | You can for example easily start RabbitMQ via Docker 20 | 21 | docker run -it -p 5672:5672 --hostname my-rabbit --name some-rabbit rabbitmq:3 22 | 23 | Then you can run this example using 24 | 25 | mvn spring-boot:run 26 | 27 | === Help and contributions 28 | 29 | If you hit any problem using Camel or have some feedback, then please 30 | https://camel.apache.org/support.html[let us know]. 31 | 32 | We also love contributors, so 33 | https://camel.apache.org/contributing.html[get involved] :-) 34 | 35 | The Camel riders! 36 | -------------------------------------------------------------------------------- /reactive-streams/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /reactive-streams/src/main/resources/application.yml: -------------------------------------------------------------------------------- 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 | # All examples are enabled by default. 19 | # You can turn them on-off here 20 | examples: 21 | basic: 22 | camel-to-reactor: true 23 | reactor-to-camel: true 24 | camel-to-reactor-in-out: true 25 | reactor-to-camel-in-out: true 26 | client-api: 27 | rest: true 28 | workflow: true 29 | others: 30 | rest: true 31 | 32 | -------------------------------------------------------------------------------- /resilience4j/client/src/main/java/sample/camel/CounterBean.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 | package sample.camel; 18 | 19 | import org.springframework.stereotype.Component; 20 | 21 | @Component("counterBean") 22 | public class CounterBean { 23 | 24 | private int counter; 25 | 26 | public String someMethod(String body) { 27 | return "" + ++counter; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /resilience4j/client/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /resilience4j/client/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /resilience4j/client/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 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 | appender.stdout.type = Console 19 | appender.stdout.name = stdout 20 | appender.stdout.layout.type = PatternLayout 21 | appender.stdout.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n 22 | rootLogger.level = INFO 23 | rootLogger.appenderRef.stdout.ref = stdout 24 | -------------------------------------------------------------------------------- /resilience4j/client2/src/main/java/sample/camel/CounterBean.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 | package sample.camel; 18 | 19 | public class CounterBean { 20 | 21 | private int counter; 22 | 23 | public String someMethod(String body) { 24 | return "" + ++counter; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /resilience4j/client2/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /resilience4j/client2/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /resilience4j/client2/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 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 | appender.stdout.type = Console 19 | appender.stdout.name = stdout 20 | appender.stdout.layout.type = PatternLayout 21 | appender.stdout.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n 22 | rootLogger.level = INFO 23 | rootLogger.appenderRef.stdout.ref = stdout 24 | -------------------------------------------------------------------------------- /resilience4j/service1/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /resilience4j/service1/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # the name of Camel 19 | camel.main.name=Service1 20 | camel.springboot.main-run-controller=true 21 | server.port=9090 22 | 23 | # the port number the service will use for accepting incoming HTTP requests 24 | service1.port=${server.port} 25 | service2.port=7070 26 | -------------------------------------------------------------------------------- /resilience4j/service2/src/main/java/sample/camel/Service2Application.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 | package sample.camel; 18 | 19 | import org.apache.camel.main.Main; 20 | 21 | //CHECKSTYLE:OFF 22 | /** 23 | * A Java main that runs Camel service 2 using Camel Main 24 | */ 25 | public class Service2Application { 26 | 27 | public static void main(String[] args) throws Exception { 28 | Main main = new Main(); 29 | main.configure().addRoutesBuilder(new Service2Route()); 30 | main.run(); 31 | } 32 | 33 | } 34 | //CHECKSTYLE:ON 35 | -------------------------------------------------------------------------------- /resilience4j/service2/src/main/java/sample/camel/Service2Route.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 | package sample.camel; 18 | 19 | import org.apache.camel.builder.RouteBuilder; 20 | 21 | public class Service2Route extends RouteBuilder { 22 | 23 | @Override 24 | public void configure() throws Exception { 25 | from("platform-http:/service2").routeId("service2").streamCache("true") 26 | .log(" Service2 request: ${body}") 27 | .transform(simple("Service2-${body}")) 28 | .log("Service2 response: ${body}"); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /resilience4j/service2/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /resilience4j/service2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # the name of Camel 19 | camel.main.name=Service2 20 | camel.server.enabled=true 21 | 22 | # the port number the service will use for accepting incoming HTTP requests 23 | camel.server.port=7070 24 | -------------------------------------------------------------------------------- /resilience4j/service2/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 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 | appender.stdout.type = Console 19 | appender.stdout.name = stdout 20 | appender.stdout.layout.type = PatternLayout 21 | appender.stdout.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n 22 | rootLogger.level = INFO 23 | rootLogger.appenderRef.stdout.ref = stdout 24 | -------------------------------------------------------------------------------- /rest-cxf-opentelemetry/containers/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | 3 | services: 4 | 5 | minio: 6 | image: "quay.io/minio/minio:latest" 7 | environment: 8 | - MINIO_ROOT_USER=admin 9 | - MINIO_ROOT_PASSWORD=admin123 10 | ports: 11 | - "9000:9000" 12 | - "9001:9001" 13 | command: 14 | - server 15 | - /data 16 | - --console-address 17 | - :9001 18 | 19 | otel-collector: 20 | image: otel/opentelemetry-collector:latest 21 | command: 22 | - --config=/etc/otelcol-cont/otel-collector.yml 23 | volumes: 24 | - ./otel-collector.yml:/etc/otelcol-cont/otel-collector.yml 25 | ports: 26 | - "4318:4318" # OTLP http receiver 27 | - "4317:4317" # OTLP grpc receiver 28 | depends_on: 29 | - jaeger-all-in-one 30 | 31 | jaeger-all-in-one: 32 | image: quay.io/jaegertracing/all-in-one:latest 33 | restart: always 34 | ports: 35 | - "16686:16686" 36 | -------------------------------------------------------------------------------- /rest-cxf-opentelemetry/containers/env.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 4 | export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces 5 | export OTEL_TRACES_EXPORTER=otlp 6 | export OTEL_METRICS_EXPORTER=none 7 | export OTEL_LOGS_EXPORTER=none 8 | #export OTEL_JAVAAGENT_DEBUG=true 9 | -------------------------------------------------------------------------------- /rest-cxf-opentelemetry/containers/otel-collector.yml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | endpoint: 0.0.0.0:4317 6 | http: 7 | endpoint: 0.0.0.0:4318 8 | 9 | processors: 10 | batch: 11 | 12 | exporters: 13 | debug: 14 | verbosity: detailed 15 | otlp/jaeger: 16 | endpoint: jaeger-all-in-one:4317 17 | tls: 18 | insecure: true 19 | 20 | service: 21 | pipelines: 22 | traces: 23 | receivers: [otlp] 24 | processors: [batch] 25 | exporters: [debug,otlp/jaeger] 26 | -------------------------------------------------------------------------------- /rest-cxf-opentelemetry/docs/jaeger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/rest-cxf-opentelemetry/docs/jaeger.png -------------------------------------------------------------------------------- /rest-cxf-opentelemetry/docs/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/rest-cxf-opentelemetry/docs/overview.png -------------------------------------------------------------------------------- /rest-cxf-opentelemetry/rest-cxf-otel-common/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader: -------------------------------------------------------------------------------- 1 | # Generated by camel build tools - do NOT edit this file! 2 | org.apache.camel.example.springboot.cxf.otel.InputStreamConverterLoader 3 | org.apache.camel.example.springboot.cxf.otel.IntegerConverterLoader 4 | -------------------------------------------------------------------------------- /rest-cxf-opentelemetry/rest-cxf-otel-common/src/main/java/org/apache/camel/example/springboot/cxf/otel/Constants.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 | package org.apache.camel.example.springboot.cxf.otel; 18 | 19 | public final class Constants { 20 | 21 | private Constants() { 22 | } 23 | 24 | public static final String SERVICE_HEADER_NAME = "service-name"; 25 | 26 | public enum NUM_TYPE { 27 | EVEN, 28 | ODD 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /rest-cxf-opentelemetry/rest-cxf-otel-common/src/main/java/org/apache/camel/example/springboot/cxf/otel/IntegerConverter.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 | package org.apache.camel.example.springboot.cxf.otel; 18 | 19 | import org.apache.camel.Converter; 20 | import org.apache.camel.TypeConverters; 21 | 22 | @Converter(generateLoader = true) 23 | public class IntegerConverter implements TypeConverters { 24 | 25 | @Converter 26 | public static RandomNumber toRandomNumber(Integer num) { 27 | return new RandomNumber(num); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /rest-cxf-opentelemetry/rest-cxf-otel-even/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # the name of Camel 19 | camel.main.name = cxf-otel-even 20 | camel.springboot.main-run-controller=true 21 | service.random.url = http://localhost:8080 22 | #logging.level.org.apache.cxf = TRACE 23 | -------------------------------------------------------------------------------- /rest-cxf-opentelemetry/rest-cxf-otel-odd/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # the name of Camel 19 | camel.main.name = cxf-otel-odd 20 | camel.springboot.main-run-controller=true 21 | service.random.url = http://localhost:8080 22 | #logging.level.org.apache.cxf = TRACE 23 | -------------------------------------------------------------------------------- /rest-cxf/src/main/java/org/apache/camel/example/springboot/cxf/CxfConfig.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 | package org.apache.camel.example.springboot.cxf; 18 | 19 | import org.springframework.context.annotation.Bean; 20 | import org.springframework.context.annotation.Configuration; 21 | 22 | import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; 23 | 24 | @Configuration 25 | public class CxfConfig { 26 | 27 | @Bean 28 | public JacksonJsonProvider jaxrsProvider() { 29 | return new JacksonJsonProvider(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /rest-cxf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # the name of Camel 19 | camel.main.name = MyCamel 20 | camel.springboot.main-run-controller=true 21 | #logging.level.org.apache.cxf = TRACE 22 | -------------------------------------------------------------------------------- /rest-openapi-simple/README.adoc: -------------------------------------------------------------------------------- 1 | == Camel Rest OpenApi example 2 | 3 | This example shows how to call a REST service defined using OpenApi 4 | specification with the help of Camel Rest OpenApi component. 5 | 6 | The example is a standalone Spring Boot application that acts as a REST 7 | client, you can run simply by issuing: 8 | 9 | .... 10 | $ mvn spring-boot:run 11 | .... 12 | 13 | Or by packaging it and running it using `+java+` CLI: 14 | 15 | .... 16 | $ mvn package 17 | $ java -jar target/camel-example-spring-boot-rest-openapi-simple-*.jar 18 | .... 19 | 20 | The example by default uses the PetStore demo hosted on swagger.io and 21 | invokes the `+logoutUser+` operation. You can make it call any API 22 | that you have OpenApi specification for and any operation with simple 23 | arguments, for instance this retrieves a pet from the PetStore demo with 24 | ID `+14+`: 25 | 26 | .... 27 | $ java -jar target/camel-example-spring-boot-rest-openapi-*.jar \ 28 | --openapi=https://petstore3.swagger.io/api/v3/openapi.json \ 29 | --operation=getPetById \ 30 | --petId=14 31 | .... 32 | 33 | === Help and contributions 34 | 35 | If you hit any problem using Camel or have some feedback, then please 36 | https://camel.apache.org/community/support/[let us know]. 37 | 38 | We also love contributors, so 39 | https://camel.apache.org/community/contributing/[get involved] :-) 40 | 41 | The Camel riders! 42 | -------------------------------------------------------------------------------- /route-reload/readme.adoc: -------------------------------------------------------------------------------- 1 | == Route Reload Example 2 | 3 | This example shows how to use route reloading. This feature is watching a directory folder 4 | for file changes, and then automatic trigger reload of the running routes in the Camel application. 5 | 6 | The example generates messages using timer trigger, writes them to standard output. 7 | 8 | === How to run 9 | 10 | You can run this example using 11 | 12 | mvn spring-boot:run 13 | 14 | Then you can edit the `src/main/resources/camel/my-route.xml` file and save, to trigger 15 | automatic reloading. 16 | 17 | === Help and contributions 18 | 19 | If you hit any problem using Camel or have some feedback, then please 20 | https://camel.apache.org/support.html[let us know]. 21 | 22 | We also love contributors, so 23 | https://camel.apache.org/contributing.html[get involved] :-) 24 | 25 | The Camel riders! 26 | -------------------------------------------------------------------------------- /routes-configuration/readme.adoc: -------------------------------------------------------------------------------- 1 | == Camel Example Spring Boot Route Configuration 2 | 3 | This example shows how Camel is capable of loading routes during startup using the new route loader system. 4 | The route loader has support for loading routes in XML, Java and YAML (other languages to be added). 5 | 6 | In this example the focus is on how you can use global _routes configuration_ with the DSL to separate 7 | error handling (and other cross routes functionality) from all your routes. 8 | 9 | This example has one route in Java, XML and YAML. Each of those routes refer to a 10 | specific route configuration, which is also _coded_ in the same language as the route. 11 | But this is not required, you can use Java to code your route configurations for 12 | advanced error handling, and then _code_ your routes in other languages such as XML or YAML. 13 | 14 | === How to run 15 | 16 | You can run this example using 17 | 18 | mvn spring-boot:run 19 | 20 | === Help and contributions 21 | 22 | If you hit any problem using Camel or have some feedback, then please 23 | https://camel.apache.org/support.html[let us know]. 24 | 25 | We also love contributors, so 26 | https://camel.apache.org/contributing.html[get involved] :-) 27 | 28 | The Camel riders! 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /routes-configuration/src/main/resources/myerror/xml-error.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | java.lang.Exception 24 | true 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /routes-configuration/src/main/resources/myerror/yaml-error.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 | - routeConfiguration: 19 | id: "yamlError" 20 | onException: 21 | - onException: 22 | handled: 23 | constant: "true" 24 | exception: 25 | - "java.lang.Exception" 26 | steps: 27 | - log: 28 | message: "YAML WARN ${exception.message}" 29 | -------------------------------------------------------------------------------- /routes-configuration/src/main/resources/myinterceptor/xml-interceptor.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /routetemplate-xml/README.adoc: -------------------------------------------------------------------------------- 1 | == Camel Example Spring Boot Route Template in XML 2 | 3 | This examples shows how to use Route Templates (parameterized routes) to specify a skeleton route 4 | which can be used for creating and adding new routes via parameters in pure XML. 5 | 6 | The route template is defined via XML DSL (RouteBuilder) in the resource `templates/my-route-templates.xml`. 7 | 8 | The resource `builders/my-template-builder.xml` is used to create two routes from the template using different set of parameters by leveraging the XML DSL. 9 | 10 | === Build 11 | 12 | You will need to compile this example first: 13 | 14 | ---- 15 | $ mvn compile 16 | ---- 17 | 18 | === How to run 19 | 20 | You can run this example using 21 | 22 | ---- 23 | $ mvn spring-boot:run 24 | ---- 25 | 26 | === Help and contributions 27 | 28 | If you hit any problem using Camel or have some feedback, then please 29 | https://camel.apache.org/community/support/[let us know]. 30 | 31 | We also love contributors, so 32 | https://camel.apache.org/community/contributing/[get involved] :-) 33 | 34 | The Camel riders! 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /routetemplate-xml/src/main/resources/application.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 | camel: 19 | springboot: 20 | name: MyCamel 21 | routes-include-pattern: classpath:templates/*.xml,classpath:builders/*.xml 22 | -------------------------------------------------------------------------------- /routetemplate/src/main/resources/application-xml.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 | camel: 19 | springboot: 20 | routes-include-pattern: classpath:mycamel/*.xml 21 | route-template: 22 | config: 23 | -0.template-id: myXmlTemplate 24 | -0.route-id: first 25 | -0.name: one 26 | -0.greeting: Hello 27 | -1.template-id: myXmlTemplate 28 | -1.route-id: second 29 | -1.name: deux 30 | -1.greeting: Bonjour 31 | -1.my-period: 5s 32 | -------------------------------------------------------------------------------- /routetemplate/src/main/resources/application.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 | spring: 19 | profiles: 20 | active: xml 21 | 22 | camel: 23 | springboot: 24 | name: MyCamel 25 | -------------------------------------------------------------------------------- /saga/doc-resources/compesate-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/saga/doc-resources/compesate-diagram.png -------------------------------------------------------------------------------- /saga/doc-resources/logic-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/saga/doc-resources/logic-diagram.png -------------------------------------------------------------------------------- /saga/doc-resources/tech-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/saga/doc-resources/tech-diagram.png -------------------------------------------------------------------------------- /saga/install-ocp-ephemeral.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo creating amq-broker instance 4 | oc create -f ocp-resources/amq-broker-ephemeral.yaml 5 | 6 | echo creating lra-coordinator instance 7 | oc create -f ocp-resources/lra-coordinator-ephemeral.yaml 8 | 9 | echo deploying services 10 | mvn clean package -Popenshift 11 | -------------------------------------------------------------------------------- /saga/install-ocp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo creating amq-broker instance 4 | oc create -f ocp-resources/amq-broker.yaml 5 | 6 | echo creating lra-coordinator instance 7 | oc create -f ocp-resources/lra-coordinator.yaml 8 | 9 | echo deploying services 10 | mvn clean package -Popenshift 11 | -------------------------------------------------------------------------------- /saga/local-resources/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | lra-coordinator: 3 | image: "quay.io/jbosstm/lra-coordinator:latest" 4 | network_mode: "host" 5 | amq-broker: 6 | image: "registry.redhat.io/amq7/amq-broker-rhel8:7.12" 7 | environment: 8 | - AMQ_USER=admin 9 | - AMQ_PASSWORD=admin 10 | - AMQ_REQUIRE_LOGIN=true 11 | ports: 12 | - "8161:8161" 13 | - "61616:61616" 14 | -------------------------------------------------------------------------------- /saga/run-local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo running amq broker and lra-coordinator 4 | docker compose -f local-resources/compose.yaml up -d 5 | 6 | echo compiling project 7 | mvn clean package 8 | 9 | echo running payment service 10 | mvn -f saga-payment-service/ spring-boot:run 11 | 12 | echo running flight service 13 | mvn -f saga-flight-service/ spring-boot:run 14 | 15 | echo running train service 16 | mvn -f saga-train-service/ spring-boot:run 17 | 18 | echo running saga application 19 | mvn -f saga-app/ spring-boot:run 20 | -------------------------------------------------------------------------------- /saga/saga-app/src/main/java/org/apache/camel/example/saga/CamelSagaApplication.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 | package org.apache.camel.example.saga; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | //CHECKSTYLE:OFF 23 | @SpringBootApplication 24 | public class CamelSagaApplication { 25 | 26 | public static void main(String[] args) { 27 | SpringApplication.run(CamelSagaApplication.class, args); 28 | } 29 | } 30 | // CHECKSTYLE:ON 31 | -------------------------------------------------------------------------------- /saga/saga-app/src/main/jkube/deployment.yml: -------------------------------------------------------------------------------- 1 | spec: 2 | template: 3 | spec: 4 | containers: 5 | - env: 6 | - name: CAMEL_LRA_COORDINATOR_URL 7 | value: http://lra-coordinator:8080 8 | - name: CAMEL_LRA_LOCAL_PARTICIPANT_URL 9 | value: http://${project.artifactId}:8080/api 10 | - name: SPRING_ARTEMIS_BROKER_URL 11 | value: tcp://amq-broker:61616 12 | -------------------------------------------------------------------------------- /saga/saga-flight-service/src/main/java/org/apache/camel/example/saga/CamelSagaFlightService.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.example.saga; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | //CHECKSTYLE:OFF 7 | @SpringBootApplication 8 | public class CamelSagaFlightService { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(CamelSagaFlightService.class, args); 12 | } 13 | } 14 | // CHECKSTYLE:ON 15 | -------------------------------------------------------------------------------- /saga/saga-flight-service/src/main/jkube/deployment.yml: -------------------------------------------------------------------------------- 1 | spec: 2 | template: 3 | spec: 4 | containers: 5 | - env: 6 | - name: CAMEL_LRA_COORDINATOR_URL 7 | value: http://lra-coordinator:8080 8 | - name: CAMEL_LRA_LOCAL_PARTICIPANT_URL 9 | value: http://${project.artifactId}:8080/api 10 | - name: SPRING_ARTEMIS_BROKER_URL 11 | value: tcp://amq-broker:61616 12 | -------------------------------------------------------------------------------- /saga/saga-payment-service/src/main/java/org/apache/camel/example/saga/CamelSagaPaymentService.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.example.saga; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | //CHECKSTYLE:OFF 7 | @SpringBootApplication 8 | public class CamelSagaPaymentService { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(CamelSagaPaymentService.class, args); 12 | } 13 | } 14 | // CHECKSTYLE:ON 15 | -------------------------------------------------------------------------------- /saga/saga-payment-service/src/main/jkube/deployment.yml: -------------------------------------------------------------------------------- 1 | spec: 2 | template: 3 | spec: 4 | containers: 5 | - env: 6 | - name: CAMEL_LRA_COORDINATOR_URL 7 | value: http://lra-coordinator:8080 8 | - name: CAMEL_LRA_LOCAL_PARTICIPANT_URL 9 | value: http://${project.artifactId}:8080/api 10 | - name: SPRING_ARTEMIS_BROKER_URL 11 | value: tcp://amq-broker:61616 12 | -------------------------------------------------------------------------------- /saga/saga-train-service/src/main/java/org/apache/camel/example/saga/CamelSagaTrainService.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.example.saga; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | //CHECKSTYLE:OFF 7 | @SpringBootApplication 8 | public class CamelSagaTrainService { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(CamelSagaTrainService.class, args); 12 | } 13 | } 14 | // CHECKSTYLE:ON 15 | -------------------------------------------------------------------------------- /saga/saga-train-service/src/main/jkube/deployment.yml: -------------------------------------------------------------------------------- 1 | spec: 2 | template: 3 | spec: 4 | containers: 5 | - env: 6 | - name: CAMEL_LRA_COORDINATOR_URL 7 | value: http://lra-coordinator:8080 8 | - name: CAMEL_LRA_LOCAL_PARTICIPANT_URL 9 | value: http://${project.artifactId}:8080/api 10 | - name: SPRING_ARTEMIS_BROKER_URL 11 | value: tcp://amq-broker:61616 12 | -------------------------------------------------------------------------------- /saga/stop-local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo stopping saga application 4 | kill -9 $(cat app.pid) && rm app.pid 5 | 6 | echo stopping flight service 7 | kill -9 $(cat flight.pid) && rm flight.pid 8 | 9 | echo stopping train service 10 | kill -9 $(cat train.pid) && rm train.pid 11 | 12 | echo stopping payment service 13 | kill -9 $(cat payment.pid) && rm payment.pid 14 | 15 | echo stopping amq broker and lra-coordinator 16 | docker compose -f local-resources/compose.yaml stop 17 | -------------------------------------------------------------------------------- /salesforce/.gitignore: -------------------------------------------------------------------------------- 1 | src/main/resources/application.properties -------------------------------------------------------------------------------- /salesforce/src/main/java/org/apache/camel/example/salesforce/SalesforceApp.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 | package org.apache.camel.example.salesforce; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class SalesforceApp { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(SalesforceApp.class, args); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /salesforce/src/main/resources/application.properties.example: -------------------------------------------------------------------------------- 1 | spring.application.name=Salesforce Example 2 | camel.component.salesforce.config.raw-payload=true 3 | camel.component.salesforce.authentication-type=CLIENT_CREDENTIALS 4 | camel.component.salesforce.client-id= 5 | camel.component.salesforce.client-secret= 6 | camel.component.salesforce.instance-url= 7 | camel.component.salesforce.login-url= 8 | 9 | -------------------------------------------------------------------------------- /soap-cxf/src/main/java/sample/camel/Application.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 | package sample.camel; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class Application { 24 | 25 | /** 26 | * A main method to start this application. 27 | */ 28 | public static void main(String[] args) { 29 | SpringApplication.run(Application.class, args); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /soap-cxf/src/main/java/sample/camel/service/ContactRequest.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 | package sample.camel.service; 18 | 19 | public class ContactRequest { 20 | private Contact contact; 21 | 22 | public Contact getContact() { 23 | return contact; 24 | } 25 | 26 | public void setContact(Contact contact) { 27 | this.contact = contact; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /soap-cxf/src/main/java/sample/camel/service/ContactService.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 | package sample.camel.service; 18 | 19 | public interface ContactService { 20 | 21 | void addContact(Contact contact); 22 | 23 | Contact getContact(String name) throws NoSuchContactException; 24 | 25 | GetContactsResponse getContacts(); 26 | 27 | void updateContact(String name, Contact contact) 28 | throws NoSuchContactException; 29 | 30 | void removeContact(String name) throws NoSuchContactException; 31 | } 32 | -------------------------------------------------------------------------------- /soap-cxf/src/main/java/sample/camel/service/ContactType.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 | package sample.camel.service; 18 | 19 | public enum ContactType { 20 | PERSONAL, WORK, OTHER, 21 | } 22 | -------------------------------------------------------------------------------- /soap-cxf/src/main/java/sample/camel/service/GetContactsResponse.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 | package sample.camel.service; 18 | 19 | import java.util.Collection; 20 | 21 | public class GetContactsResponse { 22 | private Collection contacts; 23 | 24 | public Collection getContacts() { 25 | return contacts; 26 | } 27 | 28 | public void setContacts(Collection contacts) { 29 | this.contacts = contacts; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /soap-cxf/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /soap-cxf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # the name of Camel 19 | camel.main.name = MyCamel 20 | camel.springboot.main-run-controller=true 21 | 22 | # logging.level.root=TRACE 23 | 24 | management.endpoint.metrics.enabled=true 25 | management.endpoints.web.exposure.include=* 26 | 27 | server.tomcat.accept-count=1 28 | -------------------------------------------------------------------------------- /splitter-eip/README.adoc: -------------------------------------------------------------------------------- 1 | == Spring Boot and ServiceCall EIP Example 2 | 3 | This example show how to use Camel with Splitter EIP with Spring Boot. 4 | 5 | Examples 6 | 7 | - Example 1 : Simple splitter 8 | - Example 2 : Splitter with subsequent aggregation 9 | - Example 3 : Splitter with subsequent aggregation using POJO bean instead of AggregationStrategy implementation 10 | - Example 4 : Splitter with subsequent aggregation failing on exception 11 | - Example 5 : Splitter with subsequent aggregation on failing on aggregation exception 12 | 13 | === How to run 14 | 15 | mvn clean test 16 | 17 | === Help and contributions 18 | 19 | If you hit any problem using Camel or have some feedback, then please 20 | https://camel.apache.org/community/support/[let us know]. 21 | 22 | We also love contributors, so 23 | https://camel.apache.org/community/contributing/[get involved] :-) 24 | 25 | The Camel riders! 26 | -------------------------------------------------------------------------------- /splitter-eip/src/main/java/org/apache/camel/example/spring/boot/AggregationStrategyPojo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Licensed to the Apache Software Foundation (ASF) under one or more 4 | * * contributor license agreements. See the NOTICE file distributed with 5 | * * this work for additional information regarding copyright ownership. 6 | * * The ASF licenses this file to You under the Apache License, Version 2.0 7 | * * (the "License"); you may not use this file except in compliance with 8 | * * the License. You may obtain a copy of the License at 9 | * * 10 | * * http://www.apache.org/licenses/LICENSE-2.0 11 | * * 12 | * * Unless required by applicable law or agreed to in writing, software 13 | * * distributed under the License is distributed on an "AS IS" BASIS, 14 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * * See the License for the specific language governing permissions and 16 | * * limitations under the License. 17 | * 18 | */ 19 | package org.apache.camel.example.spring.boot; 20 | 21 | public class AggregationStrategyPojo { 22 | 23 | public String aggregate(String oldBody, String newBody) { 24 | if (newBody != null) { 25 | return oldBody + "+" + newBody; 26 | } else { 27 | return oldBody; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /splitter-eip/src/main/java/org/apache/camel/example/spring/boot/Application.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Licensed to the Apache Software Foundation (ASF) under one or more 4 | * * contributor license agreements. See the NOTICE file distributed with 5 | * * this work for additional information regarding copyright ownership. 6 | * * The ASF licenses this file to You under the Apache License, Version 2.0 7 | * * (the "License"); you may not use this file except in compliance with 8 | * * the License. You may obtain a copy of the License at 9 | * * 10 | * * http://www.apache.org/licenses/LICENSE-2.0 11 | * * 12 | * * Unless required by applicable law or agreed to in writing, software 13 | * * distributed under the License is distributed on an "AS IS" BASIS, 14 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * * See the License for the specific language governing permissions and 16 | * * limitations under the License. 17 | * 18 | */ 19 | package org.apache.camel.example.spring.boot; 20 | 21 | 22 | import org.springframework.boot.SpringApplication; 23 | import org.springframework.boot.autoconfigure.SpringBootApplication; 24 | 25 | 26 | @SpringBootApplication 27 | public class Application { 28 | 29 | public static void main(String[] args) { 30 | SpringApplication.run(Application.class, args); 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /spring-jdbc/readme.adoc: -------------------------------------------------------------------------------- 1 | == Camel Example Spring JDBC 2 | 3 | This example shows how `transacted()` routes create a jdbc local transaction integrating Camel and Spring Transaction 4 | 5 | === How to run 6 | Run the database container 7 | 8 | podman run --rm --name db -e POSTGRES_PASSWORD=password -p 5432:5432 mirror.gcr.io/library/postgres:latest 9 | 10 | You can run this example using 11 | 12 | mvn spring-boot:run 13 | 14 | To execute the routes: 15 | 16 | 1. verify the table is empty (no data on response) 17 | 18 | curl http://localhost:8080/api/horses 19 | 20 | 2. insert data 21 | 22 | curl -X POST http://localhost:8080/api/horses -H "name: Varenne" -H "age: 8" 23 | 24 | 3. verify the data has been persisted 25 | 26 | curl http://localhost:8080/api/horses 27 | 28 | 4. force to rollback after the insert (setting header "fail: true") 29 | 30 | curl -X POST http://localhost:8080/api/horses -H "name: Seabiscuit" -H "age: 9" -H "fail: true" 31 | 32 | 5. verify the same content of the step 3 33 | 34 | curl http://localhost:8080/api/horses 35 | 36 | === Help and contributions 37 | 38 | If you hit any problem using Camel or have some feedback, then please 39 | https://camel.apache.org/support.html[let us know]. 40 | 41 | We also love contributors, so 42 | https://camel.apache.org/contributing.html[get involved] :-) 43 | 44 | The Camel riders! 45 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/java/org/apache/camel/example/spring/jdbc/CamelSpringJdbcApplication.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 | package org.apache.camel.example.spring.jdbc; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | //CHECKSTYLE:OFF 23 | @SpringBootApplication 24 | public class CamelSpringJdbcApplication { 25 | 26 | public static void main(String[] args) { 27 | SpringApplication.run(CamelSpringJdbcApplication.class, args); 28 | } 29 | } 30 | // CHECKSTYLE:ON 31 | 32 | -------------------------------------------------------------------------------- /spring-jdbc/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS horses; 2 | CREATE TABLE horses ( 3 | name VARCHAR(255), 4 | age INT, 5 | ts TIMESTAMP NOT NULL DEFAULT now() 6 | ); 7 | -------------------------------------------------------------------------------- /strimzi/.gitignore: -------------------------------------------------------------------------------- 1 | truststore.jks -------------------------------------------------------------------------------- /strimzi/prepare-truststore.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | rm truststore.jks 4 | 5 | kubectl get secret/my-cluster-cluster-ca-cert -o 'go-template={{index .data "ca.crt"}}' -n camel-example-strimzi | base64 -D > ca.crt 6 | 7 | echo "yes" | keytool -import -trustcacerts -file ca.crt -keystore truststore.jks -storepass 123456 8 | 9 | kubectl delete configmap truststore-config && kubectl create configmap truststore-config --from-file=truststore.jks=truststore.jks -n camel-example-strimzi 10 | 11 | rm ca.crt -------------------------------------------------------------------------------- /strimzi/route-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/strimzi/route-diagram.png -------------------------------------------------------------------------------- /strimzi/src/main/fabric8/deployment.yml: -------------------------------------------------------------------------------- 1 | spec: 2 | template: 3 | spec: 4 | volumes: 5 | - name: truststore-config 6 | configMap: 7 | name: truststore-config 8 | items: 9 | - key: truststore.jks 10 | path: truststore.jks 11 | containers: 12 | - volumeMounts: 13 | - name: truststore-config 14 | mountPath: /deployments/config 15 | resources: 16 | requests: 17 | cpu: "0.2" 18 | ### memory: 256Mi 19 | limits: 20 | cpu: "1.0" 21 | ### memory: 256Mi 22 | env: 23 | - name: SPRING_APPLICATION_JSON 24 | value: '{"server":{"tomcat":{"max-threads":1}}}' 25 | -------------------------------------------------------------------------------- /strimzi/src/main/resources/kafka-ephemeral-kubernetes.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kafka.strimzi.io/v1beta1 2 | kind: Kafka 3 | metadata: 4 | name: my-cluster 5 | spec: 6 | kafka: 7 | version: 2.4.0 8 | replicas: 3 9 | listeners: 10 | plain: {} 11 | tls: {} 12 | config: 13 | offsets.topic.replication.factor: 3 14 | transaction.state.log.replication.factor: 3 15 | transaction.state.log.min.isr: 2 16 | log.message.format.version: "2.4" 17 | storage: 18 | type: ephemeral 19 | zookeeper: 20 | replicas: 3 21 | storage: 22 | type: ephemeral 23 | entityOperator: 24 | topicOperator: {} 25 | userOperator: {} 26 | -------------------------------------------------------------------------------- /strimzi/src/main/resources/kafka-ephemeral-openshift.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kafka.strimzi.io/v1beta1 2 | kind: Kafka 3 | metadata: 4 | name: my-cluster 5 | spec: 6 | kafka: 7 | version: 2.4.0 8 | replicas: 3 9 | listeners: 10 | plain: {} 11 | tls: {} 12 | external: 13 | type: route 14 | config: 15 | offsets.topic.replication.factor: 3 16 | transaction.state.log.replication.factor: 3 17 | transaction.state.log.min.isr: 2 18 | log.message.format.version: "2.4" 19 | storage: 20 | type: ephemeral 21 | zookeeper: 22 | replicas: 3 23 | storage: 24 | type: ephemeral 25 | entityOperator: 26 | topicOperator: {} 27 | userOperator: {} 28 | -------------------------------------------------------------------------------- /supervising-route-controller/readme.adoc: -------------------------------------------------------------------------------- 1 | == Camel Supervising Route Controller Example Spring Boot 2 | 3 | This example shows how to work with a simple Apache Camel application using Spring Boot and a Supervising Route Controller. 4 | 5 | === How to run 6 | 7 | You can run this example using 8 | 9 | mvn spring-boot:run 10 | 11 | === To get health check 12 | 13 | To show a summary of spring boot health check 14 | 15 | ---- 16 | curl -XGET -s http://localhost:8080/actuator/health 17 | ---- 18 | 19 | And you can see some info details as well 20 | 21 | ---- 22 | curl -XGET -s http://localhost:8080/actuator/info 23 | ---- 24 | 25 | See the `application.properties` to control what information to present in actuator. 26 | 27 | === Help and contributions 28 | 29 | If you hit any problem using Camel or have some feedback, then please 30 | https://camel.apache.org/support.html[let us know]. 31 | 32 | We also love contributors, so 33 | https://camel.apache.org/contributing.html[get involved] :-) 34 | 35 | The Camel riders! 36 | -------------------------------------------------------------------------------- /tomcat-jdbc/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS messages; 2 | CREATE TABLE messages ( 3 | message VARCHAR(255), 4 | ts TIMESTAMP NOT NULL DEFAULT now() 5 | ); -------------------------------------------------------------------------------- /twitter-salesforce/src/main/java/org/apache/camel/salesforce/draftdto/Contact.java: -------------------------------------------------------------------------------- 1 | package org.apache.camel.salesforce.draftdto; 2 | 3 | public abstract class Contact { 4 | public abstract void setLastName(String LastName); 5 | public abstract void setTwitterScreenName__c(String TwitterScreenName__c); 6 | } 7 | -------------------------------------------------------------------------------- /twitter-salesforce/src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Apache Camel distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | Please read the different LICENSE files present in the licenses directory of 11 | this distribution. 12 | -------------------------------------------------------------------------------- /type-converter/README.adoc: -------------------------------------------------------------------------------- 1 | == Camel Example Spring Boot 2 | 3 | This example shows two options creating a custom Type Converter with Apache Camel application using Spring Boot. 4 | 5 | Option 1 (Camel 2.x) - Converter added to the registry and loaded at the runtime : CustomConverterRuntimeTest and CustomRuntimeConverter. 6 | 7 | Option 2 (Camel 3.x) - Converter source code generated during mvn package phase: CustomConverterGeneratedTest and CustomGeneratedConverter. 8 | Required Camel Maven Package Plugin and build helper plugin - see pom.xml for details. 9 | 10 | === How to run 11 | 12 | You can run this example using 13 | 14 | mvn test 15 | 16 | 17 | === Help and contributions 18 | 19 | If you hit any problem using Camel or have some feedback, then please 20 | https://camel.apache.org/community/support/[let us know]. 21 | 22 | We also love contributors, so 23 | https://camel.apache.org/community/contributing/[get involved] :-) 24 | 25 | The Camel riders! 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /type-converter/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader: -------------------------------------------------------------------------------- 1 | # Generated by camel build tools - do NOT edit this file! 2 | sample.camel.CustomGeneratedConverterLoader 3 | -------------------------------------------------------------------------------- /type-converter/src/main/java/sample/camel/Application.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 | package sample.camel; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class Application { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(Application.class, args); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /type-converter/src/main/java/sample/camel/DataTypeConverterRouter.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 | package sample.camel; 18 | 19 | import org.apache.camel.builder.RouteBuilder; 20 | 21 | import org.springframework.stereotype.Component; 22 | 23 | @Component 24 | public class DataTypeConverterRouter extends RouteBuilder { 25 | 26 | @Override 27 | public void configure() throws Exception { 28 | from("direct:convert1") 29 | .convertBodyTo(Person.class); 30 | } 31 | } -------------------------------------------------------------------------------- /type-converter/src/main/resources/META-INF/services/org/apache/camel/TypeConverter: -------------------------------------------------------------------------------- 1 | sample.camel.CustomRuntimeConverter -------------------------------------------------------------------------------- /type-converter/src/main/resources/META-INF/services/org/apache/camel/TypeConverterLoader: -------------------------------------------------------------------------------- 1 | sample.camel.CustomGeneratedConverter -------------------------------------------------------------------------------- /type-converter/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # the name of Camel 2 | camel.main.name = CamelCustomConverterExample 3 | 4 | # required for generated Type Converter Loader - Camel 3.x way 5 | camel.springboot.load-type-converters=true 6 | 7 | # to configure logging levels 8 | logging.level.org.springframework = INFO 9 | logging.level.org.apache.camel.spring.boot = INFO 10 | logging.level.org.apache.camel.impl = INFO 11 | logging.level.org.apache.camel = INFO 12 | logging.level.sample.camel = INFO 13 | #logging.level.sample.camel = DEBUG 14 | -------------------------------------------------------------------------------- /validator/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # the name of Camel 19 | camel.main.name = SampleCamel 20 | 21 | # properties used in the Camel route and beans 22 | # -------------------------------------------- 23 | 24 | # what to say 25 | greeting = Hello World 26 | 27 | # how often to trigger the timer 28 | timer.period = 2000 29 | -------------------------------------------------------------------------------- /variables/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # the name of Camel 19 | camel.main.name = MyCamel 20 | 21 | # variables can be pre-configured on startup 22 | camel.variable.greeting = Random number 23 | camel.variable.random = 999 -------------------------------------------------------------------------------- /vault/img/secret-database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/camel-spring-boot-examples/9b984cd8c04e59d94f21b9c8ea0c8f5336b54c7e/vault/img/secret-database.png -------------------------------------------------------------------------------- /vault/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | camel.main.name = camel-spring-boot-vault-example 19 | 20 | # Camel Vault properties configuration 21 | camel.vault.hashicorp.token = myroot 22 | camel.vault.hashicorp.host = localhost 23 | camel.vault.hashicorp.port = 8200 24 | camel.vault.hashicorp.scheme = http 25 | 26 | # YAML DSL configuration 27 | camel.main.routes-include-pattern=camel/*.yaml 28 | -------------------------------------------------------------------------------- /vault/src/main/resources/camel/cars-api.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | - rest: 19 | path: api 20 | get: 21 | - path: cars 22 | to: direct:get 23 | produces: text/plain 24 | post: 25 | - path: cars 26 | to: direct:create 27 | consumes: application/json 28 | produces: text/plain 29 | -------------------------------------------------------------------------------- /vault/src/main/resources/camel/cars-datasource.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with 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, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | - beans: 19 | - name: datasource 20 | type: org.springframework.jdbc.datasource.DriverManagerDataSource 21 | properties: 22 | driverClassName: 'org.postgresql.Driver' 23 | url: '{{hashicorp:secret:database/myJdbcURL}}' 24 | username: '{{hashicorp:secret:database/myUsername}}' 25 | password: '{{hashicorp:secret:database/myPassword}}' 26 | -------------------------------------------------------------------------------- /webhook/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | # Put here the authorization token for the telegram bot 19 | camel.component.telegram.authorization-token= 20 | 21 | # Put here the external URL as returned by the tunnel provider (e.g. loca.lt or Ngrok) 22 | camel.component.webhook.webhook-external-url=https://xx-replace-me.loca.lt 23 | -------------------------------------------------------------------------------- /widget-gadget/src/main/data/order1.json: -------------------------------------------------------------------------------- 1 | { "__comment__": "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", 2 | "order" : { 3 | "customerId": "123", 4 | "product": "widget", 5 | "amount": "2" 6 | } 7 | } -------------------------------------------------------------------------------- /widget-gadget/src/main/data/order2.json: -------------------------------------------------------------------------------- 1 | { "__comment__": "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", 2 | "order" : { 3 | "customerId": "456", 4 | "product": "gadget", 5 | "amount": "3" 6 | } 7 | } -------------------------------------------------------------------------------- /widget-gadget/src/main/java/sample/camel/WidgetGadgetApp.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 | package sample.camel; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | @SpringBootApplication 23 | public class WidgetGadgetApp { 24 | public static void main(String[] args) { 25 | SpringApplication.run(WidgetGadgetApp.class, args); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /widget-gadget/src/main/resources/application.properties: -------------------------------------------------------------------------------- 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 | spring.artemis.mode=native 19 | AMQP_REMOTE_URI=amqp://localhost:5672 20 | AMQP_SERVICE_USERNAME=admin 21 | AMQP_SERVICE_PASSWORD=admin -------------------------------------------------------------------------------- /xml-import/readme.adoc: -------------------------------------------------------------------------------- 1 | == Camel Example Spring Boot XML Import 2 | 3 | This example shows how to use Camel XML routes using the 4 | legacy Spring XML files (`` with embedded ``). 5 | 6 | This can be useful when migrating from classic Spring XML files to using Spring Boot, 7 | and want to keep using Spring XML `` for dependency injection. 8 | 9 | === Camel routes 10 | 11 | The Camel route is located in the `src/main/resources/my-camel.xml` file. 12 | 13 | Notice how you must use the `@ImportResource("classpath:my-camel.xml")` annotation 14 | in the Spring Boot main class to let Spring Boot load the legacy Spring XML file. 15 | 16 | === How to run 17 | 18 | You can run this example using 19 | 20 | mvn spring-boot:run 21 | 22 | === To get info about the routes 23 | 24 | To show a summary of all the routes 25 | 26 | ---- 27 | curl -XGET -s http://localhost:8080/actuator/camelroutes 28 | ---- 29 | 30 | To show detailed information for a specific route 31 | 32 | ---- 33 | curl -XGET -s http://localhost:8080/actuator/camelroutes/{id}/info 34 | ---- 35 | 36 | === Help and contributions 37 | 38 | If you hit any problem using Camel or have some feedback, then please 39 | https://camel.apache.org/support.html[let us know]. 40 | 41 | We also love contributors, so 42 | https://camel.apache.org/contributing.html[get involved] :-) 43 | 44 | The Camel riders! 45 | -------------------------------------------------------------------------------- /xml-import/src/main/java/sample/camel/SampleBean.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 | package sample.camel; 18 | 19 | /** 20 | * A bean that returns a message when you call the {@link #saySomething()} method. 21 | */ 22 | public class SampleBean { 23 | 24 | private String say; 25 | 26 | public String getSay() { 27 | return say; 28 | } 29 | 30 | public void setSay(String say) { 31 | this.say = say; 32 | } 33 | 34 | public String saySomething() { 35 | return say; 36 | } 37 | 38 | } 39 | --------------------------------------------------------------------------------