├── karaf ├── jdbc_jta │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── datasources │ │ │ │ ├── create.sql │ │ │ │ └── h2-ds.xml │ │ │ └── OSGI-INF │ │ │ │ └── blueprint │ │ │ │ └── blueprint.xml │ │ │ └── java │ │ │ └── org │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── jdbc │ │ │ └── route │ │ │ └── ExceptionThrower.java │ └── README.md ├── jpa_jta │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── org │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── jpa │ │ │ │ ├── Dummy.java │ │ │ │ ├── processor │ │ │ │ └── ExceptionProcessor.java │ │ │ │ ├── model │ │ │ │ └── Person.java │ │ │ │ └── route │ │ │ │ └── JpaRoutes.java │ │ │ └── resources │ │ │ ├── META-INF │ │ │ └── persistence.xml │ │ │ ├── datasources │ │ │ └── h2-ds.xml │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── blueprint.xml │ └── README.md ├── rest_secure │ └── src │ │ ├── test │ │ ├── java │ │ │ └── .gitkeep │ │ └── resources │ │ │ └── .gitkeep │ │ └── main │ │ ├── resources │ │ └── .gitkeep │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── karaf │ │ └── rest │ │ └── secure │ │ ├── processor │ │ ├── MyResourceImpl.java │ │ └── RequestProcessor.java │ │ ├── resource │ │ └── MyResource.java │ │ └── route │ │ ├── RequestRoute.java │ │ └── EndpointRoute.java ├── osgi_ds │ ├── osgi_ds_api │ │ ├── .gitignore │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── osgi_ds │ │ │ │ └── api │ │ │ │ └── IHelloService.java │ │ └── pom.xml │ ├── osgi_ds_feature │ │ ├── .gitignore │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── features.xml │ │ └── pom.xml │ └── pom.xml ├── websocket │ ├── websocket_route │ │ ├── .gitignore │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── webapp │ │ │ │ └── WEB-INF │ │ │ │ │ └── web.xml │ │ │ └── OSGI-INF │ │ │ │ └── blueprint │ │ │ │ └── camel-context.xml │ │ │ └── java │ │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── websocket │ │ │ └── route │ │ │ └── WebsocketRoute.java │ ├── websocket_feature │ │ ├── .gitignore │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── features.xml │ │ └── pom.xml │ └── pom.xml ├── rest_dsl_simple │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── default.properties │ │ │ └── OSGI-INF │ │ │ │ └── blueprint │ │ │ │ └── camel-context.xml │ │ │ └── java │ │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── rest │ │ │ └── dsl │ │ │ └── simple │ │ │ └── route │ │ │ └── SampleRoute.java │ └── .gitignore ├── rest_dsl_basic_auth │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── testRealm.properties │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── rest │ │ │ └── auth │ │ │ └── basic │ │ │ └── dsl │ │ │ └── model │ │ │ └── Note.java │ └── .gitignore ├── soap │ ├── .gitignore │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── soap │ │ │ ├── service │ │ │ └── ws │ │ │ │ └── CustomerOrderService.java │ │ │ └── model │ │ │ ├── CustomerOrderResponse.java │ │ │ └── CustomerOrder.java │ │ └── resources │ │ └── OSGI-INF │ │ └── blueprint │ │ └── camel-context.xml ├── rest_dsl │ ├── .gitignore │ └── src │ │ └── main │ │ ├── resources │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── camel-context.xml │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── karaf │ │ └── rest │ │ └── dsl │ │ └── model │ │ └── Note.java ├── soap_client │ ├── .gitignore │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── soap_client │ │ │ └── route │ │ │ └── route │ │ │ ├── CurrencyConversionRequestFactory.java │ │ │ └── CxfClientRoute.java │ │ └── resources │ │ └── OSGI-INF │ │ └── blueprint │ │ └── camel-context.xml ├── soap_secure │ ├── .gitignore │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── soap │ │ │ └── secure │ │ │ ├── service │ │ │ └── ws │ │ │ │ └── CustomerOrderService.java │ │ │ └── model │ │ │ ├── CustomerOrderResponse.java │ │ │ └── CustomerOrder.java │ │ └── resources │ │ └── OSGI-INF │ │ └── blueprint │ │ └── camel-context.xml ├── soap_contract_first │ ├── .gitignore │ └── src │ │ └── main │ │ └── resources │ │ └── OSGI-INF │ │ └── blueprint │ │ └── camel-context.xml ├── itests │ └── src │ │ └── test │ │ └── resources │ │ ├── com.redhat.consulting.fusequickstarts.karaf.properties.cfg │ │ └── com.redhat.consulting.fusequickstarts.karaf.properties.enc.cfg ├── properties │ ├── src │ │ └── test │ │ │ └── resources │ │ │ └── com.redhat.consulting.fusequickstarts.karaf.properties.cfg │ └── .gitignore ├── managed_service_factory │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── etc │ │ │ │ └── com.rht.clt.fq.k.msf.routefactory-1.cfg │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── msf │ │ │ │ └── DictionaryConstants.java │ │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── blueprint.xml │ └── .gitignore ├── properties_encryption │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── com.redhat.consulting.fusequickstarts.karaf.properties.enc.cfg │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── properties │ │ │ └── encryption │ │ │ └── route │ │ │ └── EncryptedPropertiesRoute.java │ └── .gitignore ├── osgi_service │ ├── osgi_service │ │ ├── src │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── redhat │ │ │ │ │ └── consulting │ │ │ │ │ └── fusequickstarts │ │ │ │ │ └── karaf │ │ │ │ │ └── osgi_service │ │ │ │ │ └── service │ │ │ │ │ ├── IHelloService.java │ │ │ │ │ └── HelloServiceImpl.java │ │ │ │ └── resources │ │ │ │ └── OSGI-INF │ │ │ │ └── blueprint │ │ │ │ └── blueprint.xml │ │ └── README.md │ ├── osgi_service_feature │ │ ├── .gitignore │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── features.xml │ │ └── pom.xml │ ├── osgi_consumer │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── osgi_service │ │ │ │ └── route │ │ │ │ └── ConsumerRoute.java │ │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── camel-context.xml │ └── pom.xml ├── osgi_service_adv │ ├── service_api │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── osgi_service │ │ │ └── service │ │ │ └── api │ │ │ └── IHelloService.java │ ├── blueprint_consumer │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── osgi_service │ │ │ │ └── route │ │ │ │ └── ConsumerRoute.java │ │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── camel-context.xml │ ├── spring_bp_consumer │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── osgi_service │ │ │ │ └── route │ │ │ │ └── ConsumerRoute.java │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── spring │ │ │ └── spring-context.xml │ ├── spring_consumer │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── osgi_service │ │ │ │ └── route │ │ │ │ └── ConsumerRoute.java │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── spring │ │ │ └── spring-context.xml │ ├── blueprint_sdm_consumer │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── osgi_service │ │ │ │ └── route │ │ │ │ └── ConsumerRoute.java │ │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── camel-context.xml │ ├── spring_service │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── osgi_service │ │ │ │ └── service │ │ │ │ └── impl │ │ │ │ └── HelloServiceImpl.java │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── spring │ │ │ └── spring-context.xml │ ├── blueprint_service │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── osgi_service │ │ │ │ └── service │ │ │ │ └── impl │ │ │ │ └── HelloServiceImpl.java │ │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── blueprint.xml │ └── pom.xml ├── rest │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── karaf │ │ └── rest │ │ ├── processor │ │ ├── MyResourceImpl.java │ │ └── RequestProcessor.java │ │ ├── resource │ │ └── MyResource.java │ │ └── route │ │ ├── RequestRoute.java │ │ └── EndpointRoute.java ├── feature │ ├── .gitignore │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── features.xml │ └── pom.xml ├── route_deployment │ ├── .gitignore │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── deployment │ │ │ └── route │ │ │ ├── SampleRoute.java │ │ │ └── scan │ │ │ └── AnotherSampleRoute.java │ │ └── resources │ │ └── OSGI-INF │ │ └── blueprint │ │ └── camel-context.xml ├── .gitignore ├── shared_component │ ├── shared_amq_feature │ │ ├── .gitignore │ │ ├── src │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── features.xml │ │ └── pom.xml │ ├── amq_route │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── shared_component │ │ │ │ └── amq │ │ │ │ └── route │ │ │ │ ├── ConsumerRoute.java │ │ │ │ └── ProducerRoute.java │ │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── camel-context.xml │ ├── pom.xml │ └── shared_amq │ │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── camel-context.xml │ │ └── README.md ├── rest_beanvalidation │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── karaf │ │ └── rest │ │ └── beanvalidation │ │ ├── processor │ │ ├── MyServiceImpl.java │ │ ├── RequestProcessor.java │ │ └── InvalidFiftyPercentOfTimesRequestProcessor.java │ │ ├── resource │ │ ├── MyResourceImpl.java │ │ └── MyResource.java │ │ ├── resolver │ │ └── HibernateValidationProviderResolver.java │ │ └── route │ │ ├── RequestRoute.java │ │ └── EndpointRoute.java ├── infinispan │ ├── local-camel-consumer │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── infinispan │ │ │ │ └── LocalCamelConsumer.java │ │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── blueprint.xml │ ├── remote-camel-producer │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── OSGI-INF │ │ │ │ └── blueprint │ │ │ │ └── blueprint.xml │ │ │ └── java │ │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── infinispan │ │ │ └── RemoteCamelProducer.java │ ├── remote-client │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── infinispan │ │ │ │ ├── RemoteClientRoute.java │ │ │ │ └── RemoteClient.java │ │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── blueprint.xml │ ├── local-camel-producer │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── OSGI-INF │ │ │ │ └── blueprint │ │ │ │ └── blueprint.xml │ │ │ └── java │ │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── infinispan │ │ │ └── LocalCamelProducer.java │ ├── local-cache │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ ├── infinispan.xml │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── blueprint.xml │ ├── local-client │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── infinispan │ │ │ │ ├── LocalClientRoute.java │ │ │ │ └── LocalClient.java │ │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── blueprint.xml │ └── pom.xml ├── amq │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── redhat │ │ │ │ └── consulting │ │ │ │ └── fusequickstarts │ │ │ │ └── karaf │ │ │ │ └── amq │ │ │ │ └── route │ │ │ │ ├── ConsumerRoute.java │ │ │ │ └── ProducerRoute.java │ │ └── resources │ │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── camel-context.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── karaf │ │ └── amq │ │ └── route │ │ └── ConsumerRouteTest.java ├── jpa │ ├── datasource.xml │ └── src │ │ └── main │ │ ├── resources │ │ ├── META-INF │ │ │ └── persistence.xml │ │ └── OSGI-INF │ │ │ └── blueprint │ │ │ └── blueprint.xml │ │ └── java │ │ └── org │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── karaf │ │ └── jpa │ │ ├── route │ │ └── JpaRoutes.java │ │ └── model │ │ └── Person.java ├── jms │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── karaf │ │ └── jms │ │ └── route │ │ ├── ConsumerRoute.java │ │ └── ProducerRoute.java ├── idempotent │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── karaf │ │ │ └── amq │ │ │ └── route │ │ │ ├── ProducerRoute.java │ │ │ └── ConsumerRoute.java │ │ └── resources │ │ └── OSGI-INF │ │ └── blueprint │ │ └── camel-context.xml └── pom.xml ├── eap ├── spring_route_deployment │ ├── .gitignore │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ └── web.xml │ │ ├── java │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── eap │ │ │ └── deployment │ │ │ └── route │ │ │ ├── AnotherSampleRoute.java │ │ │ └── SampleRoute.java │ │ └── resources │ │ └── META-INF │ │ └── spring │ │ └── camel-context.xml ├── jpa │ ├── CONTRIBUTORS.md │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── web.xml │ │ │ └── beans.xml │ │ ├── resources │ │ └── META-INF │ │ │ └── persistence.xml │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstars │ │ └── eap │ │ └── jpa │ │ └── model │ │ └── User.java ├── rest_dsl │ ├── CONTRIBUTORS.md │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── beans.xml │ │ │ └── web.xml │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstars │ │ └── eap │ │ └── rest │ │ ├── User.java │ │ └── UsersBean.java ├── jms │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ └── beans.xml │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── eap │ │ └── jms │ │ └── route │ │ ├── ConsumerRoute.java │ │ └── ProducerRoute.java ├── jaxrs_proxy │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ └── beans.xml │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── eap │ │ └── jaxrs │ │ ├── service │ │ ├── RestConfig.java │ │ ├── CustomerService.java │ │ └── impl │ │ │ └── CustomerServiceImpl.java │ │ ├── model │ │ └── Customer.java │ │ ├── util │ │ ├── ResponseBuilder.java │ │ └── BeanInvocationProcessor.java │ │ └── repository │ │ └── CustomerRepository.java ├── amq_mdb │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ └── beans.xml │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── eap │ │ └── amq │ │ └── mdb │ │ ├── ConsumerRoute.java │ │ └── ProducerRoute.java ├── jms_mdb │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ └── beans.xml │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── eap │ │ └── jms │ │ └── mdb │ │ ├── ConsumerRoute.java │ │ └── ProducerRoute.java ├── route_deployment │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── jboss-web.xml │ │ │ └── beans.xml │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── eap │ │ └── deployment │ │ └── route │ │ ├── AnotherSampleRoute.java │ │ └── SampleRoute.java ├── .gitignore └── pom.xml ├── .travis.yml ├── spring-boot ├── route_deployment │ └── src │ │ └── main │ │ ├── resources │ │ ├── camel-routes │ │ │ └── route-one.xml │ │ └── config │ │ │ ├── application.yaml │ │ │ └── logback.xml │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── springboot │ │ └── routedeployment │ │ ├── RouteDeploymentApplication.java │ │ └── RouteTwo.java ├── rest_consumer_rest_xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── springboot │ │ │ └── restconsumer │ │ │ └── restxml │ │ │ ├── RestXmlApplication.java │ │ │ ├── User.java │ │ │ └── UserService.java │ │ └── resources │ │ └── config │ │ ├── logback.xml │ │ └── application.yaml ├── rest_consumer_rest_java │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── redhat │ │ │ └── consulting │ │ │ └── fusequickstarts │ │ │ └── springboot │ │ │ └── restconsumer │ │ │ └── restjavadsl │ │ │ ├── RestJavaDslApplication.java │ │ │ ├── User.java │ │ │ └── UserService.java │ │ └── resources │ │ └── config │ │ ├── logback.xml │ │ └── application.yaml ├── soap_consumer_contract_first │ └── src │ │ └── main │ │ ├── resources │ │ ├── xsd │ │ │ └── uuid.xsd │ │ └── config │ │ │ ├── logback.xml │ │ │ ├── application.yaml │ │ │ └── cxf-endpoint-beans.xml │ │ ├── xjb │ │ ├── command-example.xjb │ │ ├── uuid.xjb │ │ ├── global.xjb │ │ └── customer-order-example.xjb │ │ └── java │ │ └── com │ │ └── redhat │ │ └── consulting │ │ └── fusequickstarts │ │ └── springboot │ │ └── soapconsumer │ │ └── contractfirst │ │ ├── SoapContractFirstApplication.java │ │ └── CommandExampleRoute.java ├── .editorconfig ├── README.md └── pom.xml ├── .gitignore └── pom.xml /karaf/jdbc_jta/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /karaf/jpa_jta/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /karaf/rest_secure/src/test/java/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /karaf/rest_secure/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /karaf/rest_secure/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /eap/spring_route_deployment/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /karaf/osgi_ds/osgi_ds_api/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | -------------------------------------------------------------------------------- /karaf/websocket/websocket_route/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /karaf/rest_dsl_simple/src/main/resources/default.properties: -------------------------------------------------------------------------------- 1 | AppName=system 2 | -------------------------------------------------------------------------------- /karaf/rest_dsl_basic_auth/src/test/resources/testRealm.properties: -------------------------------------------------------------------------------- 1 | admin: admin, admin -------------------------------------------------------------------------------- /eap/jpa/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | Contributors 2 | ------------ 3 | 4 | * Leandro Beretta - -------------------------------------------------------------------------------- /karaf/soap/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /src/main/resources/tenant/*.xml 3 | /target 4 | /target 5 | *~* 6 | -------------------------------------------------------------------------------- /eap/rest_dsl/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | Contributors 2 | ------------ 3 | 4 | * Leandro Beretta - -------------------------------------------------------------------------------- /karaf/rest_dsl/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /src/main/resources/tenant/*.xml 3 | /target 4 | /target 5 | *~* 6 | -------------------------------------------------------------------------------- /karaf/rest_dsl_simple/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /src/main/resources/tenant/*.xml 3 | /target 4 | /target 5 | *~* 6 | -------------------------------------------------------------------------------- /karaf/soap_client/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /src/main/resources/tenant/*.xml 3 | /target 4 | /target 5 | *~* 6 | -------------------------------------------------------------------------------- /karaf/soap_secure/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /src/main/resources/tenant/*.xml 3 | /target 4 | /target 5 | *~* 6 | -------------------------------------------------------------------------------- /eap/jms/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | eap-jms 3 | -------------------------------------------------------------------------------- /karaf/rest_dsl_basic_auth/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /src/main/resources/tenant/*.xml 3 | /target 4 | /target 5 | *~* 6 | -------------------------------------------------------------------------------- /karaf/soap_contract_first/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /src/main/resources/tenant/*.xml 3 | /target 4 | /target 5 | *~* 6 | -------------------------------------------------------------------------------- /karaf/itests/src/test/resources/com.redhat.consulting.fusequickstarts.karaf.properties.cfg: -------------------------------------------------------------------------------- 1 | test.foo=Hello 2 | test.bar=World -------------------------------------------------------------------------------- /karaf/properties/src/test/resources/com.redhat.consulting.fusequickstarts.karaf.properties.cfg: -------------------------------------------------------------------------------- 1 | test.foo=Hello 2 | test.bar=World -------------------------------------------------------------------------------- /eap/jaxrs_proxy/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | jaxrs-proxy 3 | -------------------------------------------------------------------------------- /eap/amq_mdb/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | eap-route-deployment 3 | -------------------------------------------------------------------------------- /eap/jms_mdb/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | eap-route-deployment 3 | -------------------------------------------------------------------------------- /eap/route_deployment/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | eap-route-deployment 3 | -------------------------------------------------------------------------------- /karaf/managed_service_factory/src/test/resources/etc/com.rht.clt.fq.k.msf.routefactory-1.cfg: -------------------------------------------------------------------------------- 1 | helloName=Bryan 2 | helloGreeting=Hello 3 | routeId=helloBryan -------------------------------------------------------------------------------- /karaf/itests/src/test/resources/com.redhat.consulting.fusequickstarts.karaf.properties.enc.cfg: -------------------------------------------------------------------------------- 1 | test.message.enc=ENC(WSajBRcfsf5vH5BE02510QfrRi81wnUD) 2 | test.message=NotASecretMessage -------------------------------------------------------------------------------- /karaf/properties_encryption/src/test/resources/com.redhat.consulting.fusequickstarts.karaf.properties.enc.cfg: -------------------------------------------------------------------------------- 1 | test.message.enc=ENC(WSajBRcfsf5vH5BE02510QfrRi81wnUD) 2 | test.message=NotASecretMessage -------------------------------------------------------------------------------- /karaf/jdbc_jta/src/main/resources/datasources/create.sql: -------------------------------------------------------------------------------- 1 | DROP ALL OBJECTS; 2 | CREATE TABLE my_table ( 3 | id bigint(20) NOT NULL auto_increment, 4 | key varchar(255) NOT NULL default '', 5 | value varchar(255) NOT NULL default '', 6 | PRIMARY KEY (id) 7 | ); -------------------------------------------------------------------------------- /karaf/osgi_ds/osgi_ds_api/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_ds/api/IHelloService.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_ds.api; 2 | 3 | public interface IHelloService { 4 | public String sayMessage(); 5 | public String sayHello(String pName); 6 | } 7 | -------------------------------------------------------------------------------- /karaf/jpa_jta/src/main/java/org/redhat/consulting/fusequickstarts/karaf/jpa/Dummy.java: -------------------------------------------------------------------------------- 1 | package org.redhat.consulting.fusequickstarts.karaf.jpa; 2 | 3 | /** 4 | * Created by benja on 4/29/16. 5 | */ 6 | public class Dummy { 7 | 8 | public void crash() { 9 | throw new RuntimeException(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /karaf/osgi_service/osgi_service/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_service/service/IHelloService.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_service.service; 2 | 3 | public interface IHelloService { 4 | public String sayMessage(); 5 | public String sayHello(String pName); 6 | } 7 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/service_api/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_service/service/api/IHelloService.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_service.service.api; 2 | 3 | public interface IHelloService { 4 | public String sayMessage(); 5 | public String sayHello(String pName); 6 | } 7 | -------------------------------------------------------------------------------- /karaf/websocket/websocket_route/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /eap/jpa/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /eap/jaxrs_proxy/src/main/java/com/redhat/consulting/fusequickstarts/eap/jaxrs/service/RestConfig.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jaxrs.service; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/rest") 7 | public class RestConfig extends Application{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /eap/jms/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /eap/jpa/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /eap/amq_mdb/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /eap/jms_mdb/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /eap/rest_dsl/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /eap/jaxrs_proxy/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /eap/route_deployment/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /spring-boot/route_deployment/src/main/resources/camel-routes/route-one.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /karaf/managed_service_factory/src/main/java/com/redhat/consulting/fusequickstarts/karaf/msf/DictionaryConstants.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.msf; 2 | 3 | public class DictionaryConstants { 4 | 5 | public final static String ROUTE_ID = "routeId"; 6 | 7 | public final static String HELLO_GREETING = "helloGreeting"; 8 | public final static String HELLO_NAME = "helloName"; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /karaf/jpa_jta/README.md: -------------------------------------------------------------------------------- 1 | Build Application 2 | 3 | Start Fuse 4 | 5 | Install Dependencies 6 | ```` 7 | features:install jndi jpa hibernate camel-jpa transaction connector 8 | install -s mvn:com.h2database/h2/1.3.163 9 | install -s blueprint:mvn:com.redhat.consulting.fusequickstarts.karaf/camel-jpa-jta/7.6/xml/h2 10 | ```` 11 | 12 | Install Application 13 | ```` 14 | install -s mvn:com.redhat.consulting.fusequickstarts.karaf/camel-jpa-jta/7.6 15 | ```` 16 | -------------------------------------------------------------------------------- /eap/.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | -------------------------------------------------------------------------------- /karaf/jdbc_jta/src/main/java/org/redhat/consulting/fusequickstarts/karaf/jdbc/route/ExceptionThrower.java: -------------------------------------------------------------------------------- 1 | package org.redhat.consulting.fusequickstarts.karaf.jdbc.route; 2 | 3 | /** 4 | * Created by pantinor on 25/08/16. 5 | */ 6 | public class ExceptionThrower { 7 | 8 | public static void method() { 9 | System.out.println("_____About to throw an exception"); 10 | if(true){ 11 | throw new RuntimeException("thrown on purpose"); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /karaf/rest/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/processor/MyResourceImpl.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.processor; 2 | 3 | import javax.ws.rs.core.Response; 4 | 5 | import org.apache.camel.Exchange; 6 | 7 | public class MyResourceImpl { 8 | 9 | public void getSampleUser(Exchange exchange) throws Exception { 10 | exchange.getOut().setBody(Response.status(Response.Status.OK).entity("Sample User").build()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /karaf/feature/.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | -------------------------------------------------------------------------------- /karaf/jpa_jta/src/main/java/org/redhat/consulting/fusequickstarts/karaf/jpa/processor/ExceptionProcessor.java: -------------------------------------------------------------------------------- 1 | package org.redhat.consulting.fusequickstarts.karaf.jpa.processor; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.Processor; 5 | 6 | /** 7 | * Created by benja on 4/29/16. 8 | */ 9 | public class ExceptionProcessor implements Processor { 10 | 11 | public void process(Exchange exchange) throws Exception { 12 | throw new RuntimeException(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /karaf/properties/.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | -------------------------------------------------------------------------------- /karaf/route_deployment/.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | -------------------------------------------------------------------------------- /karaf/managed_service_factory/.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | -------------------------------------------------------------------------------- /karaf/osgi_ds/osgi_ds_feature/.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | -------------------------------------------------------------------------------- /karaf/properties_encryption/.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | -------------------------------------------------------------------------------- /karaf/rest_secure/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/secure/processor/MyResourceImpl.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.secure.processor; 2 | 3 | import javax.ws.rs.core.Response; 4 | 5 | import org.apache.camel.Exchange; 6 | 7 | public class MyResourceImpl { 8 | 9 | public void getSampleUser(Exchange exchange) throws Exception { 10 | exchange.getOut().setBody(Response.status(Response.Status.OK).entity("Sample User").build()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /karaf/.gitignore: -------------------------------------------------------------------------------- 1 | cxf_contract_first/ 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | /bin/ 32 | -------------------------------------------------------------------------------- /karaf/osgi_service/osgi_service_feature/.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | -------------------------------------------------------------------------------- /karaf/shared_component/shared_amq_feature/.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | -------------------------------------------------------------------------------- /spring-boot/route_deployment/src/main/resources/config/application.yaml: -------------------------------------------------------------------------------- 1 | logging: 2 | config: classpath:config/logback.xml 3 | 4 | camel: 5 | springboot: 6 | name: Basic Route Deployment 7 | 8 | # Since spring-boot-starter-web is not included, this config lets Camel keep the container running 9 | # Without this, the container would shutdown as soon as it finishes initializing 10 | main-run-controller: true 11 | 12 | # Default is classpath:camel/*.xml 13 | xml-routes: classpath:camel-routes/*.xml 14 | -------------------------------------------------------------------------------- /karaf/websocket/websocket_feature/.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Project Specific 26 | data 27 | /data 28 | /data/ 29 | data/ 30 | data/ 31 | /target/ 32 | -------------------------------------------------------------------------------- /karaf/rest_beanvalidation/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/beanvalidation/processor/MyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.beanvalidation.processor; 2 | 3 | import javax.ws.rs.core.Response; 4 | 5 | import org.apache.camel.Exchange; 6 | 7 | public class MyServiceImpl { 8 | 9 | public void getSampleUser(Exchange exchange) throws Exception { 10 | exchange.getOut().setBody(Response.status(Response.Status.OK).entity("Sample User").build()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /karaf/infinispan/local-camel-consumer/src/main/java/com/redhat/consulting/fusequickstarts/karaf/infinispan/LocalCamelConsumer.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.infinispan; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | public class LocalCamelConsumer extends RouteBuilder { 6 | 7 | @Override 8 | public void configure() throws Exception { 9 | 10 | from("infinispan://localhost?cacheContainer=#cacheManager") 11 | .to("log:localCamelConsumer?showAll=true"); 12 | 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ass 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Eclipse Files 15 | *.project 16 | *.settings 17 | target 18 | target/ 19 | .project 20 | .settings 21 | .settings/ 22 | .classpath 23 | *.classpath 24 | 25 | # Idea Files 26 | .idea 27 | *.iml 28 | 29 | # Project Specific 30 | data 31 | /data 32 | /data/ 33 | data/ 34 | data/ 35 | 36 | # OS Specific 37 | .DS_Store 38 | -------------------------------------------------------------------------------- /spring-boot/rest_consumer_rest_xml/src/main/java/com/redhat/consulting/fusequickstarts/springboot/restconsumer/restxml/RestXmlApplication.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.springboot.restconsumer.restxml; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RestXmlApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RestXmlApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot/route_deployment/src/main/java/com/redhat/consulting/fusequickstarts/springboot/routedeployment/RouteDeploymentApplication.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.springboot.routedeployment; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RouteDeploymentApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RouteDeploymentApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot/rest_consumer_rest_java/src/main/java/com/redhat/consulting/fusequickstarts/springboot/restconsumer/restjavadsl/RestJavaDslApplication.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.springboot.restconsumer.restjavadsl; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RestJavaDslApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RestJavaDslApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot/soap_consumer_contract_first/src/main/resources/xsd/uuid.xsd: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /karaf/rest_beanvalidation/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/beanvalidation/resource/MyResourceImpl.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.beanvalidation.resource; 2 | 3 | import javax.validation.constraints.Pattern; 4 | import javax.ws.rs.core.Response; 5 | 6 | public class MyResourceImpl implements MyResource { 7 | 8 | @Override 9 | public Response getSampleUser(@Pattern(regexp = "^1[0-9]*$") String id) { 10 | //XXX: you should never reach here 11 | throw new UnsupportedOperationException("You should never reach here!"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /karaf/rest_secure/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/secure/resource/MyResource.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.secure.resource; 2 | 3 | import javax.ws.rs.GET; 4 | import javax.ws.rs.Path; 5 | import javax.ws.rs.PathParam; 6 | import javax.ws.rs.Produces; 7 | import javax.ws.rs.core.MediaType; 8 | import javax.ws.rs.core.Response; 9 | 10 | @Path("/service") 11 | public interface MyResource { 12 | 13 | @GET 14 | @Path("/{id}") 15 | @Produces({ MediaType.TEXT_PLAIN }) 16 | public Response getSampleUser(@PathParam("id") Integer id); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /spring-boot/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editorconfig (http://editorconfig.org) 2 | 3 | # Top level project directory for Fuse on Spring Boot 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | # 4 space indentation in Java 13 | [*.java] 14 | indent_style = space 15 | indent_size = 4 16 | continuation_indent_size = 8 17 | 18 | [*.{yaml,yml}] 19 | indent_style = space 20 | indent_size = 2 21 | 22 | [*.{xml,xjb,wsdl,xsd}] 23 | indent_style = space 24 | indent_size = 4 25 | continuation_indent_size = 8 26 | -------------------------------------------------------------------------------- /karaf/rest/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/resource/MyResource.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.resource; 2 | 3 | import javax.ws.rs.GET; 4 | import javax.ws.rs.Path; 5 | import javax.ws.rs.PathParam; 6 | import javax.ws.rs.Produces; 7 | import javax.ws.rs.core.MediaType; 8 | import javax.ws.rs.core.Response; 9 | 10 | @Path("/service") 11 | public interface MyResource { 12 | 13 | @GET 14 | @Path("/{id}") 15 | @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) 16 | public Response getSampleUser(@PathParam("id") Integer id); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /spring-boot/route_deployment/src/main/resources/config/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /spring-boot/rest_consumer_rest_java/src/main/resources/config/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /spring-boot/rest_consumer_rest_xml/src/main/resources/config/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /spring-boot/soap_consumer_contract_first/src/main/resources/config/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /karaf/infinispan/remote-camel-producer/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | com.redhat.consulting.fusequickstarts.karaf.infinispan 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spring-boot/soap_consumer_contract_first/src/main/xjb/command-example.xjb: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | true 11 | 12 | 13 | -------------------------------------------------------------------------------- /karaf/infinispan/remote-client/src/main/java/com/redhat/consulting/fusequickstarts/karaf/infinispan/RemoteClientRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.infinispan; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | 6 | public class RemoteClientRoute extends RouteBuilder { 7 | 8 | @Override 9 | public void configure() throws Exception { 10 | 11 | from("timer://remoteClient?fixedRate=true&period=5000") 12 | .to("bean:remoteClient?method=process('PUT', ${property.CamelTimerCounter}, ${property.CamelTimerFiredTime})") 13 | .to("log:remoteClient?showAll=true"); 14 | 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /karaf/amq/src/main/java/com/redhat/consulting/fusequickstarts/karaf/amq/route/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.amq.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route picks up from the activemq queue and logs the body of 7 | * the message. 8 | */ 9 | 10 | public class ConsumerRoute extends RouteBuilder { 11 | 12 | @Override 13 | public void configure() throws Exception { 14 | // @formatter:off 15 | from("activemq:queue:myQueue") 16 | .routeId("amqConsumer") 17 | .setBody().simple("Received Message: ${body}") 18 | .to("log:amqConsumerLog"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/blueprint_consumer/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_service/route/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_service.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route is triggered by a Timer and called the Hello Service that is exposed from the other bundle. 7 | */ 8 | 9 | public class ConsumerRoute extends RouteBuilder { 10 | 11 | @Override 12 | public void configure() throws Exception { 13 | 14 | from("timer://serviceTimer?fixedRate=true&period=5000") 15 | .beanRef("bp-helloService", "sayMessage") 16 | .to("log:bp2bp"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/spring_bp_consumer/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_service/route/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_service.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route is triggered by a Timer and called the Hello Service that is exposed from the other bundle. 7 | */ 8 | 9 | public class ConsumerRoute extends RouteBuilder { 10 | 11 | @Override 12 | public void configure() throws Exception { 13 | 14 | from("timer://serviceTimer?fixedRate=true&period=5000") 15 | .beanRef("bp-helloService", "sayMessage") 16 | .to("log:sdm2bp"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/spring_consumer/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_service/route/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_service.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route is triggered by a Timer and called the Hello Service that is exposed from the other bundle. 7 | */ 8 | 9 | public class ConsumerRoute extends RouteBuilder { 10 | 11 | @Override 12 | public void configure() throws Exception { 13 | 14 | from("timer://serviceTimer?fixedRate=true&period=5000") 15 | .beanRef("sdm-helloService", "sayMessage") 16 | .to("log:sdm2sdm"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/blueprint_sdm_consumer/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_service/route/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_service.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route is triggered by a Timer and called the Hello Service that is exposed from the other bundle. 7 | */ 8 | 9 | public class ConsumerRoute extends RouteBuilder { 10 | 11 | @Override 12 | public void configure() throws Exception { 13 | 14 | from("timer://serviceTimer?fixedRate=true&period=5000") 15 | .beanRef("sdm-helloService", "sayMessage") 16 | .to("log:bp2sdm"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /karaf/websocket/websocket_route/src/main/java/com/redhat/consulting/fusequickstarts/karaf/websocket/route/WebsocketRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.websocket.route; 2 | 3 | import org.apache.camel.LoggingLevel; 4 | import org.apache.camel.builder.RouteBuilder; 5 | 6 | 7 | public class WebsocketRoute extends RouteBuilder { 8 | 9 | @Override 10 | public void configure() throws Exception { 11 | 12 | from("websocket://0.0.0.0:9090/websocket-chat").routeId("websocketChat") 13 | .log(LoggingLevel.INFO,">> Message received : ${body}") 14 | .to("websocket://0.0.0.0:9090/websocket-chat?sendToAll=true&staticResources=classpath:webapp"); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.redhat.consulting.fusequickstarts 7 | main 8 | 7.6 9 | pom 10 | 11 | Fuse Quick Start :: Main 12 | Main POM for the Fuse Quick Starts. 13 | 14 | karaf 15 | eap 16 | spring-boot 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-boot/soap_consumer_contract_first/src/main/java/com/redhat/consulting/fusequickstarts/springboot/soapconsumer/contractfirst/SoapContractFirstApplication.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.springboot.soapconsumer.contractfirst; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.ImportResource; 6 | 7 | @SpringBootApplication 8 | @ImportResource({"classpath:config/cxf-endpoint-beans.xml"}) 9 | public class SoapContractFirstApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SoapContractFirstApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /eap/jaxrs_proxy/src/main/java/com/redhat/consulting/fusequickstarts/eap/jaxrs/service/CustomerService.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jaxrs.service; 2 | 3 | import javax.ws.rs.Consumes; 4 | import javax.ws.rs.GET; 5 | import javax.ws.rs.Path; 6 | import javax.ws.rs.PathParam; 7 | import javax.ws.rs.Produces; 8 | import javax.ws.rs.core.MediaType; 9 | import javax.ws.rs.core.Response; 10 | 11 | @Path("/customer") 12 | public interface CustomerService { 13 | @GET 14 | @Path("/") 15 | @Produces(MediaType.APPLICATION_JSON) 16 | Response getCustomers(); 17 | 18 | @GET 19 | @Path("/{id}") 20 | @Produces(MediaType.APPLICATION_JSON) 21 | Response getCustomer(@PathParam("id") String id); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /karaf/shared_component/amq_route/src/main/java/com/redhat/consulting/fusequickstarts/karaf/shared_component/amq/route/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.shared_component.amq.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route picks up from the activemq queue and logs the body of 7 | * the message. 8 | */ 9 | 10 | public class ConsumerRoute extends RouteBuilder { 11 | 12 | @Override 13 | public void configure() throws Exception { 14 | 15 | from("sharedamq:queue:mySharedQueue") 16 | .routeId("sharedAmqConsumer") 17 | .setBody().simple("Received Message: ${body}") 18 | .to("log:amqConsumerLog"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /karaf/rest_beanvalidation/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/beanvalidation/resource/MyResource.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.beanvalidation.resource; 2 | 3 | import javax.validation.constraints.Pattern; 4 | import javax.ws.rs.GET; 5 | import javax.ws.rs.Path; 6 | import javax.ws.rs.PathParam; 7 | import javax.ws.rs.Produces; 8 | import javax.ws.rs.core.MediaType; 9 | import javax.ws.rs.core.Response; 10 | 11 | @Path("/service") 12 | public interface MyResource { 13 | 14 | @GET 15 | @Path("/{id}") 16 | @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) 17 | public Response getSampleUser(@PathParam("id") @Pattern(regexp = "^1[0-9]*$") String id); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /karaf/infinispan/local-camel-consumer/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | com.redhat.consulting.fusequickstarts.karaf.infinispan 14 | 15 | 16 | -------------------------------------------------------------------------------- /karaf/jpa/datasource.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /karaf/infinispan/local-camel-producer/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | com.redhat.consulting.fusequickstarts.karaf.infinispan 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /karaf/osgi_service/osgi_service/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_service/service/HelloServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_service.service; 2 | 3 | public class HelloServiceImpl implements IHelloService { 4 | 5 | private String message; 6 | 7 | public String sayMessage(){ 8 | return "I Have a Message: " + message; 9 | } 10 | 11 | public String sayHello(String pName) { 12 | return "Hello " + pName + ", How Are you?"; 13 | } 14 | 15 | public String getMessage() { 16 | return message; 17 | } 18 | 19 | public void setMessage(String message) { 20 | this.message = message; 21 | } 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot/soap_consumer_contract_first/src/main/xjb/uuid.xjb: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /karaf/route_deployment/src/main/java/com/redhat/consulting/fusequickstarts/karaf/deployment/route/SampleRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.deployment.route; 2 | 3 | import org.apache.camel.LoggingLevel; 4 | import org.apache.camel.builder.RouteBuilder; 5 | 6 | public class SampleRoute extends RouteBuilder { 7 | 8 | @Override 9 | public void configure() throws Exception { 10 | // @formatter:off 11 | 12 | // Logs Hello World every 2000 milliseconds 13 | from("timer://myTimer?fixedRate=true&period=2000") 14 | .log(LoggingLevel.INFO, "com.redhat.consulting.fusequickstarts.karaf.deployment.route", "Hello World") 15 | .to("log:HelloWorldLog?level=INFO"); 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /karaf/infinispan/local-cache/src/main/resources/infinispan.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /eap/rest_dsl/src/main/java/com/redhat/consulting/fusequickstars/eap/rest/User.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstars.eap.rest; 2 | 3 | /** 4 | * @author lberetta 5 | * 6 | */ 7 | 8 | public class User { 9 | 10 | private Integer id; 11 | private String username; 12 | 13 | public User() {} 14 | 15 | public User(Integer id, String username) { 16 | this.id = id; 17 | this.username = username; 18 | } 19 | 20 | public Integer getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Integer id) { 25 | this.id = id; 26 | } 27 | 28 | public String getUsername() { 29 | return username; 30 | } 31 | 32 | public void setUsername(String username) { 33 | this.username = username; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /karaf/amq/src/main/java/com/redhat/consulting/fusequickstarts/karaf/amq/route/ProducerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.amq.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route runs based on a timer. It creates a message with 7 | * a simple text body and send it to an activemq queue. 8 | */ 9 | 10 | public class ProducerRoute extends RouteBuilder { 11 | 12 | @Override 13 | public void configure() throws Exception { 14 | // @formatter:off 15 | from("timer://myTimer?fixedRate=true&period=2000") 16 | .routeId("amqProducer") 17 | .transform().simple("Sample AMQ Message") 18 | .log("Created Message: ${body}") 19 | .to("activemq:queue:myQueue"); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /eap/amq_mdb/src/main/java/com/redhat/consulting/fusequickstarts/eap/amq/mdb/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.amq.mdb; 2 | 3 | import javax.ejb.Startup; 4 | import javax.enterprise.context.ApplicationScoped; 5 | 6 | import org.apache.camel.builder.RouteBuilder; 7 | import org.apache.camel.cdi.ContextName; 8 | 9 | /* 10 | * This consumer route receives messages sent from the Producer Template in the MDB 11 | */ 12 | 13 | @Startup 14 | @ApplicationScoped 15 | @ContextName("amq-mdb") 16 | public class ConsumerRoute extends RouteBuilder { 17 | 18 | @Override 19 | public void configure() throws Exception { 20 | from("direct:consumer") 21 | .routeId("consumer") 22 | .log("Received Message: ${body.text}"); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /eap/jms_mdb/src/main/java/com/redhat/consulting/fusequickstarts/eap/jms/mdb/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jms.mdb; 2 | 3 | import javax.ejb.Startup; 4 | import javax.enterprise.context.ApplicationScoped; 5 | 6 | import org.apache.camel.builder.RouteBuilder; 7 | import org.apache.camel.cdi.ContextName; 8 | 9 | /* 10 | * This consumer route receives messages sent from the Producer Template in the MDB 11 | */ 12 | 13 | @Startup 14 | @ApplicationScoped 15 | @ContextName("jms-mdb") 16 | public class ConsumerRoute extends RouteBuilder { 17 | 18 | @Override 19 | public void configure() throws Exception { 20 | from("direct:consumer") 21 | .routeId("consumer") 22 | .log("Received Message: ${body.text}"); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /karaf/osgi_service/osgi_consumer/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_service/route/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_service.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route is triggered by a Timer and called the Hello Service that is exposed from the other bundle. 7 | */ 8 | 9 | public class ConsumerRoute extends RouteBuilder { 10 | 11 | @Override 12 | public void configure() throws Exception { 13 | 14 | from("timer://serviceTimer?fixedRate=true&period=5000") 15 | .beanRef("helloService", "sayMessage") 16 | .to("log:helloServiceLog") 17 | .beanRef("helloService", "sayHello(Jim)") 18 | .to("log:helloServiceLog"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /spring-boot/rest_consumer_rest_xml/src/main/java/com/redhat/consulting/fusequickstarts/springboot/restconsumer/restxml/User.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.springboot.restconsumer.restxml; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | public class User { 7 | 8 | private final Integer id; 9 | private final String username; 10 | 11 | @JsonCreator 12 | public User(@JsonProperty("id") Integer id, 13 | @JsonProperty("username") String username) { 14 | this.id = id; 15 | this.username = username; 16 | } 17 | 18 | public Integer getId() { 19 | return id; 20 | } 21 | 22 | public String getUsername() { 23 | return username; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /karaf/infinispan/local-client/src/main/java/com/redhat/consulting/fusequickstarts/karaf/infinispan/LocalClientRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.infinispan; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | 6 | public class LocalClientRoute extends RouteBuilder { 7 | 8 | @Override 9 | public void configure() throws Exception { 10 | 11 | from("timer://localClient?fixedRate=true&period=5000") 12 | .to("bean:localClient?method=process('PUT', ${property.CamelTimerCounter}, ${property.CamelTimerFiredTime})") 13 | .to("log:localClient?showAll=true") 14 | .to("bean:localClient?method=process('GET', ${property.CamelTimerCounter}, '')") 15 | .to("log:localClient?showAll=true"); 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /spring-boot/rest_consumer_rest_java/src/main/java/com/redhat/consulting/fusequickstarts/springboot/restconsumer/restjavadsl/User.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.springboot.restconsumer.restjavadsl; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | public class User { 7 | 8 | private final Integer id; 9 | private final String username; 10 | 11 | @JsonCreator 12 | public User(@JsonProperty("id") Integer id, 13 | @JsonProperty("username") String username) { 14 | this.id = id; 15 | this.username = username; 16 | } 17 | 18 | public Integer getId() { 19 | return id; 20 | } 21 | 22 | public String getUsername() { 23 | return username; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /eap/jaxrs_proxy/src/main/java/com/redhat/consulting/fusequickstarts/eap/jaxrs/model/Customer.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jaxrs.model; 2 | 3 | public class Customer { 4 | 5 | private String firstName; 6 | private String lastName; 7 | 8 | public Customer(String firstName, String lastName) { 9 | super(); 10 | this.firstName = firstName; 11 | this.lastName = lastName; 12 | } 13 | 14 | public String getFirstName() { 15 | return firstName; 16 | } 17 | 18 | public void setFirstName(String firstName) { 19 | this.firstName = firstName; 20 | } 21 | 22 | public String getLastName() { 23 | return lastName; 24 | } 25 | 26 | public void setLastName(String lastName) { 27 | this.lastName = lastName; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot/route_deployment/src/main/java/com/redhat/consulting/fusequickstarts/springboot/routedeployment/RouteTwo.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.springboot.routedeployment; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class RouteTwo extends RouteBuilder { 8 | @Override 9 | public void configure() { 10 | //@formatter:off 11 | from("timer:routeTwoTimer") 12 | .routeId("routeTwo") 13 | .routeGroup("javaRouteBuilderRoutes") 14 | .routeProperty("fixedRate", "true") 15 | .routeProperty("period", "1s") 16 | .log("Timer triggered in routeTwo (from RouteTwo.java)") 17 | .to("stub:routeEnd"); 18 | //@formatter:on 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /eap/spring_route_deployment/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | spring-jms 8 | 9 | 10 | contextConfigLocation 11 | classpath:META-INF/spring/*.xml 12 | 13 | 14 | 15 | org.springframework.web.context.ContextLoaderListener 16 | 17 | -------------------------------------------------------------------------------- /karaf/infinispan/remote-client/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | com.redhat.consulting.fusequickstarts.karaf.infinispan 18 | 19 | 20 | -------------------------------------------------------------------------------- /karaf/jdbc_jta/README.md: -------------------------------------------------------------------------------- 1 | Build Application 2 | 3 | - copy `src/main/resources/datasources/create.sql` in your user folder. 4 | 5 | Start Fuse 6 | 7 | Install Dependencies 8 | ```bash 9 | # IMPORTANT: "connector" feature required to have rollback to work, otherwise rollback will fail without reporting any errors! 10 | features:install jndi camel-jdbc transaction connector 11 | # note: older version of h2db had a bug that prevented rollback to work. A version that shows the bugged behavior is 1.3.163 12 | # see: https://groups.google.com/d/msg/h2-database/GJJVQbyHOJQ/lwMzO9OUSjMJ 13 | install -s mvn:com.h2database/h2/1.4.192 14 | install -s blueprint:mvn:com.redhat.consulting.fusequickstarts.karaf/jdbc-jta/7.6/xml/h2 15 | ``` 16 | 17 | Install Application 18 | ```bash 19 | install -s mvn:com.redhat.consulting.fusequickstarts.karaf/jdbc-jta/7.6 20 | ``` 21 | -------------------------------------------------------------------------------- /karaf/shared_component/amq_route/src/main/java/com/redhat/consulting/fusequickstarts/karaf/shared_component/amq/route/ProducerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.shared_component.amq.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route runs based on a timer. It creates a message with 7 | * a simple text body and send it to an activemq queue. 8 | */ 9 | 10 | public class ProducerRoute extends RouteBuilder { 11 | 12 | @Override 13 | public void configure() throws Exception { 14 | 15 | from("timer://myTimer?fixedRate=true&period=2000") 16 | .routeId("sharedAmqProducer") 17 | .transform().simple("Shared Sample AMQ Message") 18 | .log("Created Message: ${body}") 19 | .to("sharedamq:queue:mySharedQueue"); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /spring-boot/soap_consumer_contract_first/src/main/xjb/global.xjb: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /karaf/jpa/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/h2ds) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/spring_service/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_service/service/impl/HelloServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_service.service.impl; 2 | 3 | import com.redhat.consulting.fusequickstarts.karaf.osgi_service.service.api.IHelloService; 4 | 5 | public class HelloServiceImpl implements IHelloService { 6 | 7 | private String message; 8 | 9 | public String sayMessage(){ 10 | return "I Have a Message: " + message; 11 | } 12 | 13 | public String sayHello(String pName) { 14 | return "Hello " + pName + ", How Are you?"; 15 | } 16 | 17 | public String getMessage() { 18 | return message; 19 | } 20 | 21 | public void setMessage(String message) { 22 | this.message = message; 23 | } 24 | 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /karaf/route_deployment/src/main/java/com/redhat/consulting/fusequickstarts/karaf/deployment/route/scan/AnotherSampleRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.deployment.route.scan; 2 | 3 | import org.apache.camel.LoggingLevel; 4 | import org.apache.camel.builder.RouteBuilder; 5 | 6 | /** 7 | * Another Sample Route. This one will be picked up via Package Scanning. 8 | */ 9 | public class AnotherSampleRoute extends RouteBuilder { 10 | 11 | @Override 12 | public void configure() throws Exception { 13 | 14 | // Logs Goodbye World every 2000 milliseconds 15 | from("timer://myOtherTimer?fixedRate=true&period=2000") 16 | .log(LoggingLevel.INFO, "com.redhat.consulting.fusequickstarts.karaf.deployment.route.scan", "Goodbye World") 17 | .to("log:GoodbyeWorldLog?level=INFO"); 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/blueprint_service/src/main/java/com/redhat/consulting/fusequickstarts/karaf/osgi_service/service/impl/HelloServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.osgi_service.service.impl; 2 | 3 | import com.redhat.consulting.fusequickstarts.karaf.osgi_service.service.api.IHelloService; 4 | 5 | public class HelloServiceImpl implements IHelloService { 6 | 7 | private String message; 8 | 9 | public String sayMessage(){ 10 | return "I Have a Message: " + message; 11 | } 12 | 13 | public String sayHello(String pName) { 14 | return "Hello " + pName + ", How Are you?"; 15 | } 16 | 17 | public String getMessage() { 18 | return message; 19 | } 20 | 21 | public void setMessage(String message) { 22 | this.message = message; 23 | } 24 | 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /karaf/soap_client/src/main/java/com/redhat/consulting/fusequickstarts/karaf/soap_client/route/route/CurrencyConversionRequestFactory.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.soap_client.route.route; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.Header; 5 | 6 | import net.webservicex.ConversionRate; 7 | import net.webservicex.Currency; 8 | 9 | public class CurrencyConversionRequestFactory { 10 | 11 | public static void createNewRequest(@Header("fromCurrency") String fromCurrency, 12 | @Header("toCurrency") String toCurrency, Exchange exchange) { 13 | ConversionRate request = new ConversionRate(); 14 | request.setToCurrency(Currency.valueOf(toCurrency)); 15 | request.setFromCurrency(Currency.valueOf(fromCurrency)); 16 | exchange.getIn().setBody(request); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /eap/spring_route_deployment/src/main/java/com/redhat/consulting/fusequickstarts/eap/deployment/route/AnotherSampleRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.deployment.route; 2 | 3 | import org.apache.camel.LoggingLevel; 4 | import org.apache.camel.builder.RouteBuilder; 5 | import org.springframework.stereotype.Component; 6 | 7 | /* 8 | * The Annotations below are required for Spring to find and start the Camel Route. 9 | */ 10 | @Component 11 | public class AnotherSampleRoute extends RouteBuilder { 12 | 13 | @Override 14 | public void configure() throws Exception { 15 | 16 | // Logs Goodbye World every 2000 milliseconds 17 | from("timer://myEapTimer?fixedRate=true&period=2000").log(LoggingLevel.INFO, "com.redhat.consulting.fusequickstarts.eap.deployment.route", "Goodbye World").to( 18 | "log:GoodbyeWorldLog?level=INFO"); 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /eap/spring_route_deployment/src/main/java/com/redhat/consulting/fusequickstarts/eap/deployment/route/SampleRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.deployment.route; 2 | 3 | import org.apache.camel.LoggingLevel; 4 | import org.apache.camel.builder.RouteBuilder; 5 | import org.springframework.stereotype.Component; 6 | 7 | /* 8 | * The Annotations below are required for Spring to find and start the Camel Route. 9 | */ 10 | @Component 11 | public class SampleRoute extends RouteBuilder { 12 | 13 | @Override 14 | public void configure() throws Exception { 15 | 16 | // Logs Hello World every 2000 milliseconds 17 | from("timer://myEapTimer?fixedRate=true&period=2000") 18 | .log(LoggingLevel.INFO, "com.redhat.consulting.fusequickstarts.eap.deployment.route", "Hello World") 19 | .to("log:HelloWorldLog?level=INFO"); 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /karaf/jms/src/main/java/com/redhat/consulting/fusequickstarts/karaf/jms/route/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.jms.route; 2 | 3 | import org.apache.camel.LoggingLevel; 4 | import org.apache.camel.builder.RouteBuilder; 5 | 6 | /* 7 | * This route picks up from the activemq queue and logs the body of 8 | * the message. 9 | */ 10 | 11 | public class ConsumerRoute extends RouteBuilder { 12 | 13 | @Override 14 | public void configure() throws Exception { 15 | // @formatter:off 16 | from("jms:queue:jmsTestQueue?clientId=jmsConsumerRoute") 17 | .routeId("jmsConsumer") 18 | .to("direct:jmsConsumer"); 19 | 20 | from("direct:jmsConsumer") 21 | .routeId("directJmsConsumer") 22 | .setBody().simple("Received Message: ${body}") 23 | .to("log:jmsConsumerLog"); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /karaf/websocket/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf 8 | karaf-parent 9 | 7.6 10 | ../parent/pom.xml 11 | 12 | pom 13 | com.redhat.consulting.fusequickstarts.karaf.websocket 14 | websocket-parent 15 | Fuse Quick Start :: Karaf :: Blueprint :: Websocket Parent 16 | 17 | 18 | websocket_route 19 | websocket_feature 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /karaf/idempotent/src/main/java/com/redhat/consulting/fusequickstarts/karaf/amq/route/ProducerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.amq.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route runs based on a timer. It creates a message with 7 | * a simple text body and header and sends it to an activemq queue. 8 | */ 9 | 10 | public class ProducerRoute extends RouteBuilder { 11 | 12 | @Override 13 | public void configure() throws Exception { 14 | // @formatter:off 15 | from("timer://myTimer?fixedRate=true&period=15000") 16 | .routeId("amqIdempotentProducer") 17 | .transform() 18 | .simple("Sample AMQ Message") 19 | .setHeader("appId", constant("5")) 20 | .log("Created Message: ${body}") 21 | .to("activemq:queue:myIdempotentQueue"); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /spring-boot/README.md: -------------------------------------------------------------------------------- 1 | # Red Hat Fuse on Spring Boot Quick Starts # 2 | This is a collection of Quick Starts designed to be run on Red Hat Fuse on Spring Boot. 3 | All of these projects are written using the Java DSL unless otherwise noted. 4 | 5 | ## Requirements ## 6 | * Red Hat Fuse 7.6.0 7 | * Maven 3.0 or greater (http://maven.apache.org) 8 | * Java 8 9 | 10 | ## Basic Examples ## 11 | These examples are designed to demonstrate a single component or feature without much advanced 12 | or complex functionality. This is a good place for beginners to start. 13 | 14 | * [Camel on Spring Boot - Basic Route Deployment](route_deployment) 15 | * [Camel on Spring Boot - REST Consumer (using REST Java DSL)](rest_consumer_rest_java) 16 | * [Camel on Spring Boot - REST Consumer (using REST XML)](rest_consumer_rest_xml) 17 | * [Camel on Spring Boot - SOAP WebService Consumer (Contract First)](soap_consumer_contract_first) 18 | -------------------------------------------------------------------------------- /karaf/infinispan/local-cache/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /karaf/infinispan/local-client/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | com.redhat.consulting.fusequickstarts.karaf.infinispan 19 | 20 | 21 | -------------------------------------------------------------------------------- /karaf/rest_beanvalidation/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/beanvalidation/resolver/HibernateValidationProviderResolver.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.beanvalidation.resolver; 2 | 3 | import org.hibernate.validator.HibernateValidator; 4 | 5 | import javax.validation.ValidationProviderResolver; 6 | import java.util.List; 7 | 8 | import static java.util.Collections.singletonList; 9 | 10 | /** 11 | * OSGi-friendly implementation of {@code javax.validation.ValidationProviderResolver} returning 12 | * {@code org.hibernate.validator.HibernateValidator} instance. 13 | * 14 | */ 15 | public class HibernateValidationProviderResolver implements ValidationProviderResolver 16 | { 17 | @SuppressWarnings("unchecked") 18 | @Override 19 | public List getValidationProviders() 20 | { 21 | return singletonList(new HibernateValidator()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /karaf/osgi_ds/osgi_ds_feature/src/main/resources/features.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | camel-core 8 | 9 | 10 | 11 | 12 | sharedOsgiDeclarativeServiceDependencies 13 | mvn:com.redhat.consulting.fusequickstarts.karaf.osgi_ds/osgi_ds_api/${project.version} 14 | mvn:com.redhat.consulting.fusequickstarts.karaf.osgi_ds/osgi_ds_service/${project.version} 15 | mvn:com.redhat.consulting.fusequickstarts.karaf.osgi_ds/osgi_ds_consumer/${project.version} 16 | 17 | 18 | -------------------------------------------------------------------------------- /eap/jaxrs_proxy/src/main/java/com/redhat/consulting/fusequickstarts/eap/jaxrs/util/ResponseBuilder.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jaxrs.util; 2 | 3 | import java.util.Map; 4 | 5 | import javax.ws.rs.core.Response; 6 | 7 | import org.apache.camel.Body; 8 | import org.apache.camel.Exchange; 9 | import org.apache.camel.Handler; 10 | import org.apache.camel.Headers; 11 | 12 | /** 13 | * Builds JAX-RS Responses from the Camel Exchange Data 14 | */ 15 | public class ResponseBuilder { 16 | 17 | @Handler 18 | public Response buildResponse(@Body Object body, @Headers Map headers){ 19 | Integer responseCode = 200; 20 | if(headers.containsKey(Exchange.HTTP_RESPONSE_CODE)){ 21 | responseCode = Integer.valueOf(headers.get(Exchange.HTTP_RESPONSE_CODE).toString()); 22 | } 23 | 24 | return Response.ok(body).status(responseCode).build(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /karaf/websocket/websocket_route/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | com.redhat.consulting.fusequickstarts.karaf.websocket.route 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /karaf/infinispan/local-camel-producer/src/main/java/com/redhat/consulting/fusequickstarts/karaf/infinispan/LocalCamelProducer.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.infinispan; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | public class LocalCamelProducer extends RouteBuilder { 6 | 7 | @Override 8 | public void configure() throws Exception { 9 | 10 | from("timer://localCamelProducer?fixedRate=true&period=5000") 11 | // Set Headers for Infinispan 12 | .setHeader("CamelInfinispanKey", simple("${exchangeProperty.CamelTimerCounter}")) 13 | .setHeader("CamelInfinispanValue", simple("${exchangeProperty.CamelTimerCounter}")) 14 | 15 | // Call Infinispan 16 | .to("infinispan://localhost?cacheContainer=#cacheManager") 17 | 18 | // Log 19 | .to("log:localCamelProducer?showAll=true"); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /spring-boot/soap_consumer_contract_first/src/main/resources/config/application.yaml: -------------------------------------------------------------------------------- 1 | logging: 2 | config: classpath:config/logback.xml 3 | 4 | camel: 5 | springboot: 6 | name: SOAP WebService Consumer (Contract First) 7 | 8 | cxf: 9 | # Set context root for SOAP Web Services (default is /services) 10 | path: /soap 11 | 12 | server: 13 | port: 8080 14 | management: 15 | # Run management server on separate port 16 | server: 17 | port: 8081 18 | 19 | # Only enable specific actuator endpoints 20 | endpoints: 21 | enabled-by-default: false 22 | web: 23 | exposure: 24 | include: 25 | - info 26 | - health 27 | - camelroutes 28 | - camelroutecontroller 29 | endpoint: 30 | info: 31 | enabled: true 32 | health: 33 | enabled: true 34 | camelroutes: 35 | enabled: true 36 | read-only: true 37 | camelroutecontroller: 38 | enabled: true 39 | -------------------------------------------------------------------------------- /eap/rest_dsl/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | org.jboss.weld.environment.servlet.Listener 8 | 9 | 10 | 11 | 12 | CamelServlet 13 | org.apache.camel.component.servlet.CamelHttpTransportServlet 14 | 1 15 | 16 | 17 | 18 | 19 | CamelServlet 20 | /rest/* 21 | 22 | 23 | -------------------------------------------------------------------------------- /karaf/osgi_service/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf 8 | karaf-parent 9 | 7.6 10 | ../parent/pom.xml 11 | 12 | pom 13 | com.redhat.consulting.fusequickstarts.karaf.osgi_service 14 | osgi-service-parent 15 | Fuse Quick Start :: Karaf :: Blueprint :: OSGi Service Parent 16 | 17 | 18 | osgi_service_feature 19 | osgi_service 20 | osgi_consumer 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /karaf/rest/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/route/RequestRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.route; 2 | 3 | import org.apache.camel.LoggingLevel; 4 | import org.apache.camel.builder.RouteBuilder; 5 | 6 | import com.redhat.consulting.fusequickstarts.karaf.rest.processor.RequestProcessor; 7 | 8 | /* 9 | * The route for sending requests to our cxf endpoint 10 | */ 11 | public class RequestRoute extends RouteBuilder { 12 | 13 | private final RequestProcessor requestProcessor = new RequestProcessor(); 14 | 15 | @Override 16 | public void configure() throws Exception { 17 | // @formatter:off 18 | 19 | from("timer://restRequestTimer?period=5000") //period in milliseconds 20 | .log(LoggingLevel.INFO, "Starting request") 21 | .process(requestProcessor) //set the appropriate headers 22 | .to("cxfrs://bean://rsClient"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /spring-boot/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.redhat.consulting.fusequickstarts.spring-boot 7 | spring-boot-main 8 | 7.6 9 | pom 10 | 11 | Fuse Quick Start :: Spring Boot :: Main 12 | Main POM for the Spring Boot Fuse Quick Starts. 13 | 14 | 15 | parent 16 | route_deployment 17 | rest_consumer_rest_java 18 | rest_consumer_rest_xml 19 | soap_consumer_contract_first 20 | 21 | 22 | -------------------------------------------------------------------------------- /karaf/jms/src/main/java/com/redhat/consulting/fusequickstarts/karaf/jms/route/ProducerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.jms.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route runs based on a timer. It creates a message with 7 | * a simple text body and send it to an activemq queue. 8 | */ 9 | 10 | public class ProducerRoute extends RouteBuilder { 11 | 12 | @Override 13 | public void configure() throws Exception { 14 | // @formatter:off 15 | from("timer://myTimer?fixedRate=true&period=2000") 16 | .routeId("jmsProducer") 17 | .to("direct:jmsProducer"); 18 | 19 | from("direct:jmsProducer") 20 | .routeId("directJmsProducer") 21 | .transform().simple("Sample JMS Message") 22 | .log("Created Message: ${body}") 23 | .to("jms:queue:jmsTestQueue?clientId=jmsProducerRoute"); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /karaf/jpa/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | org.redhat.consulting.fusequickstarts.karaf.jpa.route 18 | 19 | 20 | -------------------------------------------------------------------------------- /karaf/shared_component/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf 8 | karaf-parent 9 | 7.6 10 | ../parent/pom.xml 11 | 12 | pom 13 | com.redhat.consulting.fusequickstarts.karaf.shared_component 14 | shared-component-parent 15 | Fuse Quick Start :: Karaf :: Blueprint :: Shared Component Parent 16 | 17 | 18 | 19 | shared_amq 20 | amq_route 21 | shared_amq_feature 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /karaf/jpa/src/main/java/org/redhat/consulting/fusequickstarts/karaf/jpa/route/JpaRoutes.java: -------------------------------------------------------------------------------- 1 | package org.redhat.consulting.fusequickstarts.karaf.jpa.route; 2 | 3 | import org.redhat.consulting.fusequickstarts.karaf.jpa.model.Person; 4 | import org.apache.camel.builder.RouteBuilder; 5 | 6 | public class JpaRoutes extends RouteBuilder { 7 | 8 | @Override 9 | public void configure() throws Exception { 10 | from("timer://jpaTimer?fixedRate=true&period=5000") 11 | .routeId("timerToJpa") 12 | .log("Generating New Person") 13 | .setBody(constant(new Person(Person.generateName()))) 14 | .log("Saving Person") 15 | .to("jpa://org.redhat.consulting.fusequickstarts.karaf.jpa.model.Person") 16 | .log("Saved Person: ${body}"); 17 | 18 | from("jpa://org.redhat.consulting.fusequickstarts.karaf.jpa.model.Person") 19 | .routeId("jpaToLog") 20 | .log("Retrieved Person: ${body}"); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /eap/jaxrs_proxy/src/main/java/com/redhat/consulting/fusequickstarts/eap/jaxrs/service/impl/CustomerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jaxrs.service.impl; 2 | 3 | import com.redhat.consulting.fusequickstarts.eap.jaxrs.service.CustomerService; 4 | 5 | import javax.inject.Inject; 6 | import javax.ws.rs.core.Response; 7 | 8 | import org.apache.camel.CamelContext; 9 | import org.apache.camel.Produce; 10 | import org.apache.camel.cdi.ContextName; 11 | 12 | public class CustomerServiceImpl implements CustomerService { 13 | @Inject 14 | @ContextName("jaxrs-proxy") 15 | private CamelContext context; 16 | 17 | @Produce(uri = "direct:customerEndpoints") 18 | private CustomerService customerServiceProxy; 19 | 20 | public Response getCustomers() { 21 | return customerServiceProxy.getCustomers(); 22 | } 23 | 24 | public Response getCustomer(String id) { 25 | return customerServiceProxy.getCustomer(id); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /karaf/osgi_ds/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf 8 | karaf-parent 9 | 7.6 10 | ../parent/pom.xml 11 | 12 | pom 13 | com.redhat.consulting.fusequickstarts.karaf.osgi_ds 14 | osgi-ds-parent 15 | Fuse Quick Start :: Karaf :: Blueprint :: OSGi Declarative Services Parent 16 | 17 | 18 | osgi_ds_api 19 | osgi_ds_feature 20 | osgi_ds_service 21 | osgi_ds_consumer 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /spring-boot/rest_consumer_rest_java/src/main/resources/config/application.yaml: -------------------------------------------------------------------------------- 1 | logging: 2 | config: classpath:config/logback.xml 3 | 4 | camel: 5 | springboot: 6 | name: REST Consumer (REST Java DSL) 7 | component: 8 | servlet: 9 | mapping: 10 | # Set context root for camel servlet (default is /camel/*) 11 | context-path: /camel-rest/* 12 | 13 | server: 14 | port: 8080 15 | management: 16 | # Run management server on separate port 17 | server: 18 | port: 8081 19 | 20 | # Only enable specific actuator endpoints 21 | endpoints: 22 | enabled-by-default: false 23 | web: 24 | exposure: 25 | include: 26 | - info 27 | - health 28 | - camelroutes 29 | - camelroutecontroller 30 | endpoint: 31 | info: 32 | enabled: true 33 | health: 34 | enabled: true 35 | camelroutes: 36 | enabled: true 37 | read-only: true 38 | camelroutecontroller: 39 | enabled: true 40 | -------------------------------------------------------------------------------- /karaf/rest_secure/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/secure/route/RequestRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.secure.route; 2 | 3 | import org.apache.camel.LoggingLevel; 4 | import org.apache.camel.builder.RouteBuilder; 5 | 6 | import com.redhat.consulting.fusequickstarts.karaf.rest.secure.processor.RequestProcessor; 7 | 8 | /* 9 | * The route for sending requests to our cxf endpoint 10 | */ 11 | public class RequestRoute extends RouteBuilder { 12 | 13 | private final RequestProcessor requestProcessor = new RequestProcessor(); 14 | 15 | @Override 16 | public void configure() throws Exception { 17 | // @formatter:off 18 | 19 | from("timer://restRequestTimer?period=5000") 20 | //period in milliseconds 21 | .log(LoggingLevel.INFO, "Starting request") 22 | .process(requestProcessor) //set the appropriate headers 23 | .to("cxfrs://bean://rsClient"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /eap/jpa/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | java:jboss/datasources/ExampleDS 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /eap/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.redhat.consulting.fusequickstarts.eap 7 | eap-main 8 | 7.6 9 | pom 10 | 11 | Fuse Quick Start :: EAP :: Main 12 | Main POM for the EAP Quick Starts. 13 | 14 | 15 | parent 16 | route_deployment 17 | jms 18 | rest_dsl 19 | jpa 20 | amq_mdb 21 | jms_mdb 22 | jaxrs_proxy 23 | spring_route_deployment 24 | 25 | 26 | -------------------------------------------------------------------------------- /karaf/osgi_service/osgi_service/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | -------------------------------------------------------------------------------- /eap/jaxrs_proxy/src/main/java/com/redhat/consulting/fusequickstarts/eap/jaxrs/repository/CustomerRepository.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jaxrs.repository; 2 | 3 | import com.redhat.consulting.fusequickstarts.eap.jaxrs.model.Customer; 4 | import com.redhat.consulting.fusequickstarts.eap.jaxrs.util.BeanInvocationProcessor; 5 | 6 | import java.util.LinkedList; 7 | import java.util.List; 8 | 9 | import org.apache.camel.Header; 10 | 11 | public class CustomerRepository { 12 | 13 | // Dummy Customer Data 14 | List customers = new LinkedList(); 15 | 16 | public CustomerRepository() { 17 | customers.add(new Customer("Bob", "Winston")); 18 | customers.add(new Customer("Jane", "Winston")); 19 | customers.add(new Customer("John", "Smith")); 20 | } 21 | 22 | public List getCustomers() { 23 | return customers; 24 | } 25 | 26 | public Customer getCustomer(Integer id) { 27 | return customers.get(id); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /eap/route_deployment/src/main/java/com/redhat/consulting/fusequickstarts/eap/deployment/route/AnotherSampleRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.deployment.route; 2 | 3 | import javax.ejb.Startup; 4 | import javax.enterprise.context.ApplicationScoped; 5 | 6 | import org.apache.camel.LoggingLevel; 7 | import org.apache.camel.builder.RouteBuilder; 8 | import org.apache.camel.cdi.ContextName; 9 | 10 | /* 11 | * The Annotations below are required for EAP to find and start the Camel Route. 12 | */ 13 | @Startup 14 | @ApplicationScoped 15 | @ContextName("route-deployment") 16 | public class AnotherSampleRoute extends RouteBuilder { 17 | 18 | @Override 19 | public void configure() throws Exception { 20 | 21 | // Logs Goodbye World every 2000 milliseconds 22 | from("timer://myEapTimer?fixedRate=true&period=2000").log(LoggingLevel.INFO, "com.redhat.consulting.fusequickstarts.eap.deployment.route", "Goodbye World").to( 23 | "log:GoodbyeWorldLog?level=INFO"); 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /karaf/websocket/websocket_feature/src/main/resources/features.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | default.timer=300000 9 | 10 | 11 | 12 | 13 | 14 | camel-core 15 | camel-websocket 16 | 17 | 18 | 19 | 20 | fuseWebsocketDependencies 21 | mvn:com.redhat.consulting.fusequickstarts.karaf.websocket/websocket_route/${project.version} 22 | 23 | 24 | -------------------------------------------------------------------------------- /eap/route_deployment/src/main/java/com/redhat/consulting/fusequickstarts/eap/deployment/route/SampleRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.deployment.route; 2 | 3 | import javax.ejb.Startup; 4 | import javax.enterprise.context.ApplicationScoped; 5 | 6 | import org.apache.camel.LoggingLevel; 7 | import org.apache.camel.builder.RouteBuilder; 8 | import org.apache.camel.cdi.ContextName; 9 | 10 | /* 11 | * The Annotations below are required for EAP to find and start the Camel Route. 12 | */ 13 | @Startup 14 | @ApplicationScoped 15 | @ContextName("route-deployment") 16 | public class SampleRoute extends RouteBuilder { 17 | 18 | @Override 19 | public void configure() throws Exception { 20 | 21 | // Logs Hello World every 2000 milliseconds 22 | from("timer://myEapTimer?fixedRate=true&period=2000") 23 | .log(LoggingLevel.INFO, "com.redhat.consulting.fusequickstarts.eap.deployment.route", "Hello World") 24 | .to("log:HelloWorldLog?level=INFO"); 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /karaf/idempotent/src/main/java/com/redhat/consulting/fusequickstarts/karaf/amq/route/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.amq.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | /* 6 | * This route uses an Idempotent Consumer and consumes messages from the Queue. 7 | * It uses a Custom Idempotent Repository based on Guava to Cache the Keys and then 8 | * Expire them after 60 seconds. This has the effect of only removing Duplicates for a 9 | * 60 second period. 10 | */ 11 | 12 | public class ConsumerRoute extends RouteBuilder { 13 | 14 | @Override 15 | public void configure() throws Exception { 16 | from("activemq:queue:myIdempotentQueue") 17 | .routeId("amqIdempotentConsumer") 18 | .idempotentConsumer(header("appId"), GuavaIdempotentRepository.guavaIdempotentRepository(60000)) 19 | .skipDuplicate(true) 20 | .setBody().simple("Received Message: ${body}") 21 | .to("log:amqConsumerLog"); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /eap/jpa/src/main/java/com/redhat/consulting/fusequickstars/eap/jpa/model/User.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstars.eap.jpa.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.Id; 6 | 7 | /** 8 | * @author lberetta 9 | */ 10 | 11 | @Entity 12 | public class User { 13 | 14 | @Id 15 | @GeneratedValue 16 | private Integer id; 17 | private String username; 18 | 19 | public User() {} 20 | 21 | public User(String username) { 22 | this.username = username; 23 | } 24 | 25 | public Integer getId() { 26 | return id; 27 | } 28 | 29 | public void setId(Integer id) { 30 | this.id = id; 31 | } 32 | 33 | public String getUsername() { 34 | return username; 35 | } 36 | 37 | public void setUsername(String username) { 38 | this.username = username; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | return "User [id=" + id + ", username=" + username + "]"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /karaf/shared_component/shared_amq_feature/src/main/resources/features.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | default.timer=300000 9 | 10 | 11 | 12 | 13 | camel-core 14 | 15 | 16 | 17 | 18 | my-dependencies 19 | mvn:com.redhat.consulting.fusequickstarts.karaf.shared_component/amq_route/${project.version} 20 | mvn:com.redhat.consulting.fusequickstarts.karaf.shared_component/shared_amq/${project.version} 21 | 22 | 23 | -------------------------------------------------------------------------------- /karaf/soap/src/main/java/com/redhat/consulting/fusequickstarts/karaf/soap/service/ws/CustomerOrderService.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.soap.service.ws; 2 | 3 | import javax.jws.WebParam; 4 | import javax.jws.WebService; 5 | 6 | import com.redhat.consulting.fusequickstarts.karaf.soap.model.CustomerOrder; 7 | import com.redhat.consulting.fusequickstarts.karaf.soap.model.CustomerOrderResponse; 8 | 9 | /** 10 | * Customer Order Service 11 | */ 12 | @WebService(targetNamespace = "http://consulting.redhat.com/wsdl/CustomerOrder/", name = "CustomerOrder", serviceName = "CustomerOrderService", portName = "SOAP") 13 | public interface CustomerOrderService { 14 | 15 | /** 16 | * Place a Customer Order 17 | * 18 | * @param order 19 | * @return 20 | */ 21 | public CustomerOrderResponse placeOrder(@WebParam(name = "customerOrder") CustomerOrder order); 22 | 23 | /** 24 | * Get an Order 25 | * 26 | * @param orderId 27 | * @return 28 | */ 29 | public CustomerOrder getOrder(@WebParam(name = "orderId") String orderId); 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot/rest_consumer_rest_xml/src/main/resources/config/application.yaml: -------------------------------------------------------------------------------- 1 | logging: 2 | config: classpath:config/logback.xml 3 | 4 | camel: 5 | springboot: 6 | name: REST Consumer (REST XML) 7 | # Leaving this xml-rests as the default value, but including for visibility 8 | xml-rests: classpath:camel-rest/*.xml 9 | component: 10 | servlet: 11 | mapping: 12 | # Set context root for camel servlet (default is /camel/*) 13 | context-path: /camel-rest/* 14 | 15 | server: 16 | port: 8080 17 | management: 18 | # Run management server on separate port 19 | server: 20 | port: 8081 21 | 22 | # Only enable specific actuator endpoints 23 | endpoints: 24 | enabled-by-default: false 25 | web: 26 | exposure: 27 | include: 28 | - info 29 | - health 30 | - camelroutes 31 | - camelroutecontroller 32 | endpoint: 33 | info: 34 | enabled: true 35 | health: 36 | enabled: true 37 | camelroutes: 38 | enabled: true 39 | read-only: true 40 | camelroutecontroller: 41 | enabled: true 42 | -------------------------------------------------------------------------------- /karaf/jpa/src/main/java/org/redhat/consulting/fusequickstarts/karaf/jpa/model/Person.java: -------------------------------------------------------------------------------- 1 | package org.redhat.consulting.fusequickstarts.karaf.jpa.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.Id; 6 | 7 | @Entity 8 | public class Person { 9 | 10 | @Id 11 | @GeneratedValue 12 | private long id; 13 | 14 | private String name; 15 | 16 | public Person(){ 17 | 18 | } 19 | 20 | public Person(String pName){ 21 | this.name = pName; 22 | } 23 | 24 | public long getId() { 25 | return id; 26 | } 27 | 28 | public void setId(long id) { 29 | this.id = id; 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | 40 | public static String generateName(){ 41 | return "SomeName"; 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | return "Person [id=" + id + ", name=" + name + "]"; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /karaf/osgi_service/osgi_service_feature/src/main/resources/features.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | default.timer=300000 9 | 10 | 11 | 12 | 13 | 14 | camel-core 15 | 16 | 17 | 18 | 19 | sharedOsgiServiceDependencies 20 | mvn:com.redhat.consulting.fusequickstarts.karaf.osgi_service/osgi_service/${project.version} 21 | mvn:com.redhat.consulting.fusequickstarts.karaf.osgi_service/osgi_consumer/${project.version} 22 | 23 | 24 | -------------------------------------------------------------------------------- /karaf/rest/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/processor/RequestProcessor.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.processor; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.ExchangePattern; 5 | import org.apache.camel.Message; 6 | import org.apache.camel.Processor; 7 | import org.apache.camel.component.cxf.common.message.CxfConstants; 8 | import org.apache.cxf.message.MessageContentsList; 9 | 10 | public class RequestProcessor implements Processor { 11 | 12 | public void process(Exchange exchange) throws Exception { 13 | exchange.setPattern(ExchangePattern.InOut); 14 | Message inMessage = exchange.getIn(); 15 | // set the operation name 16 | inMessage.setHeader(CxfConstants.OPERATION_NAME, "getSampleUser"); 17 | // using the proxy client API 18 | inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, Boolean.FALSE); 19 | // creating the request 20 | MessageContentsList req = new MessageContentsList(); 21 | req.add(1); 22 | inMessage.setBody(req); 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /karaf/jpa_jta/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/h2ds) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /karaf/soap_secure/src/main/java/com/redhat/consulting/fusequickstarts/karaf/soap/secure/service/ws/CustomerOrderService.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.soap.secure.service.ws; 2 | 3 | import javax.jws.WebParam; 4 | import javax.jws.WebService; 5 | 6 | import com.redhat.consulting.fusequickstarts.karaf.soap.secure.model.CustomerOrder; 7 | import com.redhat.consulting.fusequickstarts.karaf.soap.secure.model.CustomerOrderResponse; 8 | 9 | /** 10 | * Customer Order Service 11 | */ 12 | @WebService(targetNamespace = "http://consulting.redhat.com/wsdl/CustomerOrder/", name = "CustomerOrder", serviceName = "CustomerOrderService", portName = "SOAP") 13 | public interface CustomerOrderService { 14 | 15 | /** 16 | * Place a Customer Order 17 | * 18 | * @param order 19 | * @return 20 | */ 21 | public CustomerOrderResponse placeOrder(@WebParam(name = "customerOrder") CustomerOrder order); 22 | 23 | /** 24 | * Get an Order 25 | * 26 | * @param orderId 27 | * @return 28 | */ 29 | public CustomerOrder getOrder(@WebParam(name = "orderId") String orderId); 30 | } 31 | -------------------------------------------------------------------------------- /karaf/rest_beanvalidation/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/beanvalidation/route/RequestRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.beanvalidation.route; 2 | 3 | import com.redhat.consulting.fusequickstarts.karaf.rest.beanvalidation.processor.InvalidFiftyPercentOfTimesRequestProcessor; 4 | import org.apache.camel.LoggingLevel; 5 | import org.apache.camel.builder.RouteBuilder; 6 | 7 | /* 8 | * The route for sending requests to our cxf endpoint 9 | */ 10 | public class RequestRoute extends RouteBuilder { 11 | 12 | private final InvalidFiftyPercentOfTimesRequestProcessor requestProcessor = new InvalidFiftyPercentOfTimesRequestProcessor(); 13 | 14 | @Override 15 | public void configure() throws Exception { 16 | // @formatter:off 17 | 18 | from("timer://restRequestTimer?period=5000") //period in milliseconds 19 | .routeId("restEndpointTestProducer") 20 | .log(LoggingLevel.INFO, "Starting request") 21 | .process(requestProcessor) //set the appropriate headers 22 | .to("cxfrs://bean://rsClient"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf 8 | karaf-parent 9 | 7.6 10 | ../parent/pom.xml 11 | 12 | pom 13 | com.redhat.consulting.fusequickstarts.karaf.osgi_service_adv 14 | osgi-service-adv-parent 15 | Fuse Quick Start :: Karaf :: Multiple :: OSGi Advanced Service :: Parent 16 | 17 | 18 | blueprint_service 19 | blueprint_consumer 20 | blueprint_sdm_consumer 21 | spring_service 22 | spring_consumer 23 | spring_bp_consumer 24 | service_api 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /spring-boot/soap_consumer_contract_first/src/main/resources/config/cxf-endpoint-beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/blueprint_service/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /karaf/osgi_service/osgi_consumer/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | com.redhat.consulting.fusequickstarts.karaf.osgi_service.route 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /karaf/rest_dsl/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | com.redhat.consulting.fusequickstarts.karaf.rest.dsl.route 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /karaf/jpa_jta/src/main/java/org/redhat/consulting/fusequickstarts/karaf/jpa/model/Person.java: -------------------------------------------------------------------------------- 1 | package org.redhat.consulting.fusequickstarts.karaf.jpa.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | 8 | @Entity 9 | public class Person { 10 | 11 | @Id 12 | private long id; 13 | 14 | private String name; 15 | 16 | public Person(){ 17 | 18 | } 19 | 20 | public Person(long pId, String pName){ 21 | this.id = pId; 22 | this.name = pName; 23 | } 24 | 25 | public long getId() { 26 | return id; 27 | } 28 | 29 | public void setId(long id) { 30 | this.id = id; 31 | } 32 | 33 | public String getName() { 34 | return name; 35 | } 36 | 37 | public void setName(String name) { 38 | this.name = name; 39 | } 40 | 41 | public static String generateName(){ 42 | return "SomeName"; 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return "Person [id=" + id + ", name=" + name + "]"; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /karaf/soap_secure/src/main/java/com/redhat/consulting/fusequickstarts/karaf/soap/secure/model/CustomerOrderResponse.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.soap.secure.model; 2 | 3 | /** 4 | * Response Class for Customer Orders. 5 | * 6 | */ 7 | public class CustomerOrderResponse { 8 | 9 | private CustomerOrder order; 10 | private boolean completed; 11 | 12 | /** 13 | * Get the order. 14 | * 15 | * @return the order 16 | */ 17 | public CustomerOrder getOrder() { 18 | return this.order; 19 | } 20 | 21 | /** 22 | * Set the order. 23 | * 24 | * @param order the order to set 25 | */ 26 | public void setOrder(CustomerOrder order) { 27 | this.order = order; 28 | } 29 | 30 | /** 31 | * Get the completed. 32 | * 33 | * @return the completed 34 | */ 35 | public boolean isCompleted() { 36 | return this.completed; 37 | } 38 | 39 | /** 40 | * Set the completed. 41 | * 42 | * @param completed the completed to set 43 | */ 44 | public void setCompleted(boolean completed) { 45 | this.completed = completed; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/blueprint_consumer/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | com.redhat.consulting.fusequickstarts.karaf.osgi_service.route 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/blueprint_sdm_consumer/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | com.redhat.consulting.fusequickstarts.karaf.osgi_service.route 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /karaf/soap/src/main/java/com/redhat/consulting/fusequickstarts/karaf/soap/model/CustomerOrderResponse.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.soap.model; 2 | 3 | /** 4 | * Response Class for Customer Orders. 5 | * 6 | */ 7 | public class CustomerOrderResponse { 8 | 9 | private CustomerOrder order; 10 | private boolean completed; 11 | 12 | /** 13 | * Get the order. 14 | * 15 | * @return the order 16 | */ 17 | public CustomerOrder getOrder() { 18 | return this.order; 19 | } 20 | 21 | /** 22 | * Set the order. 23 | * 24 | * @param order 25 | * the order to set 26 | */ 27 | public void setOrder(CustomerOrder order) { 28 | this.order = order; 29 | } 30 | 31 | /** 32 | * Get the completed. 33 | * 34 | * @return the completed 35 | */ 36 | public boolean isCompleted() { 37 | return this.completed; 38 | } 39 | 40 | /** 41 | * Set the completed. 42 | * 43 | * @param completed 44 | * the completed to set 45 | */ 46 | public void setCompleted(boolean completed) { 47 | this.completed = completed; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /eap/spring_route_deployment/src/main/resources/META-INF/spring/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/spring_consumer/src/main/resources/META-INF/spring/spring-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 14 | 15 | 17 | com.redhat.consulting.fusequickstarts.karaf.osgi_service.route 18 | 19 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/spring_bp_consumer/src/main/resources/META-INF/spring/spring-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 14 | 15 | 17 | com.redhat.consulting.fusequickstarts.karaf.osgi_service.route 18 | 19 | -------------------------------------------------------------------------------- /karaf/osgi_service_adv/spring_service/src/main/resources/META-INF/spring/spring-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /karaf/rest_beanvalidation/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/beanvalidation/processor/RequestProcessor.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.beanvalidation.processor; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.ExchangePattern; 5 | import org.apache.camel.Message; 6 | import org.apache.camel.Processor; 7 | import org.apache.camel.component.cxf.common.message.CxfConstants; 8 | import org.apache.cxf.message.MessageContentsList; 9 | 10 | public class RequestProcessor implements Processor { 11 | 12 | public void process(Exchange exchange) throws Exception { 13 | exchange.setPattern(ExchangePattern.InOut); 14 | Message inMessage = exchange.getIn(); 15 | // set the operation name 16 | inMessage.setHeader(CxfConstants.OPERATION_NAME, "getSampleUser"); 17 | // using the proxy client API 18 | inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, Boolean.FALSE); 19 | // creating the request 20 | MessageContentsList req = new MessageContentsList(); 21 | // setting id which start with one (i.e. pattern: regexp = "^1[0-9]*$") 22 | req.add("1"); 23 | inMessage.setBody(req); 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /karaf/infinispan/remote-camel-producer/src/main/java/com/redhat/consulting/fusequickstarts/karaf/infinispan/RemoteCamelProducer.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.infinispan; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | public class RemoteCamelProducer extends RouteBuilder { 6 | 7 | @Override 8 | public void configure() throws Exception { 9 | 10 | from("timer://remoteCamelProducer?fixedRate=true&period=5000") 11 | // Set Headers for Infinispan Put 12 | .setHeader("CamelInfinispanKey", simple("${exchangeProperty.CamelTimerCounter}")) 13 | .setHeader("CamelInfinispanValue", simple("${exchangeProperty.CamelTimerCounter}")) 14 | 15 | // Call Infinispan 16 | .to("infinispan://localhost") 17 | 18 | // Read the Value Back out 19 | .setHeader("CamelInfinispanKey", simple("${exchangeProperty.CamelTimerCounter}")) 20 | .setHeader("CamelInfinispanOperation", constant("CamelInfinispanOperationGet")) 21 | 22 | // Call Infinispan 23 | .to("infinispan://localhost") 24 | 25 | // Log 26 | .to("log:remoteCamelProducer?showAll=true"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /karaf/rest/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/route/EndpointRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.route; 2 | 3 | import org.apache.camel.LoggingLevel; 4 | import org.apache.camel.builder.RouteBuilder; 5 | import org.apache.camel.component.cxf.common.message.CxfConstants; 6 | 7 | import com.redhat.consulting.fusequickstarts.karaf.rest.processor.MyResourceImpl; 8 | 9 | /* 10 | * The route for receiving requests from out cxf endpoints. 11 | */ 12 | 13 | public class EndpointRoute extends RouteBuilder { 14 | 15 | private MyResourceImpl myResourceImpl = new MyResourceImpl(); 16 | 17 | @Override 18 | public void configure() throws Exception { 19 | // @formatter:off 20 | 21 | from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer") 22 | .routeId("restEndpointConsumer") 23 | .choice() //selects what to do based on the request 24 | .when(header(CxfConstants.OPERATION_NAME).isEqualTo("getSampleUser")) 25 | .bean(myResourceImpl, "getSampleUser") 26 | .log(LoggingLevel.INFO, "Request Recieved") 27 | .otherwise() 28 | .log(LoggingLevel.WARN, "Unknown Method"); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /karaf/infinispan/local-client/src/main/java/com/redhat/consulting/fusequickstarts/karaf/infinispan/LocalClient.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.infinispan; 2 | 3 | import org.infinispan.manager.EmbeddedCacheManager; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | public class LocalClient { 8 | 9 | private static final transient Logger LOG = LoggerFactory.getLogger(LocalClient.class); 10 | private EmbeddedCacheManager cacheManager; 11 | 12 | public EmbeddedCacheManager getCacheManager() { 13 | return cacheManager; 14 | } 15 | 16 | public void setCacheManager(EmbeddedCacheManager cacheManager) { 17 | this.cacheManager = cacheManager; 18 | } 19 | 20 | public Object process(String operation, String key, String value) { 21 | LOG.info("Local " + operation + " {} : {} ", key, value); 22 | if ("PUT".equals(operation)) { 23 | return cacheManager.getCache().put(key, value); 24 | } else if ("GET".equals(operation)) { 25 | return cacheManager.getCache().get(key); 26 | } else if ("DELETE".equals(operation)) { 27 | return cacheManager.getCache().remove(key); 28 | } else throw new UnsupportedOperationException(operation); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /karaf/rest_dsl_simple/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 15 | 16 | 17 | 18 | com.redhat.consulting.fusequickstarts.karaf.rest.dsl.simple.route 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /karaf/rest_secure/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/secure/route/EndpointRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.secure.route; 2 | 3 | import org.apache.camel.LoggingLevel; 4 | import org.apache.camel.builder.RouteBuilder; 5 | import org.apache.camel.component.cxf.common.message.CxfConstants; 6 | 7 | import com.redhat.consulting.fusequickstarts.karaf.rest.secure.processor.MyResourceImpl; 8 | 9 | /* 10 | * The route for receiving requests from out cxf endpoints. 11 | */ 12 | 13 | public class EndpointRoute extends RouteBuilder { 14 | 15 | private MyResourceImpl myResourceImpl = new MyResourceImpl(); 16 | 17 | @Override 18 | public void configure() throws Exception { 19 | // @formatter:off 20 | 21 | from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer") 22 | .routeId("restEndpointConsumer") 23 | .choice() //selects what to do based on the request 24 | .when(header(CxfConstants.OPERATION_NAME).isEqualTo("getSampleUser")) 25 | .bean(myResourceImpl, "getSampleUser") 26 | .log(LoggingLevel.INFO, "Request Recieved") 27 | .otherwise() 28 | .log(LoggingLevel.WARN, "Unknown Method"); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /karaf/jdbc_jta/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | org.redhat.consulting.fusequickstarts.karaf.jdbc.route 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /karaf/shared_component/shared_amq/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | -------------------------------------------------------------------------------- /karaf/soap/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | com.redhat.consulting.fusequickstarts.karaf.soap 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /spring-boot/rest_consumer_rest_xml/src/main/java/com/redhat/consulting/fusequickstarts/springboot/restconsumer/restxml/UserService.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.springboot.restconsumer.restxml; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import java.util.Collection; 6 | import java.util.Map; 7 | import java.util.concurrent.ConcurrentHashMap; 8 | 9 | @Service 10 | public class UserService { 11 | 12 | private ConcurrentHashMap usersById = new ConcurrentHashMap<>(); 13 | 14 | // Expose the internal user list for testing 15 | Map getUsersById() { 16 | return usersById; 17 | } 18 | 19 | public Collection getUsers() { 20 | return usersById.values(); 21 | } 22 | 23 | public User getUser(int id) { 24 | return usersById.get(id); 25 | } 26 | 27 | public User createUser(User createUser) { 28 | usersById.put(createUser.getId(), createUser); 29 | return createUser; 30 | } 31 | 32 | public User updateUser(User updateUser) { 33 | usersById.put(updateUser.getId(), updateUser); 34 | return updateUser; 35 | } 36 | 37 | public boolean deleteUser(int id) { 38 | User deleted = usersById.remove(id); 39 | return deleted != null; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /karaf/jpa_jta/src/main/resources/datasources/h2-ds.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /karaf/rest_beanvalidation/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/beanvalidation/route/EndpointRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.beanvalidation.route; 2 | 3 | import com.redhat.consulting.fusequickstarts.karaf.rest.beanvalidation.processor.MyServiceImpl; 4 | import org.apache.camel.LoggingLevel; 5 | import org.apache.camel.builder.RouteBuilder; 6 | import org.apache.camel.component.cxf.common.message.CxfConstants; 7 | 8 | /* 9 | * The route for receiving requests from out cxf endpoints. 10 | */ 11 | 12 | public class EndpointRoute extends RouteBuilder { 13 | 14 | private MyServiceImpl myServiceImpl = new MyServiceImpl(); 15 | 16 | @Override 17 | public void configure() throws Exception { 18 | // @formatter:off 19 | 20 | from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer") 21 | .routeId("restEndpointConsumer") 22 | .choice() //selects what to do based on the request 23 | .when(header(CxfConstants.OPERATION_NAME).isEqualTo("getSampleUser")) 24 | .bean(myServiceImpl, "getSampleUser") 25 | .log(LoggingLevel.INFO, "Request Recieved") 26 | .otherwise() 27 | .log(LoggingLevel.WARN, "Unknown Method"); 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot/soap_consumer_contract_first/src/main/xjb/customer-order-example.xjb: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | false 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /spring-boot/rest_consumer_rest_java/src/main/java/com/redhat/consulting/fusequickstarts/springboot/restconsumer/restjavadsl/UserService.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.springboot.restconsumer.restjavadsl; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import java.util.Collection; 6 | import java.util.Map; 7 | import java.util.concurrent.ConcurrentHashMap; 8 | 9 | @Service 10 | public class UserService { 11 | 12 | private ConcurrentHashMap usersById = new ConcurrentHashMap<>(); 13 | 14 | // Expose the internal user list for testing 15 | Map getUsersById() { 16 | return usersById; 17 | } 18 | 19 | public Collection getUsers() { 20 | return usersById.values(); 21 | } 22 | 23 | public User getUser(int id) { 24 | return usersById.get(id); 25 | } 26 | 27 | public User createUser(User createUser) { 28 | usersById.put(createUser.getId(), createUser); 29 | return createUser; 30 | } 31 | 32 | public User updateUser(User updateUser) { 33 | usersById.put(updateUser.getId(), updateUser); 34 | return updateUser; 35 | } 36 | 37 | public boolean deleteUser(int id) { 38 | User deleted = usersById.remove(id); 39 | return deleted != null; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /karaf/infinispan/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | com.redhat.consulting.fusequickstarts.karaf 7 | karaf-parent 8 | 7.6 9 | ../parent/pom.xml 10 | 11 | 4.0.0 12 | 13 | com.redhat.consulting.fusequickstarts.karaf.infinispan 14 | infinispan-parent 15 | pom 16 | Fuse Quick Start :: Karaf :: Blueprint :: Infinispan Parent 17 | 18 | 19 | 20 | org.slf4j 21 | slf4j-api 22 | 23 | 24 | org.slf4j 25 | slf4j-log4j12 26 | 27 | 28 | 29 | 30 | remote-client 31 | local-cache 32 | local-client 33 | local-camel-consumer 34 | local-camel-producer 35 | remote-camel-producer 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /karaf/shared_component/amq_route/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | com.redhat.consulting.fusequickstarts.karaf.shared_component.amq.route 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /eap/jms_mdb/src/main/java/com/redhat/consulting/fusequickstarts/eap/jms/mdb/ProducerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jms.mdb; 2 | 3 | import javax.annotation.Resource; 4 | import javax.ejb.Startup; 5 | import javax.enterprise.context.ApplicationScoped; 6 | import javax.jms.ConnectionFactory; 7 | 8 | import org.apache.camel.builder.RouteBuilder; 9 | import org.apache.camel.cdi.ContextName; 10 | import org.apache.camel.component.jms.JmsComponent; 11 | 12 | /* 13 | * This route runs based on a timer. It creates a message with 14 | * a simple text body and sends it to a queue. 15 | */ 16 | 17 | @Startup 18 | @ApplicationScoped 19 | @ContextName("jms-mdb") 20 | public class ProducerRoute extends RouteBuilder { 21 | @Resource(mappedName ="java:/ConnectionFactory") 22 | private ConnectionFactory connectionFactory; 23 | 24 | @Override 25 | public void configure() throws Exception { 26 | JmsComponent component = new JmsComponent(); 27 | component.setConnectionFactory(connectionFactory); 28 | 29 | getContext().addComponent("jms", component); 30 | 31 | from("timer://myTimer?fixedRate=true&period=5000") 32 | .routeId("producer") 33 | .setBody().simple("Sample JMS Message") 34 | .log("Created Message: ${body}") 35 | .to("jms:queue:queue1"); 36 | 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /karaf/feature/src/main/resources/features.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | default.timer=300000 9 | 10 | 11 | 12 | 13 | camel-core 14 | camel-restlet 15 | camel-http4 16 | camel-jackson 17 | wrap:mvn:org.apache.geronimo.specs/geronimo-ws-metadata_2.0_spec/1.1.3$Bundle-SymbolicName=Geronimo&Bundle-Version=2.0 18 | 19 | 20 | 21 | 22 | my-dependencies 23 | mvn:com.redhat.consulting.fusequickstarts.karaf/rest-dsl/${project.version} 24 | mvn:com.redhat.consulting.fusequickstarts.karaf/properties/${project.version} 25 | mvn:com.redhat.consulting.fusequickstarts.karaf/soap/${project.version} 26 | 27 | 28 | -------------------------------------------------------------------------------- /karaf/soap_client/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | com.redhat.consulting.fusequickstarts.karaf.soap_client 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /eap/amq_mdb/src/main/java/com/redhat/consulting/fusequickstarts/eap/amq/mdb/ProducerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.amq.mdb; 2 | 3 | import javax.annotation.Resource; 4 | import javax.ejb.Startup; 5 | import javax.enterprise.context.ApplicationScoped; 6 | import javax.jms.ConnectionFactory; 7 | 8 | import org.apache.activemq.camel.component.ActiveMQComponent; 9 | import org.apache.camel.builder.RouteBuilder; 10 | import org.apache.camel.cdi.ContextName; 11 | 12 | /* 13 | * This route runs based on a timer. It creates a message with 14 | * a simple text body and sends it to an activemq queue. 15 | */ 16 | 17 | @Startup 18 | @ApplicationScoped 19 | @ContextName("amq-mdb") 20 | public class ProducerRoute extends RouteBuilder { 21 | @Resource(mappedName ="java:/activemq/ConnectionFactory") 22 | private ConnectionFactory connectionFactory; 23 | 24 | @Override 25 | public void configure() throws Exception { 26 | ActiveMQComponent component = ActiveMQComponent.activeMQComponent(); 27 | component.setConnectionFactory(connectionFactory); 28 | 29 | getContext().addComponent("activemq", component); 30 | 31 | from("timer://myTimer?fixedRate=true&period=5000") 32 | .routeId("producer") 33 | .setBody().simple("Sample AMQ Message") 34 | .log("Created Message: ${body}") 35 | .to("activemq:queue:queue1"); 36 | 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /karaf/route_deployment/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | com.redhat.consulting.fusequickstarts.karaf.deployment.route.scan 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /karaf/soap_contract_first/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | com.redhat.consulting.fusequickstarts.karaf.soap 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /eap/jaxrs_proxy/src/main/java/com/redhat/consulting/fusequickstarts/eap/jaxrs/util/BeanInvocationProcessor.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jaxrs.util; 2 | 3 | import java.util.Map.Entry; 4 | 5 | import org.apache.camel.Exchange; 6 | import org.apache.camel.Processor; 7 | import org.apache.camel.component.bean.BeanInvocation; 8 | 9 | /** 10 | * Custom Processor that Removes the Invoked Method Name and Arguments and sets 11 | * them on the Exchange as a Header. 12 | */ 13 | public class BeanInvocationProcessor implements Processor { 14 | 15 | /** 16 | * Name of Method Invoked as a String. 17 | */ 18 | public static String HEADER_METHOD_NAME = "ServiceMethodName"; 19 | 20 | /** 21 | * Arguments passed into the Method as an Object[]. 22 | */ 23 | public static String HEADER_METHOD_ARGS = "ServiceMethodArguments"; 24 | 25 | /* 26 | * (non-Javadoc) 27 | * 28 | * @see org.apache.camel.Processor#process(org.apache.camel.Exchange) 29 | */ 30 | public void process(Exchange exchange) throws Exception { 31 | BeanInvocation beanInvocation = exchange.getIn().getBody(BeanInvocation.class); 32 | 33 | String methodName = beanInvocation.getMethod().getName(); 34 | Object[] arguments = beanInvocation.getArgs(); 35 | 36 | exchange.getIn().setHeader(HEADER_METHOD_NAME, methodName); 37 | exchange.getIn().setHeader(HEADER_METHOD_ARGS, arguments); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /karaf/rest_dsl/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/dsl/model/Note.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.dsl.model; 2 | 3 | /** 4 | * Simple Note POJO for use with REST DSL. 5 | * 6 | * @author Bryan Saunders 7 | * 8 | */ 9 | public class Note { 10 | 11 | private String message; 12 | private String to; 13 | private String from; 14 | 15 | /** 16 | * Get the message. 17 | * 18 | * @return the message 19 | */ 20 | public String getMessage() { 21 | return this.message; 22 | } 23 | /** 24 | * Set the message. 25 | * 26 | * @param message the message to set 27 | */ 28 | public void setMessage(String message) { 29 | this.message = message; 30 | } 31 | /** 32 | * Get the to. 33 | * 34 | * @return the to 35 | */ 36 | public String getTo() { 37 | return this.to; 38 | } 39 | /** 40 | * Set the to. 41 | * 42 | * @param to the to to set 43 | */ 44 | public void setTo(String to) { 45 | this.to = to; 46 | } 47 | /** 48 | * Get the from. 49 | * 50 | * @return the from 51 | */ 52 | public String getFrom() { 53 | return this.from; 54 | } 55 | /** 56 | * Set the from. 57 | * 58 | * @param from the from to set 59 | */ 60 | public void setFrom(String from) { 61 | this.from = from; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /eap/jms/src/main/java/com/redhat/consulting/fusequickstarts/eap/jms/route/ConsumerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jms.route; 2 | 3 | import javax.annotation.Resource; 4 | import javax.ejb.Startup; 5 | import javax.enterprise.context.ApplicationScoped; 6 | import javax.jms.ConnectionFactory; 7 | 8 | import org.apache.camel.builder.RouteBuilder; 9 | import org.apache.camel.cdi.ContextName; 10 | import org.apache.camel.component.jms.JmsComponent; 11 | 12 | /* 13 | * This route picks up from the activemq queue and logs the body of 14 | * the message. 15 | */ 16 | @Startup 17 | @ApplicationScoped 18 | @ContextName("eap-jms") 19 | public class ConsumerRoute extends RouteBuilder { 20 | 21 | @Resource(mappedName = "java:/ConnectionFactory") 22 | private ConnectionFactory connectionFactory; 23 | 24 | @Override 25 | public void configure() throws Exception { 26 | JmsComponent component = new JmsComponent(); 27 | component.setConnectionFactory(connectionFactory); 28 | 29 | getContext().addComponent("jms", component); 30 | // @formatter:off 31 | from("jms:queue:eapJmsTestQueue?clientId=eapJmsConsumerRoute") 32 | .routeId("eapJmsConsumer") 33 | .to("direct:eapJmsConsumer"); 34 | 35 | from("direct:eapJmsConsumer") 36 | .routeId("eapDirectJmsConsumer") 37 | .setBody().simple("Received Message: ${body}") 38 | .to("log:eapJmsConsumerLog"); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /karaf/amq/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | com.redhat.consulting.fusequickstarts.karaf.amq.route 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /karaf/idempotent/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | com.redhat.consulting.fusequickstarts.karaf.amq.route 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /karaf/rest_dsl_basic_auth/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/auth/basic/dsl/model/Note.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.auth.basic.dsl.model; 2 | 3 | /** 4 | * Simple Note POJO for use with REST DSL. 5 | * 6 | * @author Bryan Saunders 7 | * 8 | */ 9 | public class Note { 10 | 11 | private String message; 12 | private String to; 13 | private String from; 14 | 15 | /** 16 | * Get the message. 17 | * 18 | * @return the message 19 | */ 20 | public String getMessage() { 21 | return this.message; 22 | } 23 | /** 24 | * Set the message. 25 | * 26 | * @param message the message to set 27 | */ 28 | public void setMessage(String message) { 29 | this.message = message; 30 | } 31 | /** 32 | * Get the to. 33 | * 34 | * @return the to 35 | */ 36 | public String getTo() { 37 | return this.to; 38 | } 39 | /** 40 | * Set the to. 41 | * 42 | * @param to the to to set 43 | */ 44 | public void setTo(String to) { 45 | this.to = to; 46 | } 47 | /** 48 | * Get the from. 49 | * 50 | * @return the from 51 | */ 52 | public String getFrom() { 53 | return this.from; 54 | } 55 | /** 56 | * Set the from. 57 | * 58 | * @param from the from to set 59 | */ 60 | public void setFrom(String from) { 61 | this.from = from; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /karaf/jpa_jta/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | org.redhat.consulting.fusequickstarts.karaf.jpa.route 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /karaf/jdbc_jta/src/main/resources/datasources/h2-ds.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | Bundle-SymbolicName = Fuse Quick Starts - H2 Sample Datasource 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /karaf/soap_secure/src/main/java/com/redhat/consulting/fusequickstarts/karaf/soap/secure/model/CustomerOrder.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.soap.secure.model; 2 | 3 | /** 4 | * Basic Customer Order Object. 5 | */ 6 | public class CustomerOrder { 7 | 8 | private String item; 9 | private Integer quantity; 10 | private String orderId; 11 | 12 | /** 13 | * Get the item. 14 | * 15 | * @return the item 16 | */ 17 | public String getItem() { 18 | return this.item; 19 | } 20 | 21 | /** 22 | * Set the item. 23 | * 24 | * @param item the item to set 25 | */ 26 | public void setItem(String item) { 27 | this.item = item; 28 | } 29 | 30 | /** 31 | * Get the quantity. 32 | * 33 | * @return the quantity 34 | */ 35 | public Integer getQuantity() { 36 | return this.quantity; 37 | } 38 | 39 | /** 40 | * Set the quantity. 41 | * 42 | * @param quantity the quantity to set 43 | */ 44 | public void setQuantity(Integer quantity) { 45 | this.quantity = quantity; 46 | } 47 | 48 | /** 49 | * Get the orderId. 50 | * 51 | * @return the orderId 52 | */ 53 | public String getOrderId() { 54 | return this.orderId; 55 | } 56 | 57 | /** 58 | * Set the orderId. 59 | * 60 | * @param orderId the orderId to set 61 | */ 62 | public void setOrderId(String orderId) { 63 | this.orderId = orderId; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /eap/jms/src/main/java/com/redhat/consulting/fusequickstarts/eap/jms/route/ProducerRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.eap.jms.route; 2 | 3 | import javax.annotation.Resource; 4 | import javax.ejb.Startup; 5 | import javax.enterprise.context.ApplicationScoped; 6 | import javax.jms.ConnectionFactory; 7 | 8 | import org.apache.camel.builder.RouteBuilder; 9 | import org.apache.camel.cdi.ContextName; 10 | import org.apache.camel.component.jms.JmsComponent; 11 | 12 | /* 13 | * This route runs based on a timer. It creates a message with 14 | * a simple text body and send it to an activemq queue. 15 | */ 16 | 17 | @Startup 18 | @ApplicationScoped 19 | @ContextName("eap-jms") 20 | public class ProducerRoute extends RouteBuilder { 21 | 22 | @Resource(mappedName = "java:/ConnectionFactory") 23 | private ConnectionFactory connectionFactory; 24 | 25 | @Override 26 | public void configure() throws Exception { 27 | JmsComponent component = new JmsComponent(); 28 | component.setConnectionFactory(connectionFactory); 29 | 30 | // @formatter:off 31 | from("timer://myEapJmsTimer?fixedRate=true&period=2000") 32 | .routeId("eapJmsProducer") 33 | .to("direct:eapJmsProducer"); 34 | 35 | from("direct:eapJmsProducer") 36 | .routeId("eapDirectJmsProducer") 37 | .transform().simple("Sample JMS Message") 38 | .log("Created Message: ${body}") 39 | .to("jms:queue:eapJmsTestQueue?clientId=eapJmsProducerRoute"); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /karaf/osgi_service/osgi_service/README.md: -------------------------------------------------------------------------------- 1 | OSGi Service Publisher 2 | ==================================== 3 | This bundle defines a simple Hello World OSGi service that can be consumed and used by other bundles. 4 | 5 | ### Requirements: 6 | * Red Hat Fuse 7.6.0 7 | * Maven 3.0 or Greater (http://maven.apache.org/) 8 | * Java 8 9 | 10 | Building 11 | ----------------------- 12 | To build the project. 13 | 14 | mvn clean install 15 | 16 | This will build the bundle including the manifest information. 17 | 18 | Deploying to Red Hat Fuse 19 | ----------------------- 20 | 21 | To start up Fuse browse to your fuse install directory. Then run 22 | 23 | /bin/fuse 24 | 25 | This will bring up the fuse console. Once in the console you will be able to install your bundle. Usually we would install multiple bundles using a feature file, but in this case since we only have one bundle to install we can just install it using the file by the following command. Another option is to set up your local m2 repository in fuse in the fuse/etc/org.ops4j.pax.url.mvn.cfg file. Then you can use the mvn syntax below. 26 | 27 | karaf@root> osgi:install -s file:/home/yourUser/.m2/repository/com/redhat/consulting/fusequickstarts/karaf/osgi_service/osgi_service/7.6/osgi_service-7.6.jar 28 | OR 29 | karaf@root> osgi:install -s mvn:com.redhat.consulting.fusequickstarts.karaf.osgi_service/osgi_service/7.6 30 | 31 | The -s here indicates to also start the bundle. Alternatively you can omit the -s and after the install run 32 | 33 | karaf@root> osgi:start 34 | 35 | -------------------------------------------------------------------------------- /karaf/rest_dsl_simple/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/dsl/simple/route/SampleRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.dsl.simple.route; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.LoggingLevel; 5 | import org.apache.camel.builder.RouteBuilder; 6 | import org.apache.camel.model.rest.RestBindingMode; 7 | 8 | public class SampleRoute extends RouteBuilder { 9 | 10 | @Override 11 | public void configure() throws Exception { 12 | // @formatter:off 13 | 14 | //configures the rest dsl to use the restlet component as well as defines the appropriate host, port, and binding 15 | restConfiguration().component("restlet").host("localhost").port(8182).bindingMode(RestBindingMode.off); 16 | 17 | //root url 18 | rest("/simplerest") 19 | .consumes("application/json") // Consume JSON Only 20 | .produces("application/json") // Return JSON Only 21 | .get("/get").to("direct:get") //GET request 22 | .post("/post").to("direct:post"); //POST request 23 | 24 | from("direct:get") 25 | .transform().constant("Successful GET Request"); //returns a plain string payload 26 | 27 | from("direct:post")//returns no response data and logs the success of the request 28 | .log(LoggingLevel.INFO, "com.redhat.consulting.fusequickstarts.karaf.rest.dsl.route", "Successful POST Request") 29 | .setHeader(Exchange.HTTP_RESPONSE_CODE,simple("200")); 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /karaf/rest_secure/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/secure/processor/RequestProcessor.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.secure.processor; 2 | 3 | import java.util.Base64; 4 | 5 | import org.apache.camel.Exchange; 6 | import org.apache.camel.ExchangePattern; 7 | import org.apache.camel.Message; 8 | import org.apache.camel.Processor; 9 | import org.apache.camel.component.cxf.common.message.CxfConstants; 10 | import org.apache.cxf.message.MessageContentsList; 11 | 12 | public class RequestProcessor implements Processor { 13 | 14 | public void process(Exchange exchange) throws Exception { 15 | exchange.setPattern(ExchangePattern.InOut); 16 | Message inMessage = exchange.getIn(); 17 | 18 | // set the operation name 19 | inMessage.setHeader(CxfConstants.OPERATION_NAME, "getSampleUser"); 20 | 21 | // using the proxy client API 22 | inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, Boolean.FALSE); 23 | 24 | // request to client with parameters for basic auth 25 | String username = "admin"; 26 | String password = "admin"; 27 | String tokenString = username + ":" + password; 28 | String base64token = Base64.getEncoder().encodeToString(tokenString.getBytes()); 29 | inMessage.setHeader("Authorization", "Basic " + base64token); 30 | 31 | // creating the request 32 | MessageContentsList req = new MessageContentsList(); 33 | req.add(1); 34 | inMessage.setBody(req); 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /karaf/soap/src/main/java/com/redhat/consulting/fusequickstarts/karaf/soap/model/CustomerOrder.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.soap.model; 2 | 3 | /** 4 | * Basic Customer Order Object. 5 | */ 6 | public class CustomerOrder { 7 | 8 | private String item; 9 | private Integer quantity; 10 | private String orderId; 11 | 12 | /** 13 | * Get the item. 14 | * 15 | * @return the item 16 | */ 17 | public String getItem() { 18 | return this.item; 19 | } 20 | 21 | /** 22 | * Set the item. 23 | * 24 | * @param item 25 | * the item to set 26 | */ 27 | public void setItem(String item) { 28 | this.item = item; 29 | } 30 | 31 | /** 32 | * Get the quantity. 33 | * 34 | * @return the quantity 35 | */ 36 | public Integer getQuantity() { 37 | return this.quantity; 38 | } 39 | 40 | /** 41 | * Set the quantity. 42 | * 43 | * @param quantity 44 | * the quantity to set 45 | */ 46 | public void setQuantity(Integer quantity) { 47 | this.quantity = quantity; 48 | } 49 | 50 | /** 51 | * Get the orderId. 52 | * 53 | * @return the orderId 54 | */ 55 | public String getOrderId() { 56 | return this.orderId; 57 | } 58 | 59 | /** 60 | * Set the orderId. 61 | * 62 | * @param orderId 63 | * the orderId to set 64 | */ 65 | public void setOrderId(String orderId) { 66 | this.orderId = orderId; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /karaf/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.redhat.consulting.fusequickstarts.karaf 7 | karaf-main 8 | 7.6 9 | pom 10 | 11 | Fuse Quick Start :: Karaf :: Main 12 | Main POM for the Karaf Quick Starts. 13 | 14 | 15 | parent 16 | amq 17 | jpa_jta 18 | feature 19 | infinispan 20 | itests 21 | idempotent 22 | jms 23 | managed_service_factory 24 | osgi_ds 25 | osgi_service 26 | osgi_service_adv 27 | properties 28 | properties_encryption 29 | rest 30 | rest_beanvalidation 31 | rest_dsl 32 | rest_dsl_basic_auth 33 | rest_dsl_simple 34 | rest_secure 35 | route_deployment 36 | shared_component 37 | soap 38 | soap_client 39 | soap_contract_first 40 | soap_secure 41 | websocket 42 | 43 | 44 | -------------------------------------------------------------------------------- /eap/rest_dsl/src/main/java/com/redhat/consulting/fusequickstars/eap/rest/UsersBean.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstars.eap.rest; 2 | 3 | import javax.inject.Named; 4 | import javax.inject.Singleton; 5 | import java.util.ArrayList; 6 | 7 | /** 8 | * Users storage for testing the Rest CRUD functionality. 9 | * 10 | * It's basic, doesn't check duplicates id's and in case of update, updates the first found. 11 | * 12 | */ 13 | 14 | /** 15 | * @author lberetta 16 | * 17 | */ 18 | 19 | @Singleton 20 | @Named("usersBean") 21 | public class UsersBean { 22 | 23 | ArrayList users = new ArrayList(); 24 | 25 | public ArrayList getUsers() { 26 | return users; 27 | } 28 | 29 | public User getUser(Integer id) { 30 | for (User user:users) 31 | if (user.getId().equals(id)) 32 | return user; 33 | 34 | return null; 35 | } 36 | 37 | public User createUser(User user) { 38 | users.add(user); 39 | 40 | return user; 41 | } 42 | 43 | public User updateUser(User userToUpdate) { 44 | for (User user:users) 45 | if (user.getId().equals(userToUpdate.getId())) { 46 | user.setUsername(userToUpdate.getUsername()); 47 | 48 | return user; 49 | } 50 | 51 | return null; 52 | } 53 | 54 | public boolean deleteUser(Integer id) { 55 | for (User user:users) 56 | if (user.getId().equals(id)) { 57 | return users.remove(user); 58 | } 59 | 60 | return false; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /karaf/osgi_ds/osgi_ds_api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf.osgi_ds 8 | osgi-ds-parent 9 | 7.6 10 | 11 | 12 | Fuse Quick Start :: Karaf :: Blueprint :: OSGi Declarative Services :: API 13 | 14 | bundle 15 | 16 | 17 | 18 | 19 | org.apache.maven.plugins 20 | maven-compiler-plugin 21 | 22 | 23 | 24 | org.apache.felix 25 | maven-bundle-plugin 26 | true 27 | 28 | target/META-INF 29 | 30 | ${project.groupId}.${project.artifactId} 31 | 32 | 33 | com.redhat.consulting.fusequickstarts.karaf.osgi_ds.api 34 | 35 | 36 | 37 | 38 | 39 | 40 | osgi_ds_api 41 | 42 | -------------------------------------------------------------------------------- /karaf/shared_component/shared_amq/README.md: -------------------------------------------------------------------------------- 1 | Shared ActiveMQ Component 2 | ==================================== 3 | This bundle defines an instance of the ActiveMQ Camel Component and shared it as an OSGi service that can be consumed and used by other bundles. 4 | 5 | ### Requirements: 6 | * Red Hat Fuse 7.6.0 7 | * Maven 3.0 or Greater (http://maven.apache.org/) 8 | * Java 8 9 | 10 | Building 11 | ----------------------- 12 | To build the project. 13 | 14 | mvn clean install 15 | 16 | This will build the bundle including the manifest information. 17 | 18 | Deploying to Red Hat Fuse 19 | ----------------------- 20 | 21 | To start up Fuse browse to your fuse install directory. Then run 22 | 23 | /bin/fuse 24 | 25 | This will bring up the fuse console. Once in the console you will be able to install your bundle. Usually we would install multiple bundles using a feature file, but in this case since we only have one bundle to install we can just install it using the file by the following command. Another option is to set up your local m2 repository in fuse in the fuse/etc/org.ops4j.pax.url.mvn.cfg file. Then you can use the mvn syntax below. 26 | 27 | karaf@root> osgi:install -s file:/home/yourUser/.m2/repository/com/redhat/consulting/fusequickstarts/karaf/shared_component/shared_amq/7.6/shared_amq-7.6.jar 28 | OR 29 | karaf@root> osgi:install -s mvn:com.redhat.consulting.fusequickstarts.karaf.shared_component/shared_amq/7.6 30 | 31 | The -s here indicates to also start the bundle. Alternatively you can omit the -s and after the install run 32 | 33 | karaf@root> osgi:start 34 | 35 | -------------------------------------------------------------------------------- /karaf/jpa_jta/src/main/java/org/redhat/consulting/fusequickstarts/karaf/jpa/route/JpaRoutes.java: -------------------------------------------------------------------------------- 1 | package org.redhat.consulting.fusequickstarts.karaf.jpa.route; 2 | 3 | import org.redhat.consulting.fusequickstarts.karaf.jpa.model.Person; 4 | import org.apache.camel.builder.RouteBuilder; 5 | import org.redhat.consulting.fusequickstarts.karaf.jpa.processor.ExceptionProcessor; 6 | 7 | public class JpaRoutes extends RouteBuilder { 8 | 9 | @Override 10 | public void configure() throws Exception { 11 | from("timer://jpaTimer?fixedRate=true&period=5000&repeatCount=1") 12 | .routeId("Success Route") 13 | .transacted() 14 | .log(">>> Generating New Person") 15 | .setBody(constant(new Person(1, Person.generateName()))) 16 | .log(">>> Saving Person") 17 | .to("jpa://org.redhat.consulting.fusequickstarts.karaf.jpa.model.Person") 18 | .log(">>> Saved Person: ${body}!"); 19 | 20 | from("jpa://org.redhat.consulting.fusequickstarts.karaf.jpa.model.Person") 21 | .routeId("JPA Poll") 22 | .log("Retrieved Person: ${body}"); 23 | 24 | /*from("timer://jpaTimer?fixedRate=true&period=5000&repeatCount=1") 25 | .routeId("Failure Route") 26 | .transacted() 27 | .log(">>> Generating New Person") 28 | .setBody(constant(new Person(2, "Rolled_Back_" + Person.generateName()))) 29 | .log(">>> Saving Person") 30 | .to("jpa://org.redhat.consulting.fusequickstarts.karaf.jpa.model.Person") 31 | .log(">>> Saved Person: ${body}!") 32 | .beanRef("dummy","crash") 33 | .log(">>> Rolled back");*/ 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /karaf/properties_encryption/src/main/java/com/redhat/consulting/fusequickstarts/karaf/properties/encryption/route/EncryptedPropertiesRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.properties.encryption.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | 5 | public class EncryptedPropertiesRoute extends RouteBuilder { 6 | 7 | /** 8 | * Message that Will be overridden by the Injected Property that Jasypt Decrypts. 9 | */ 10 | String message = "You shouldnt see this"; 11 | 12 | /* 13 | * (non-Javadoc) 14 | * 15 | * @see org.apache.camel.builder.RouteBuilder#configure() 16 | */ 17 | @Override 18 | public void configure() throws Exception { 19 | 20 | // Logs Value of Property every 2000 milliseconds 21 | from("timer://myTimer?fixedRate=true&period=2000").routeId("encryptedPropertiesRoute") 22 | .setBody(simple("Displaying Injected Property 'message': " + message)) 23 | .to("log:EncryptedPropertiesLog?level=INFO") 24 | .setBody(simple("Reading Property 'test.message.enc': {{test.message.enc}}")) 25 | .to("log:EncryptedPropertiesLog?level=INFO"); 26 | 27 | } 28 | 29 | /** 30 | * Get the message. 31 | * 32 | * @return the message 33 | */ 34 | public String getMessage() { 35 | return this.message; 36 | } 37 | 38 | /** 39 | * Set the message. 40 | * 41 | * @param message 42 | * the message to set 43 | */ 44 | public void setMessage(String message) { 45 | this.message = message; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /karaf/rest_beanvalidation/src/main/java/com/redhat/consulting/fusequickstarts/karaf/rest/beanvalidation/processor/InvalidFiftyPercentOfTimesRequestProcessor.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.rest.beanvalidation.processor; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.ExchangePattern; 5 | import org.apache.camel.Message; 6 | import org.apache.camel.Processor; 7 | import org.apache.camel.component.cxf.common.message.CxfConstants; 8 | import org.apache.cxf.message.MessageContentsList; 9 | 10 | import java.util.Random; 11 | 12 | public class InvalidFiftyPercentOfTimesRequestProcessor implements Processor { 13 | 14 | public void process(Exchange exchange) throws Exception { 15 | 16 | Random r = new Random(); 17 | float chance = r.nextFloat(); 18 | 19 | exchange.setPattern(ExchangePattern.InOut); 20 | Message inMessage = exchange.getIn(); 21 | // set the operation name 22 | inMessage.setHeader(CxfConstants.OPERATION_NAME, "getSampleUser"); 23 | // using the proxy client API 24 | inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, Boolean.FALSE); 25 | // creating the request 26 | MessageContentsList req = new MessageContentsList(); 27 | 28 | if (chance <= 0.50f) { 29 | // setting id which doesn't start with 1 (i.e. not in pattern: regexp = "^1[0-9]*$") 30 | req.add("25"); 31 | } else { 32 | // setting id which start with one (i.e. pattern: regexp = "^1[0-9]*$") 33 | req.add("11"); 34 | } 35 | 36 | inMessage.setBody(req); 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /karaf/managed_service_factory/src/main/resources/OSGI-INF/blueprint/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /karaf/soap_client/src/main/java/com/redhat/consulting/fusequickstarts/karaf/soap_client/route/route/CxfClientRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.soap_client.route.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | import org.apache.camel.model.dataformat.SoapJaxbDataFormat; 5 | 6 | public class CxfClientRoute extends RouteBuilder{ 7 | 8 | private static final String ENDPOINT = "http://www.webservicex.net/CurrencyConvertor.asmx"; 9 | private static final String WSDL = "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL"; 10 | private static final String SERVICE_NAME = "{http://www.webserviceX.NET/}CurrencyConvertor"; 11 | private static final String ENDPOINT_NAME = "{http://www.webserviceX.NET/}CurrencyConvertorSoap"; 12 | 13 | @Override 14 | public void configure() throws Exception { 15 | 16 | SoapJaxbDataFormat jaxbDataFormat = new SoapJaxbDataFormat("net.webservicex"); 17 | 18 | // Process the Requests coming in to the Endpoint 19 | from("timer://soapClientTimer?fixedRate=true&period=5000&repeatCount=2") 20 | .setHeader("fromCurrency",simple("USD")) 21 | .setHeader("toCurrency",simple("EUR")) 22 | .bean(CurrencyConversionRequestFactory.class, "createNewRequest") 23 | .marshal(jaxbDataFormat) 24 | .log("Making SOAP Call: ${body}") 25 | //.to("cxf:bean:cxfClientEndpoint?dataFormat=MESSAGE") 26 | .to("cxf://" + ENDPOINT + "?dataFormat=MESSAGE&wsdlURL=" + WSDL + "&serviceName=" 27 | + SERVICE_NAME + "&portName=" + ENDPOINT_NAME) 28 | .log("SOAP Response: ${body}"); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /karaf/infinispan/remote-client/src/main/java/com/redhat/consulting/fusequickstarts/karaf/infinispan/RemoteClient.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.infinispan; 2 | 3 | import org.infinispan.client.hotrod.RemoteCacheManager; 4 | import org.infinispan.commons.api.BasicCacheContainer; 5 | 6 | public class RemoteClient { 7 | 8 | //private static final transient Logger LOG = LoggerFactory.getLogger(RemoteClient.class); 9 | 10 | private BasicCacheContainer cacheManager; 11 | private String host; 12 | 13 | public String getHost() { 14 | return host; 15 | } 16 | 17 | public void setHost(String host) { 18 | this.host = host; 19 | } 20 | 21 | public void start() { 22 | //LOG.info("Creating client"); 23 | //ConfigurationBuilder builder = new ConfigurationBuilder(); 24 | //builder.addServer().host("localhost"); 25 | //cacheManager = new RemoteCacheManager(builder.build()); 26 | cacheManager = new RemoteCacheManager("localhost", 11222); 27 | } 28 | 29 | public void stop() { 30 | if (cacheManager != null) { 31 | cacheManager.stop(); 32 | } 33 | } 34 | 35 | public Object process(String operation, String key, String value) { 36 | //LOG.info("Remote " + operation + " {} : {} ", key, value); 37 | if ("PUT".equals(operation)) { 38 | return cacheManager.getCache().put(key, value); 39 | } else if ("GET".equals(operation)) { 40 | return cacheManager.getCache().get(key); 41 | } else if ("DELETE".equals(operation)) { 42 | return cacheManager.getCache().remove(key); 43 | } else 44 | throw new UnsupportedOperationException(operation); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /karaf/soap_secure/src/main/resources/OSGI-INF/blueprint/camel-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | com.redhat.consulting.fusequickstarts.karaf.soap.secure 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /karaf/websocket/websocket_feature/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf.websocket 8 | websocket-parent 9 | 7.6 10 | 11 | 12 | websocket_feature 13 | Fuse Quick Start :: Karaf :: Blueprint :: Websocket :: Feature 14 | 15 | jar 16 | 17 | 18 | 19 | true 20 | src/main/resources 21 | 22 | 23 | 24 | 25 | org.codehaus.mojo 26 | build-helper-maven-plugin 27 | 1.5 28 | 29 | 30 | attach-artifacts 31 | 32 | attach-artifact 33 | 34 | package 35 | 36 | 37 | 38 | target/classes/features.xml 39 | xml 40 | features 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /karaf/feature/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf 8 | karaf-parent 9 | 7.6 10 | ../parent/pom.xml 11 | 12 | 13 | feature 14 | Fuse Quick Start :: Karaf :: Blueprint :: OSGI Feature 15 | 16 | jar 17 | 18 | 19 | 20 | true 21 | src/main/resources 22 | 23 | 24 | 25 | 26 | org.codehaus.mojo 27 | build-helper-maven-plugin 28 | 1.5 29 | 30 | 31 | attach-artifacts 32 | 33 | attach-artifact 34 | 35 | package 36 | 37 | 38 | 39 | target/classes/features.xml 40 | xml 41 | features 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /karaf/osgi_ds/osgi_ds_feature/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf.osgi_ds 8 | osgi-ds-parent 9 | 7.6 10 | 11 | 12 | osgi_ds_feature 13 | Fuse Quick Start :: Karaf :: Blueprint :: OSGi Declarative Services :: Feature 14 | 15 | jar 16 | 17 | 18 | 19 | true 20 | src/main/resources 21 | 22 | 23 | 24 | 25 | org.codehaus.mojo 26 | build-helper-maven-plugin 27 | 1.5 28 | 29 | 30 | attach-artifacts 31 | 32 | attach-artifact 33 | 34 | package 35 | 36 | 37 | 38 | target/classes/features.xml 39 | xml 40 | features 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /karaf/osgi_service/osgi_service_feature/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf.osgi_service 8 | osgi-service-parent 9 | 7.6 10 | 11 | 12 | osgi_service_feature 13 | Fuse Quick Start :: Karaf :: Blueprint :: OSGi Service :: Feature 14 | 15 | jar 16 | 17 | 18 | 19 | true 20 | src/main/resources 21 | 22 | 23 | 24 | 25 | org.codehaus.mojo 26 | build-helper-maven-plugin 27 | 1.5 28 | 29 | 30 | attach-artifacts 31 | 32 | attach-artifact 33 | 34 | package 35 | 36 | 37 | 38 | target/classes/features.xml 39 | xml 40 | features 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /spring-boot/soap_consumer_contract_first/src/main/java/com/redhat/consulting/fusequickstarts/springboot/soapconsumer/contractfirst/CommandExampleRoute.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.springboot.soapconsumer.contractfirst; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.builder.RouteBuilder; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class CommandExampleRoute extends RouteBuilder { 9 | 10 | @Override 11 | public void configure() { 12 | //@formatter:off 13 | from("cxf:bean:commandExampleWebService?dataFormat=POJO") 14 | .routeId("commandExampleEndpoint") 15 | .routeGroup("commandExample") 16 | .routeDescription("A route to handle incoming requests via the command-example SOAP WebService") 17 | .transform() 18 | .simple("${body[0]}") 19 | .choice() 20 | .when(simple("${header.operationName} == 'executeNow'")) 21 | .to("direct:commandExampleExecuteNow") 22 | .endChoice() 23 | .otherwise() 24 | .throwException(UnsupportedOperationException.class, "Unsupported SOAP operation: ${header.operationName}") 25 | .endChoice() 26 | .end() 27 | .removeHeaders("*", Exchange.BREADCRUMB_ID); 28 | 29 | from("direct:commandExampleExecuteNow") 30 | .routeId("commandExampleExecuteNow") 31 | .routeGroup("commandExample") 32 | .routeDescription("A route to handle the 'executeNow' operation from the command-example SOAP WebService") 33 | .log("Execution initiated.") 34 | .to("stub:direct:execute-command-now"); 35 | //@formatter:on 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /karaf/shared_component/shared_amq_feature/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | com.redhat.consulting.fusequickstarts.karaf.shared_component 8 | shared-component-parent 9 | 7.6 10 | 11 | 12 | shared_amq_feature 13 | Fuse Quick Start :: Karaf :: Blueprint :: Shared Component :: Shared AMQ Feature 14 | 15 | jar 16 | 17 | 18 | 19 | true 20 | src/main/resources 21 | 22 | 23 | 24 | 25 | org.codehaus.mojo 26 | build-helper-maven-plugin 27 | 1.5 28 | 29 | 30 | attach-artifacts 31 | 32 | attach-artifact 33 | 34 | package 35 | 36 | 37 | 38 | target/classes/features.xml 39 | xml 40 | features 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /karaf/amq/src/test/java/com/redhat/consulting/fusequickstarts/karaf/amq/route/ConsumerRouteTest.java: -------------------------------------------------------------------------------- 1 | package com.redhat.consulting.fusequickstarts.karaf.amq.route; 2 | 3 | import org.apache.camel.builder.RouteBuilder; 4 | import org.apache.camel.component.mock.MockEndpoint; 5 | import org.apache.camel.test.junit4.CamelTestSupport; 6 | import org.junit.Test; 7 | 8 | public class ConsumerRouteTest extends CamelTestSupport { 9 | 10 | /** 11 | * Mock all the Endpoints 12 | */ 13 | @Override 14 | public String isMockEndpoints() { 15 | return "*"; 16 | } 17 | 18 | /** 19 | * Create Routes 20 | */ 21 | @Override 22 | protected RouteBuilder createRouteBuilder() { 23 | return new ConsumerRoute(); 24 | } 25 | 26 | /** 27 | * Replace the incoming JMS URI with a Direct URI 28 | */ 29 | @Override 30 | public void setUp() throws Exception { 31 | replaceRouteFromWith("amqConsumer", "direct:amqTestQueue"); 32 | super.setUp(); 33 | } 34 | 35 | /** 36 | * Tests Message Consumer Route by replacing the jms component with a direct route, and then mocking the other endpoints to 37 | * assert that they received the proper messages. 38 | */ 39 | @Test 40 | public void testConsumeMessageRoute() throws Exception { 41 | // Get Mocks 42 | MockEndpoint logEndpoint = getMockEndpoint("mock:log:amqConsumerLog"); 43 | 44 | // Set Assertions 45 | logEndpoint.expectedMessageCount(1); 46 | logEndpoint.expectedBodiesReceived("Received Message: Test AMQ Message"); 47 | 48 | // Send Test Message to Endpoint that replaced the JMS Queue 49 | template.sendBody("direct:amqTestQueue", "Test AMQ Message"); 50 | 51 | // Set Mocks Satisfied 52 | logEndpoint.assertIsSatisfied(); 53 | } 54 | 55 | } 56 | --------------------------------------------------------------------------------