├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── bean-validation ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── validation │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ └── webapp │ └── WEB-INF │ └── web.xml ├── https ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── jaxrs │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ ├── config.yaml │ ├── keystore.jks │ └── webapp │ └── WEB-INF │ └── web.xml ├── jax-rs ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── jaxrs │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ └── webapp │ └── WEB-INF │ └── web.xml ├── jax-ws ├── jax-ws-cxf │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── jaxws │ │ │ └── cxf │ │ │ ├── CustomerEndpointBean.java │ │ │ ├── interceptors │ │ │ ├── WsHandler.java │ │ │ └── WsInterceptor.java │ │ │ └── service │ │ │ ├── CustomersService.java │ │ │ └── CustomersServiceBean.java │ │ └── resources │ │ ├── META-INF │ │ ├── beans.xml │ │ └── handler-chains.xml │ │ └── wsdls │ │ └── customers.wsdl ├── jax-ws-metro │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── jaxws │ │ │ └── metro │ │ │ ├── Customer.java │ │ │ ├── CustomerEndpoint.java │ │ │ ├── CustomersList.java │ │ │ ├── GetCustomersResponse.java │ │ │ └── GetCustomersResponseMessage.java │ │ └── resources │ │ └── webapp │ │ └── WEB-INF │ │ ├── sun-jaxws.xml │ │ └── web.xml └── pom.xml ├── jpa ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── jpa │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── CustomerService.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── persistence.xml │ ├── config.yaml │ └── webapp │ └── WEB-INF │ └── web.xml ├── jsf ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── jsf │ │ ├── Customer.java │ │ ├── CustomerBean.java │ │ └── Database.java │ └── resources │ └── webapp │ ├── WEB-INF │ └── web.xml │ ├── input.xhtml │ ├── list.xhtml │ └── welcome.xhtml ├── jsp ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── jsf │ │ ├── Customer.java │ │ ├── CustomerServlet.java │ │ └── Database.java │ └── resources │ └── webapp │ ├── WEB-INF │ └── web.xml │ ├── input.jsp │ ├── list.jsp │ └── welcome.jsp ├── jul ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── jul │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ ├── logging.properties │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-amqp-rabbitmq ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── amqp │ │ └── rabbitmq │ │ ├── api │ │ ├── QueueApplication.java │ │ ├── QueueResource.java │ │ └── RestMessage.java │ │ └── messaging │ │ ├── ConnectionInitializer.java │ │ ├── ExampleObject.java │ │ ├── MessageConsumer.java │ │ └── MessageProducer.java │ └── resources │ ├── META-INF │ └── beans.xml │ └── config.yml ├── kumuluzee-blog-samples ├── kumuluzee-kubernetes │ ├── README.md │ ├── customers │ │ ├── Dockerfile │ │ ├── customers-api │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── kumuluz │ │ │ │ │ └── ee │ │ │ │ │ └── samples │ │ │ │ │ └── tutorial │ │ │ │ │ └── customers │ │ │ │ │ └── api │ │ │ │ │ └── v1 │ │ │ │ │ ├── CustomerApplication.java │ │ │ │ │ ├── dtos │ │ │ │ │ └── Error.java │ │ │ │ │ ├── exceptionmappers │ │ │ │ │ └── NotFoundExceptionMapper.java │ │ │ │ │ ├── health │ │ │ │ │ └── OrderServiceHealthCheck.java │ │ │ │ │ ├── interceptors │ │ │ │ │ └── LogContextInterceptor.java │ │ │ │ │ ├── producers │ │ │ │ │ └── JacksonProducer.java │ │ │ │ │ └── resources │ │ │ │ │ ├── CustomersResource.java │ │ │ │ │ └── LoadResource.java │ │ │ │ └── resources │ │ │ │ ├── META-INF │ │ │ │ └── beans.xml │ │ │ │ ├── WEB-INF │ │ │ │ └── web.xml │ │ │ │ └── config.yaml │ │ ├── customers-business-logic │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── kumuluz │ │ │ │ │ └── ee │ │ │ │ │ └── samples │ │ │ │ │ └── tutorial │ │ │ │ │ └── customers │ │ │ │ │ └── cdi │ │ │ │ │ ├── CustomersBean.java │ │ │ │ │ └── configuration │ │ │ │ │ └── RestProperties.java │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── beans.xml │ │ ├── customers-persistence │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── kumuluz │ │ │ │ │ └── ee │ │ │ │ │ └── samples │ │ │ │ │ └── tutorial │ │ │ │ │ └── customers │ │ │ │ │ └── Customer.java │ │ │ │ └── resources │ │ │ │ ├── META-INF │ │ │ │ └── persistence.xml │ │ │ │ └── sql-scripts │ │ │ │ └── init-customers.sql │ │ └── pom.xml │ ├── kubernetes-discovery_config-part1 │ │ ├── customer-cm.yaml │ │ ├── customer-deployment.yaml │ │ ├── customer-service.yaml │ │ ├── etcd.yaml │ │ ├── order-cm.yaml │ │ ├── order-deployment.yaml │ │ ├── order-service.yaml │ │ ├── postgres-customers.yaml │ │ └── postgres-orders.yaml │ ├── kubernetes-health_hpa-part2 │ │ ├── customer-cm.yaml │ │ ├── customer-deployment.yaml │ │ ├── customer-service.yaml │ │ ├── etcd.yaml │ │ ├── order-cm.yaml │ │ ├── order-deployment.yaml │ │ ├── order-hpa.yaml │ │ ├── order-service.yaml │ │ ├── postgres-customers.yaml │ │ └── postgres-orders.yaml │ ├── orders │ │ ├── Dockerfile │ │ ├── orders-api │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── kumuluz │ │ │ │ │ └── ee │ │ │ │ │ └── samples │ │ │ │ │ └── tutorial │ │ │ │ │ └── orders │ │ │ │ │ └── api │ │ │ │ │ └── v1 │ │ │ │ │ ├── OrdersApplication.java │ │ │ │ │ ├── dtos │ │ │ │ │ └── Error.java │ │ │ │ │ ├── exceptionmappers │ │ │ │ │ └── NotFoundExceptionMapper.java │ │ │ │ │ ├── health │ │ │ │ │ ├── HealthManagementDemo.java │ │ │ │ │ └── OrderServiceHealthCheck.java │ │ │ │ │ ├── producers │ │ │ │ │ └── JacksonProducer.java │ │ │ │ │ └── resources │ │ │ │ │ ├── LoadResource.java │ │ │ │ │ ├── ManagementResource.java │ │ │ │ │ └── OrdersResource.java │ │ │ │ └── resources │ │ │ │ ├── META-INF │ │ │ │ └── beans.xml │ │ │ │ ├── WEB-INF │ │ │ │ └── web.xml │ │ │ │ └── config.yaml │ │ ├── orders-business-logic │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── kumuluz │ │ │ │ │ └── ee │ │ │ │ │ └── samples │ │ │ │ │ └── tutorial │ │ │ │ │ └── orders │ │ │ │ │ └── cdi │ │ │ │ │ └── OrdersBean.java │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── beans.xml │ │ ├── orders-persistence │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── kumuluz │ │ │ │ │ └── ee │ │ │ │ │ └── samples │ │ │ │ │ └── tutorial │ │ │ │ │ └── orders │ │ │ │ │ └── Order.java │ │ │ │ └── resources │ │ │ │ ├── META-INF │ │ │ │ └── persistence.xml │ │ │ │ └── sql-scripts │ │ │ │ └── init-orders.sql │ │ └── pom.xml │ └── pom.xml └── pom.xml ├── kumuluzee-config-consul ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluz_config_consul │ │ ├── ConfigApplication.java │ │ ├── ConfigProperties.java │ │ ├── ConfigResource.java │ │ ├── ConfigurationEventHandler.java │ │ └── CustomConfigurationDecoder.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── services │ │ └── com.kumuluz.ee.configuration.ConfigurationDecoder │ ├── config.yaml │ └── webapp │ └── index.html ├── kumuluzee-config-etcd ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluz_config_etcd │ │ ├── ConfigApplication.java │ │ ├── ConfigProperties.java │ │ ├── ConfigResource.java │ │ ├── ConfigurationEventHandler.java │ │ └── CustomConfigurationDecoder.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── services │ │ └── com.kumuluz.ee.configuration.ConfigurationDecoder │ ├── config.yaml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-config-mp ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ ├── ConfigApplication.java │ │ ├── ConfigResource.java │ │ ├── configsources │ │ ├── ExampleConfigSource.java │ │ └── ExampleConfigSourceProvider.java │ │ ├── converters │ │ └── CustomerConverter.java │ │ └── models │ │ └── Customer.java │ └── resources │ └── META-INF │ ├── beans.xml │ ├── microprofile-config.properties │ └── services │ ├── org.eclipse.microprofile.config.spi.ConfigSource │ ├── org.eclipse.microprofile.config.spi.ConfigSourceProvider │ └── org.eclipse.microprofile.config.spi.Converter ├── kumuluzee-config-zookeeper ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluz_config_etcd │ │ ├── ConfigApplication.java │ │ ├── ConfigProperties.java │ │ ├── ConfigResource.java │ │ ├── ConfigurationEventHandler.java │ │ └── CustomConfigurationDecoder.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── services │ │ └── com.kumuluz.ee.configuration.ConfigurationDecoder │ ├── config.yaml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-config ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluz_config │ │ ├── ConfigApplication.java │ │ ├── ConfigProperties.java │ │ ├── ConfigResource.java │ │ └── CustomConfigurationDecoder.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── services │ │ └── com.kumuluz.ee.configuration.ConfigurationDecoder │ ├── config.yaml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-cors ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── cors │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── CustomerServlet.java │ └── resources │ ├── config.yaml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-database-schema-migrations-liquibase ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluzee_database_schema_migrations_liquibase │ │ ├── Book.java │ │ ├── BookApplication.java │ │ ├── BookResource.java │ │ ├── BookService.java │ │ ├── LiquibaseResource.java │ │ └── LiquibaseService.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── persistence.xml │ ├── config.yml │ └── db │ └── books-changelog.xml ├── kumuluzee-discovery-consul ├── README.md ├── discovery-consul-discover-jaxrs │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── discovery │ │ │ └── discover │ │ │ └── jaxrs │ │ │ ├── Customer.java │ │ │ ├── DiscoverApplication.java │ │ │ ├── DiscoverResource.java │ │ │ ├── ProgrammaticDiscoveryResource.java │ │ │ └── ProxiedResponse.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── config.yml │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml ├── discovery-consul-discover-servlet │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── discovery │ │ │ └── discover │ │ │ └── servlet │ │ │ └── DiscoverServlet.java │ │ └── resources │ │ ├── config.yml │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml ├── discovery-consul-register │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com.kumuluz.ee.samples.discovery.register │ │ │ ├── Customer.java │ │ │ ├── CustomerApplication.java │ │ │ ├── CustomerResource.java │ │ │ └── Database.java │ │ └── resources │ │ ├── config.yml │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml └── pom.xml ├── kumuluzee-discovery-etcd ├── README.md ├── discovery-etcd-discover-jaxrs │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── discovery │ │ │ └── discover │ │ │ └── jaxrs │ │ │ ├── Customer.java │ │ │ ├── DiscoverApplication.java │ │ │ ├── DiscoverResource.java │ │ │ ├── ProgrammaticDiscoveryResource.java │ │ │ └── ProxiedResponse.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── config.yml │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml ├── discovery-etcd-discover-servlet │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── discovery │ │ │ └── discover │ │ │ └── servlet │ │ │ └── DiscoverServlet.java │ │ └── resources │ │ ├── config.yml │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml ├── discovery-etcd-kubernetes │ ├── README.md │ ├── discover-deployment.yaml │ ├── discover-service.yaml │ ├── etcd.yaml │ └── register-deployment.yaml ├── discovery-etcd-register │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com.kumuluz.ee.samples.discovery.register │ │ │ ├── Customer.java │ │ │ ├── CustomerApplication.java │ │ │ ├── CustomerResource.java │ │ │ └── Database.java │ │ └── resources │ │ ├── config.yml │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml └── pom.xml ├── kumuluzee-ethereum-web3j ├── README.md ├── pom.xml ├── src │ └── main │ │ ├── java │ │ ├── com │ │ │ └── kumuluz │ │ │ │ └── ee │ │ │ │ └── samples │ │ │ │ └── ethereum │ │ │ │ ├── EthereumApplication.java │ │ │ │ ├── EventsEndpoint.java │ │ │ │ ├── entities │ │ │ │ ├── Customer.java │ │ │ │ └── Transaction.java │ │ │ │ └── services │ │ │ │ └── CustomerService.java │ │ └── contracts │ │ │ ├── Owned.java │ │ │ ├── SafeMath.java │ │ │ └── SampleToken.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── SAMPLEToken.sol │ │ └── config.yaml └── wallet-sample-ebe82f9ac91697e8a81f4f3a30fcaf499ef65993.json ├── kumuluzee-fault-tolerance ├── README.md ├── common │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── circuit_breaker_hystrix │ │ ├── database │ │ └── Database.java │ │ └── models │ │ ├── Customer.java │ │ └── Order.java ├── customer-api │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── circuit_breaker_hystrix │ │ │ └── customer │ │ │ ├── CustomerApplication.java │ │ │ ├── beans │ │ │ └── OrdersBean.java │ │ │ ├── producers │ │ │ └── HttpClientProducer.java │ │ │ └── resources │ │ │ └── CustomerResource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ └── config.yaml ├── order-api │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── circuit_breaker_hystrix │ │ │ └── order │ │ │ ├── OrderApplication.java │ │ │ └── resources │ │ │ └── OrderResource.java │ │ └── resources │ │ └── config.yml └── pom.xml ├── kumuluzee-feature-flags-unleash ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ ├── api │ │ ├── RestApplication.java │ │ └── RestResource.java │ │ └── unleash │ │ └── connection │ │ └── UnleashConnection.java │ └── resources │ ├── META-INF │ └── beans.xml │ └── config.yml ├── kumuluzee-graphql-advanced ├── .gitignore ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── graphql_advanced │ │ ├── beans │ │ ├── AssistantBean.java │ │ ├── LecturerBean.java │ │ ├── StudentBean.java │ │ └── SubjectBean.java │ │ ├── dtos │ │ ├── AssignmentResult.java │ │ └── Subject.java │ │ ├── entities │ │ ├── Assistant.java │ │ ├── Lecturer.java │ │ ├── Person.java │ │ ├── Student.java │ │ └── connections │ │ │ ├── ConnectionBase.java │ │ │ ├── LecturerConnection.java │ │ │ ├── StudentConnection.java │ │ │ └── SubjectConnection.java │ │ ├── enums │ │ └── LecturerStatus.java │ │ ├── graphql │ │ ├── AssistantResolvers.java │ │ ├── LecturerResolvers.java │ │ ├── StudentResolvers.java │ │ └── SubjectResolvers.java │ │ └── utils │ │ └── ApplicationDefaults.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── persistence.xml │ ├── config.yaml │ └── sql-scripts │ └── init-db.sql ├── kumuluzee-graphql-jpa-security ├── .gitignore ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── graphql_security │ │ ├── Customer.java │ │ ├── CustomerApp.java │ │ ├── CustomerResource.java │ │ └── CustomerService.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── persistence.xml │ └── config.yaml ├── kumuluzee-graphql-jpa-simple ├── .gitignore ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── graphql_simple │ │ ├── Customer.java │ │ ├── CustomerResource.java │ │ └── CustomerService.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── persistence.xml │ └── config.yaml ├── kumuluzee-grpc ├── README.md ├── grpc-client │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── Example.java │ │ └── client │ │ │ └── UserServiceClient.java │ │ ├── proto │ │ └── user_service.proto │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ └── config.yml ├── grpc-server │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── beans │ │ │ └── UserBean.java │ │ ├── entity │ │ │ └── User.java │ │ └── grpc │ │ │ ├── UserServiceImpl.java │ │ │ └── interceptors │ │ │ ├── HeaderInterceptor.java │ │ │ └── HeaderInterceptor2.java │ │ ├── proto │ │ └── user_service.proto │ │ └── resources │ │ ├── META-INF │ │ ├── beans.xml │ │ └── persistence.xml │ │ ├── config.yml │ │ └── sql-script │ │ └── init-db.sql └── pom.xml ├── kumuluzee-health ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── health │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ ├── CustomerService.java │ │ └── GithubHealthCheckBean.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── persistence.xml │ ├── config.yaml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-jcache ├── README.md ├── pom.xml ├── postman │ └── kumuluzee-jcache sample.postman_collection.json └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── jcache │ │ └── rest │ │ ├── InvoicesResource.java │ │ ├── RestApplication.java │ │ ├── lib │ │ └── InvoiceData.java │ │ ├── listeners │ │ └── MyCacheListener.java │ │ ├── producers │ │ ├── CacheProducer.java │ │ ├── DefaultCache.java │ │ └── MyCache.java │ │ └── services │ │ ├── InvoiceService.java │ │ └── impl │ │ └── InvoiceServiceImpl.java │ └── resources │ ├── META-INF │ └── beans.xml │ ├── config.yaml │ ├── log4j2.xml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-logs-fluentd ├── Customers.conf ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluzee_logs │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ ├── META-INF │ └── beans.xml │ └── config.yaml ├── kumuluzee-logs-jul ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluzee_logs │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ ├── logging.properties │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-logs-log4j2 ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluzee_logs │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ ├── config.yaml │ ├── log4j2.xml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-metrics ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluzee_metrics │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ ├── META-INF │ └── beans.xml │ └── config.yaml ├── kumuluzee-microProfile-1.2 ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluzee_microProfile_12 │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ ├── Database.java │ │ └── health │ │ └── ServiceHealthCheck.java │ └── resources │ ├── META-INF │ └── beans.xml │ └── config.yaml ├── kumuluzee-openapi-mp ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── openapi │ │ ├── Customer.java │ │ ├── Membership.java │ │ └── v2 │ │ ├── CustomerApplication.java │ │ └── CustomerResource.java │ └── resources │ ├── config.yaml │ └── log4j2.xml ├── kumuluzee-openapi ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── openapi │ │ ├── Customer.java │ │ └── v2 │ │ ├── CustomerApplication.java │ │ └── CustomerResource.java │ └── resources │ └── config.yaml ├── kumuluzee-opentracing-tutorial ├── README.md ├── alpha │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── opentracing │ │ │ └── tutorial │ │ │ └── alpha │ │ │ ├── Application.java │ │ │ └── Resource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ └── config.yaml ├── beta │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── opentracing │ │ │ └── tutorial │ │ │ └── beta │ │ │ ├── Application.java │ │ │ └── Resource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ └── config.yaml ├── delta │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── opentracing │ │ │ └── tutorial │ │ │ └── delta │ │ │ ├── Application.java │ │ │ └── Resource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ └── config.yaml ├── diagram.png ├── gamma │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── opentracing │ │ │ └── tutorial │ │ │ └── gamma │ │ │ ├── Application.java │ │ │ ├── Database.java │ │ │ └── Resource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ └── config.yaml ├── master │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── opentracing │ │ │ └── tutorial │ │ │ └── master │ │ │ ├── Application.java │ │ │ └── Resource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ └── config.yaml └── pom.xml ├── kumuluzee-opentracing ├── README.md ├── customers │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── opentracing │ │ │ └── customers │ │ │ ├── Customer.java │ │ │ ├── CustomerApplication.java │ │ │ ├── CustomerResource.java │ │ │ ├── CustomersBean.java │ │ │ └── Database.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ └── config.yaml ├── orders │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── opentracing │ │ │ └── orders │ │ │ ├── Database.java │ │ │ ├── Order.java │ │ │ ├── OrderApplication.java │ │ │ └── OrderResource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ └── config.yaml └── pom.xml ├── kumuluzee-reactive-vertx ├── README.md ├── kumuluzee-reactive-vertx-bridge │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── reactive │ │ │ └── vertx │ │ │ ├── VertxApplication.java │ │ │ └── VertxResource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── WEB-INF │ │ └── web.xml │ │ └── config.yml ├── kumuluzee-reactive-vertx-listener │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── reactive │ │ │ └── vertx │ │ │ ├── VertxApplication.java │ │ │ ├── VertxEventListener.java │ │ │ └── VertxResource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── WEB-INF │ │ └── web.xml │ │ └── config.yml ├── kumuluzee-reactive-vertx-publisher │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── reactive │ │ │ └── vertx │ │ │ ├── Message.java │ │ │ ├── VertxApplication.java │ │ │ └── VertxResource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── WEB-INF │ │ └── web.xml │ │ └── config.yml ├── pom.xml └── simple-verticles │ ├── README.md │ ├── pom.xml │ ├── verticle-discovery │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── reactive │ │ └── vertx │ │ └── DiscoveryVerticle.java │ ├── verticle-listener │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── reactive │ │ └── vertx │ │ └── ListenerVerticle.java │ └── verticle-publisher │ ├── README.md │ ├── pom.xml │ └── src │ └── main │ └── java │ └── com │ └── kumuluz │ └── ee │ └── samples │ └── reactive │ └── vertx │ └── PublisherVerticle.java ├── kumuluzee-rest-client ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluzee_rest_client │ │ ├── api │ │ ├── CustomerApi.java │ │ └── SensitiveDataResponseMapper.java │ │ ├── entities │ │ └── Customer.java │ │ ├── exceptions │ │ └── SensitiveDataException.java │ │ └── rest │ │ ├── RestApplication.java │ │ └── RestResource.java │ └── resources │ ├── META-INF │ └── beans.xml │ └── config.yml ├── kumuluzee-rest ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── rest │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── CustomerService.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── persistence.xml │ ├── config.yaml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-security-cdi-keycloak ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluzee_security_keycloak │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ ├── META-INF │ └── beans.xml │ ├── config.yml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-security-keycloak ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── kumuluzee_security_keycloak │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ ├── config.yml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-streaming-kafka-registry ├── .gitignore ├── README.md ├── docker-compose.yaml ├── kumuluzee-streaming-kafka-registry-consumer │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── generated │ │ └── java │ │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── kafka │ │ │ └── registry │ │ │ └── avro │ │ │ └── lib │ │ │ └── Pricing.java │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── kafka │ │ │ └── registry │ │ │ └── consumer │ │ │ ├── ConsumerApplication.java │ │ │ ├── ConsumerResource.java │ │ │ └── TestConsumer.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── config.yml │ │ ├── log4j2.xml │ │ └── schemas │ │ └── avro │ │ └── pricing-avro-value.avsc ├── kumuluzee-streaming-kafka-registry-producer │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── generated │ │ └── java │ │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── kafka │ │ │ └── registry │ │ │ └── avro │ │ │ └── lib │ │ │ └── Pricing.java │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── kafka │ │ │ └── registry │ │ │ └── producer │ │ │ ├── Input.java │ │ │ ├── ProducerApplication.java │ │ │ └── ProducerResource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── config.yml │ │ ├── log4j2.xml │ │ └── schemas │ │ └── avro │ │ ├── v1.0.0 │ │ └── pricing.avsc │ │ └── v2.0.0 │ │ └── pricing.avsc ├── kumuluzee-streaming-kafka-registry-streams │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── generated │ │ └── java │ │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── kafka │ │ │ └── registry │ │ │ └── avro │ │ │ └── lib │ │ │ ├── Pricing.java │ │ │ └── Sum.java │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── kafka │ │ │ └── registry │ │ │ └── streams │ │ │ ├── BigDecimalDeserializer.java │ │ │ ├── BigDecimalSerde.java │ │ │ ├── BigDecimalSerializer.java │ │ │ ├── GenericConfig.java │ │ │ ├── SumStreamsBuilder.java │ │ │ └── SumStreamsControl.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── config.yml │ │ ├── log4j2.xml │ │ └── schemas │ │ └── avro │ │ ├── pricing-avro-value.avsc │ │ └── sum.avsc └── pom.xml ├── kumuluzee-streaming-kafka ├── README.md ├── kumuluzee-streaming-kafka-consumer │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── kafka │ │ │ └── consumer │ │ │ ├── ConsumerApplication.java │ │ │ ├── ConsumerResource.java │ │ │ └── TestConsumer.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── config.yml │ │ └── log4j2.xml ├── kumuluzee-streaming-kafka-producer │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── kafka │ │ │ └── producer │ │ │ ├── Message.java │ │ │ ├── ProducerApplication.java │ │ │ └── ProducerResource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── config.yml │ │ └── log4j2.xml ├── kumuluzee-streaming-kafka-streams │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── kafka │ │ │ └── streams │ │ │ ├── WordCountStreamsBuilder.java │ │ │ └── WordCountStreamsControl.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── config.yml │ │ └── log4j2.xml └── pom.xml ├── kumuluzee-swagger ├── Dockerfile ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── swagger │ │ └── v1 │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ └── CustomerResource.java │ └── resources │ ├── META-INF │ └── beans.xml │ ├── config.yaml │ └── webapp │ └── WEB-INF │ └── web.xml ├── kumuluzee-version ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── jaxrs │ │ ├── Customer.java │ │ ├── CustomerApplication.java │ │ ├── CustomerResource.java │ │ └── Database.java │ └── resources │ ├── VERSION.json │ └── config.yaml ├── microservices-simple ├── README.md ├── catalogue │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── microservices │ │ │ └── simple │ │ │ ├── BooksResource.java │ │ │ └── CatalogueApplication.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── config.yaml │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml ├── models │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── microservices │ │ │ └── simple │ │ │ └── models │ │ │ ├── Book.java │ │ │ └── Order.java │ │ └── resources │ │ └── META-INF │ │ └── persistence.xml ├── orders │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── kumuluz │ │ │ └── ee │ │ │ └── samples │ │ │ └── microservices │ │ │ └── simple │ │ │ ├── OrdersApplication.java │ │ │ ├── OrdersProperties.java │ │ │ └── OrdersResource.java │ │ └── resources │ │ ├── META-INF │ │ └── beans.xml │ │ ├── config.yaml │ │ └── webapp │ │ └── WEB-INF │ │ └── web.xml └── pom.xml ├── pom.xml ├── servlet ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── kumuluz │ │ └── ee │ │ └── samples │ │ └── servlet │ │ ├── Customer.java │ │ ├── CustomerServlet.java │ │ └── Database.java │ └── resources │ └── webapp │ └── WEB-INF │ └── web.xml ├── tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security ├── README.md ├── customers │ ├── Dockerfile │ ├── customers-api │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kumuluz │ │ │ │ └── ee │ │ │ │ └── samples │ │ │ │ └── tutorial │ │ │ │ └── customers │ │ │ │ └── api │ │ │ │ └── v1 │ │ │ │ ├── CustomerApplication.java │ │ │ │ ├── dtos │ │ │ │ └── Error.java │ │ │ │ ├── exceptionmappers │ │ │ │ └── NotFoundExceptionMapper.java │ │ │ │ ├── interceptors │ │ │ │ └── LogContextInterceptor.java │ │ │ │ ├── producers │ │ │ │ └── JacksonProducer.java │ │ │ │ └── resources │ │ │ │ └── CustomersResource.java │ │ │ └── resources │ │ │ ├── META-INF │ │ │ └── beans.xml │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── config.yaml │ ├── customers-business-logic │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kumuluz │ │ │ │ └── ee │ │ │ │ └── samples │ │ │ │ └── tutorial │ │ │ │ └── customers │ │ │ │ └── cdi │ │ │ │ ├── CustomersBean.java │ │ │ │ └── configuration │ │ │ │ └── RestProperties.java │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── beans.xml │ ├── customers-persistence │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kumuluz │ │ │ │ └── ee │ │ │ │ └── samples │ │ │ │ └── tutorial │ │ │ │ └── customers │ │ │ │ └── Customer.java │ │ │ └── resources │ │ │ ├── META-INF │ │ │ └── persistence.xml │ │ │ └── sql-scripts │ │ │ └── init-customers.sql │ ├── docker-compose.yml │ └── pom.xml ├── orders │ ├── orders-api │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kumuluz │ │ │ │ └── ee │ │ │ │ └── samples │ │ │ │ └── tutorial │ │ │ │ └── orders │ │ │ │ └── api │ │ │ │ └── v1 │ │ │ │ ├── OrdersApplication.java │ │ │ │ ├── dtos │ │ │ │ └── Error.java │ │ │ │ ├── exceptionmappers │ │ │ │ └── NotFoundExceptionMapper.java │ │ │ │ ├── producers │ │ │ │ └── JacksonProducer.java │ │ │ │ └── resources │ │ │ │ └── OrdersResource.java │ │ │ └── resources │ │ │ ├── META-INF │ │ │ └── beans.xml │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── config.yaml │ ├── orders-business-logic │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kumuluz │ │ │ │ └── ee │ │ │ │ └── samples │ │ │ │ └── tutorial │ │ │ │ └── orders │ │ │ │ └── cdi │ │ │ │ └── OrdersBean.java │ │ │ └── resources │ │ │ └── META-INF │ │ │ └── beans.xml │ ├── orders-persistence │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kumuluz │ │ │ │ └── ee │ │ │ │ └── samples │ │ │ │ └── tutorial │ │ │ │ └── orders │ │ │ │ └── Order.java │ │ │ └── resources │ │ │ ├── META-INF │ │ │ └── persistence.xml │ │ │ └── sql-scripts │ │ │ └── init-orders.sql │ └── pom.xml └── pom.xml └── websocket ├── README.md ├── pom.xml └── src └── main ├── java └── com │ └── kumuluz │ └── ee │ └── samples │ └── websocket │ └── CustomerEndpoint.java └── resources └── webapp ├── index.html └── websocket.js /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Sunesis, Ltd. and/or its affiliates 4 | and other contributors as indicated by the @author tags and 5 | the contributor list. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. -------------------------------------------------------------------------------- /bean-validation/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /https/src/main/java/jaxrs/CustomerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2017 Kumuluz and/or its affiliates 3 | * and other contributors as indicated by the @author tags and 4 | * the contributor list. 5 | * 6 | * Licensed under the MIT License (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * https://opensource.org/licenses/MIT 11 | * 12 | * The software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, express or 13 | * implied, including but not limited to the warranties of merchantability, 14 | * fitness for a particular purpose and noninfringement. in no event shall the 15 | * authors or copyright holders be liable for any claim, damages or other 16 | * liability, whether in an action of contract, tort or otherwise, arising from, 17 | * out of or in connection with the software or the use or other dealings in the 18 | * software. See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | package jaxrs; 22 | 23 | import javax.ws.rs.ApplicationPath; 24 | import javax.ws.rs.core.Application; 25 | 26 | /** 27 | * @author Benjamin Kastelic 28 | * @since 2.3.0 29 | */ 30 | @ApplicationPath("v1") 31 | public class CustomerApplication extends Application { 32 | } 33 | -------------------------------------------------------------------------------- /https/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | # example HTTPS configuration 2 | 3 | kumuluzee: 4 | server: 5 | https: 6 | enabled: true 7 | keystore-path: \/src/main/resources/keystore.jks 8 | keystore-password: changeit 9 | key-password: changeit -------------------------------------------------------------------------------- /https/src/main/resources/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumuluz/kumuluzee-samples/ecd51a3c87d587ef0f11403311dc6e4f4d2aa308/https/src/main/resources/keystore.jks -------------------------------------------------------------------------------- /https/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /jax-rs/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /jax-ws/jax-ws-cxf/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /jax-ws/jax-ws-cxf/src/main/resources/META-INF/handler-chains.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.kumuluz.ee.samples.jaxws.cxf.interceptors.WsHandler 6 | 7 | 8 | -------------------------------------------------------------------------------- /jax-ws/jax-ws-metro/src/main/resources/webapp/WEB-INF/sun-jaxws.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | -------------------------------------------------------------------------------- /jax-ws/jax-ws-metro/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /jax-ws/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-samples 7 | com.kumuluz.ee.samples 8 | 3.13.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | jax-ws 13 | pom 14 | 15 | KumuluzEE JAX-WS sample 16 | JAX-WS usage sample with KumuluzEE 17 | 18 | 19 | jax-ws-metro 20 | jax-ws-cxf 21 | 22 | 23 | -------------------------------------------------------------------------------- /jpa/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /jpa/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | jdbc/CustomersDS 10 | 11 | com.kumuluz.ee.samples.jpa.Customer 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | jdbc/FailedCustomersDS 24 | 25 | 26 | -------------------------------------------------------------------------------- /jpa/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | datasources: 3 | - jndi-name: jdbc/CustomersDS 4 | connection-url: jdbc:postgresql://localhost:5432/customers 5 | username: postgres 6 | password: postgres 7 | pool: 8 | max-size: 2 9 | - jndi-name: jdbc/FailedCustomersDS 10 | connection-url: jdbc:postgresql://localhost:55432/some-nonexisting-database 11 | username: postgres 12 | password: postgres 13 | continue-on-error: true 14 | pool: 15 | max-size: 2 16 | persistence-units: 17 | - name: "kumuluzee-samples-jpa" 18 | continue-on-error: false 19 | - name: "kumuluzee-samples-jpa-failed" 20 | continue-on-error: true -------------------------------------------------------------------------------- /jpa/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /jul/src/main/resources/logging.properties: -------------------------------------------------------------------------------- 1 | # Default global logging level 2 | .level=INFO 3 | 4 | # ConsoleHandler definition 5 | handlers=java.util.logging.ConsoleHandler 6 | 7 | # ConsoleHandler configuration settings 8 | java.util.logging.ConsoleHandler.level=INFO 9 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter -------------------------------------------------------------------------------- /jul/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-amqp-rabbitmq/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-amqp-rabbitmq/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | amqp: 3 | rabbitmq: 4 | hosts: 5 | - name: MQtest 6 | url: localhost 7 | username: guest 8 | password: guest 9 | exchanges: 10 | - name: directExchange 11 | type: direct 12 | - name: MQtest2 13 | queues: 14 | - name: testQueue 15 | properties: 16 | - name: testProperty 17 | headers: 18 | title: text 19 | timestamp: true -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/README.md: -------------------------------------------------------------------------------- 1 | # KumuluzEE microservices on Kubernetes 2 | 3 | This example contains two cloud-native Java EE microservice applications, implemented using KumuluzEE 4 | microservice framework, and demonstrates how to deploy them to Kubernetes cluster. 5 | 6 | Implemented microservices: 7 | * **customers** - managing customer entities, and 8 | * **orders** - managing order entities 9 | 10 | Both microservices are implemented following cloud-native concepts and functionalities that are essential in microservice architecture, such as configuration management with MicroProfile API and service discovery. 11 | 12 | This example was used in the blog posts [Running KumuluzEE microservices on Kubernetes](https://blog.kumuluz.com/kumuluzee/kubernetes/2017/12/03/kumuluzee-microservices-on-kubernetes_part1). 13 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jre-alpine 2 | 3 | RUN mkdir /app 4 | 5 | WORKDIR /app 6 | 7 | ADD ./customers-api/target/customers-api-1.0.0-SNAPSHOT.jar /app 8 | 9 | EXPOSE 8080 10 | 11 | CMD ["java", "-jar", "customers-api-1.0.0-SNAPSHOT.jar"] 12 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-api/src/main/java/com/kumuluz/ee/samples/tutorial/customers/api/v1/CustomerApplication.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.api.v1; 2 | 3 | import javax.annotation.security.DeclareRoles; 4 | import javax.ws.rs.ApplicationPath; 5 | import javax.ws.rs.core.Application; 6 | 7 | @ApplicationPath("/v1") 8 | @DeclareRoles({"user", "admin"}) 9 | public class CustomerApplication extends Application { 10 | } 11 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-api/src/main/java/com/kumuluz/ee/samples/tutorial/customers/api/v1/dtos/Error.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.api.v1.dtos; 2 | 3 | public class Error { 4 | 5 | private Integer status; 6 | private String code; 7 | private String message; 8 | 9 | public Integer getStatus() { 10 | return status; 11 | } 12 | 13 | public void setStatus(Integer status) { 14 | this.status = status; 15 | } 16 | 17 | public String getCode() { 18 | return code; 19 | } 20 | 21 | public void setCode(String code) { 22 | this.code = code; 23 | } 24 | 25 | public String getMessage() { 26 | return message; 27 | } 28 | 29 | public void setMessage(String message) { 30 | this.message = message; 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-api/src/main/java/com/kumuluz/ee/samples/tutorial/customers/api/v1/exceptionmappers/NotFoundExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.api.v1.exceptionmappers; 2 | 3 | 4 | import com.kumuluz.ee.samples.tutorial.customers.api.v1.dtos.Error; 5 | 6 | import javax.enterprise.context.ApplicationScoped; 7 | import javax.ws.rs.NotFoundException; 8 | import javax.ws.rs.core.Response; 9 | import javax.ws.rs.ext.ExceptionMapper; 10 | import javax.ws.rs.ext.Provider; 11 | 12 | @Provider 13 | @ApplicationScoped 14 | public class NotFoundExceptionMapper implements ExceptionMapper { 15 | 16 | @Override 17 | public Response toResponse(NotFoundException e) { 18 | 19 | Error error = new Error(); 20 | error.setStatus(404); 21 | error.setCode("resource.not.found"); 22 | error.setMessage(e.getMessage()); 23 | 24 | return Response 25 | .status(Response.Status.NOT_FOUND) 26 | .entity(error) 27 | .build(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-api/src/main/java/com/kumuluz/ee/samples/tutorial/customers/api/v1/health/OrderServiceHealthCheck.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.api.v1.health; 2 | 3 | import org.eclipse.microprofile.config.inject.ConfigProperty; 4 | import org.eclipse.microprofile.health.Health; 5 | import org.eclipse.microprofile.health.HealthCheck; 6 | import org.eclipse.microprofile.health.HealthCheckResponse; 7 | 8 | import javax.enterprise.context.ApplicationScoped; 9 | import javax.inject.Inject; 10 | import javax.inject.Provider; 11 | 12 | @Health 13 | @ApplicationScoped 14 | public class OrderServiceHealthCheck implements HealthCheck { 15 | 16 | @Inject 17 | @ConfigProperty(name = "rest-properties.external-dependencies.order-service.enabled") 18 | private Provider orderServiceEnabledProvider; 19 | 20 | @Override 21 | public HealthCheckResponse call() { 22 | 23 | if (orderServiceEnabledProvider.get().booleanValue()) { 24 | return HealthCheckResponse.named(OrderServiceHealthCheck.class.getSimpleName()).up().build(); 25 | } else { 26 | return HealthCheckResponse.named(OrderServiceHealthCheck.class.getSimpleName()).down().build(); 27 | } 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-api/src/main/java/com/kumuluz/ee/samples/tutorial/customers/api/v1/producers/JacksonProducer.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.api.v1.producers; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.fasterxml.jackson.databind.SerializationFeature; 5 | 6 | import javax.ws.rs.ext.ContextResolver; 7 | import javax.ws.rs.ext.Provider; 8 | import java.text.SimpleDateFormat; 9 | import java.util.TimeZone; 10 | 11 | @Provider 12 | public class JacksonProducer implements ContextResolver { 13 | 14 | private final ObjectMapper mapper; 15 | 16 | public JacksonProducer() { 17 | 18 | mapper = new ObjectMapper(); 19 | 20 | mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); 21 | 22 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); 23 | dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); 24 | mapper.setDateFormat(dateFormat); 25 | } 26 | 27 | @Override 28 | public ObjectMapper getContext(Class aClass) { 29 | return mapper; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-api/src/main/java/com/kumuluz/ee/samples/tutorial/customers/api/v1/resources/LoadResource.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.api.v1.resources; 2 | 3 | import com.kumuluz.ee.samples.tutorial.customers.cdi.CustomersBean; 4 | 5 | import javax.enterprise.context.RequestScoped; 6 | import javax.inject.Inject; 7 | import javax.ws.rs.Consumes; 8 | import javax.ws.rs.POST; 9 | import javax.ws.rs.Path; 10 | import javax.ws.rs.Produces; 11 | import javax.ws.rs.core.MediaType; 12 | import javax.ws.rs.core.Response; 13 | 14 | /** 15 | * Created by zvoneg on 14/10/2017. 16 | */ 17 | @Path("load") 18 | @RequestScoped 19 | @Consumes(MediaType.APPLICATION_JSON) 20 | @Produces(MediaType.APPLICATION_JSON) 21 | public class LoadResource { 22 | 23 | @Inject 24 | private CustomersBean customersBean; 25 | 26 | @POST 27 | public Response loadOrder(Integer n) { 28 | 29 | customersBean.loadOrder(n); 30 | 31 | return Response.status(Response.Status.OK).build(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-api/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-api/src/main/resources/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-business-logic/src/main/java/com/kumuluz/ee/samples/tutorial/customers/cdi/configuration/RestProperties.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.cdi.configuration; 2 | 3 | import com.kumuluz.ee.configuration.cdi.ConfigBundle; 4 | import com.kumuluz.ee.configuration.cdi.ConfigValue; 5 | 6 | import javax.enterprise.context.ApplicationScoped; 7 | 8 | @ApplicationScoped 9 | @ConfigBundle("rest-properties") 10 | public class RestProperties { 11 | 12 | @ConfigValue(value = "external-dependencies.order-service.enabled", watch = true) 13 | private boolean orderServiceEnabled; 14 | 15 | public boolean isOrderServiceEnabled() { 16 | return orderServiceEnabled; 17 | } 18 | 19 | public void setOrderServiceEnabled(boolean orderServiceEnabled) { 20 | this.orderServiceEnabled = orderServiceEnabled; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-business-logic/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-persistence/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-customers 7 | com.kumuluz.ee.samples.blog 8 | 1.0.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | customers-persistence 13 | 14 | 15 | 16 | 17 | com.kumuluz.ee.samples.blog 18 | orders-persistence 19 | 20 | 21 | 22 | com.kumuluz.ee 23 | kumuluzee-jpa-eclipselink 24 | 25 | 26 | 27 | org.postgresql 28 | postgresql 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-persistence/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jdbc/CustomersDS 5 | 6 | com.kumuluz.ee.samples.tutorial.customers.Customer 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/customers-persistence/src/main/resources/sql-scripts/init-customers.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO customer (id, date_of_birth, first_name, last_name, address) VALUES (1, TIMESTAMP '2006-01-01 15:36:38', 'James', 'Smith', '32 Threadneedle Street, London'); 2 | INSERT INTO customer (id, date_of_birth, first_name, last_name, address) VALUES (2, TIMESTAMP '2009-03-17 15:36:38', 'John', 'Williams', '21 Foster Lane, London'); 3 | INSERT INTO customer (id, date_of_birth, first_name, last_name, address) VALUES (3, TIMESTAMP '2013-11-29 15:36:38', 'Robert', 'Jones', '11 Ludgate Hill, London'); -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/customers/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | com.kumuluz.ee.samples.blog 9 | kumuluzee-kubernetes 10 | 1.0.0-SNAPSHOT 11 | 12 | kumuluzee-customers 13 | 14 | pom 15 | 16 | 17 | customers-api 18 | customers-business-logic 19 | customers-persistence 20 | 21 | 22 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-discovery_config-part1/customer-cm.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: kubernetes-customer-config 5 | namespace: kumuluzee-blog 6 | data: 7 | KUMULUZEE_DISCOVERY_CLUSTER: private-coreos 8 | KUMULUZEE_DISCOVERY_ETCD_HOSTS: http://etcd:2379 9 | KUMULUZEE_CONFIG_ETCD_HOSTS: http://etcd:2379 10 | KUMULUZEE_DATASOURCES0_CONNECTIONURL: jdbc:postgresql://postgres-customers:5433/customer 11 | KUMULUZEE_SERVER_BASEURL: http://192.168.29.246:32600 12 | KUMULUZEE_HEALTH_CHECKS_DATASOURCEHEALTHCHECK_CONNECTIONURL: jdbc:postgresql://postgres-customers:5433/customer 13 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-discovery_config-part1/customer-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: customer-deployment 5 | namespace: kumuluzee-blog 6 | spec: 7 | replicas: 1 8 | template: 9 | metadata: 10 | labels: 11 | app: customer 12 | spec: 13 | containers: 14 | - image: zvoneg/kubernetes-customers:v1.0.5 15 | name: kubernetes-customer 16 | envFrom: 17 | - configMapRef: 18 | name: kubernetes-customer-config 19 | ports: 20 | - containerPort: 8080 21 | name: server 22 | protocol: TCP 23 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-discovery_config-part1/customer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: customer 5 | namespace: kumuluzee-blog 6 | spec: 7 | type: NodePort 8 | ports: 9 | - port: 8080 10 | protocol: TCP 11 | targetPort: 8080 12 | selector: 13 | app: customer 14 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-discovery_config-part1/order-cm.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: kubernetes-order-config 5 | namespace: kumuluzee-blog 6 | data: 7 | KUMULUZEE_DISCOVERY_CLUSTER: private-coreos 8 | KUMULUZEE_DISCOVERY_ETCD_HOSTS: http://etcd:2379 9 | KUMULUZEE_CONFIG_ETCD_HOSTS: http://etcd:2379 10 | KUMULUZEE_DATASOURCES0_CONNECTIONURL: jdbc:postgresql://postgres-orders:5432/order 11 | KUMULUZEE_SERVER_BASEURL: http://192.168.29.246:32583 12 | KUMULUZEE_HEALTH_CHECKS_DATASOURCEHEALTHCHECK_CONNECTIONURL: jdbc:postgresql://postgres-orders:5432/order 13 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-discovery_config-part1/order-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: order-deployment 5 | namespace: kumuluzee-blog 6 | spec: 7 | replicas: 1 8 | template: 9 | metadata: 10 | labels: 11 | app: order 12 | spec: 13 | containers: 14 | - image: zvoneg/kubernetes-orders:v1.0.5 15 | name: kubernetes-orders 16 | envFrom: 17 | - configMapRef: 18 | name: kubernetes-order-config 19 | ports: 20 | - containerPort: 8081 21 | name: server 22 | protocol: TCP -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-discovery_config-part1/order-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: order 5 | namespace: kumuluzee-blog 6 | labels: 7 | app: order 8 | spec: 9 | type: NodePort 10 | ports: 11 | - name: server 12 | port: 8081 13 | protocol: TCP 14 | targetPort: 8081 15 | selector: 16 | app: order 17 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-discovery_config-part1/postgres-customers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: postgres-customers-deployment 5 | namespace: kumuluzee-blog 6 | spec: 7 | replicas: 1 8 | template: 9 | metadata: 10 | labels: 11 | app: postgres-customers 12 | spec: 13 | containers: 14 | - image: postgres:latest 15 | name: postgres-customers 16 | env: 17 | - name: POSTGRES_USER 18 | value: dbuser 19 | - name: POSTGRES_PASSWORD 20 | value: postgres 21 | - name: POSTGRES_DB 22 | value: customer 23 | ports: 24 | - containerPort: 5432 25 | protocol: TCP 26 | 27 | --- 28 | 29 | apiVersion: v1 30 | kind: Service 31 | metadata: 32 | name: postgres-customers 33 | namespace: kumuluzee-blog 34 | spec: 35 | type: ClusterIP 36 | ports: 37 | - port: 5433 38 | protocol: TCP 39 | targetPort: 5432 40 | selector: 41 | app: postgres-customers -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-discovery_config-part1/postgres-orders.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: postgres-orders-deployment 5 | namespace: kumuluzee-blog 6 | spec: 7 | replicas: 1 8 | template: 9 | metadata: 10 | labels: 11 | app: postgres-orders 12 | spec: 13 | containers: 14 | - image: postgres:latest 15 | name: postgres-orders 16 | env: 17 | - name: POSTGRES_USER 18 | value: dbuser 19 | - name: POSTGRES_PASSWORD 20 | value: postgres 21 | - name: POSTGRES_DB 22 | value: order 23 | ports: 24 | - containerPort: 5432 25 | protocol: TCP 26 | 27 | --- 28 | 29 | apiVersion: v1 30 | kind: Service 31 | metadata: 32 | name: postgres-orders 33 | namespace: kumuluzee-blog 34 | spec: 35 | type: ClusterIP 36 | ports: 37 | - port: 5432 38 | protocol: TCP 39 | targetPort: 5432 40 | selector: 41 | app: postgres-orders -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-health_hpa-part2/customer-cm.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: kubernetes-customer-config 5 | namespace: kumuluzee-blog 6 | data: 7 | KUMULUZEE_DISCOVERY_CLUSTER: private-coreos 8 | KUMULUZEE_DISCOVERY_ETCD_HOSTS: http://etcd:2379 9 | KUMULUZEE_CONFIG_ETCD_HOSTS: http://etcd:2379 10 | KUMULUZEE_DATASOURCES0_CONNECTIONURL: jdbc:postgresql://postgres-customers:5433/customer 11 | KUMULUZEE_SERVER_BASEURL: http://192.168.29.246:32600 12 | KUMULUZEE_HEALTH_CHECKS_DATASOURCEHEALTHCHECK_CONNECTIONURL: jdbc:postgresql://postgres-customers:5433/customer 13 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-health_hpa-part2/customer-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: customer-deployment 5 | namespace: kumuluzee-blog 6 | spec: 7 | replicas: 1 8 | template: 9 | metadata: 10 | labels: 11 | app: customer 12 | spec: 13 | containers: 14 | - image: zvoneg/kubernetes-customers:v1.0.5 15 | name: kubernetes-customer 16 | envFrom: 17 | - configMapRef: 18 | name: kubernetes-customer-config 19 | livenessProbe: 20 | httpGet: 21 | path: /health 22 | port: 8080 23 | initialDelaySeconds: 40 24 | periodSeconds: 5 25 | ports: 26 | - containerPort: 8080 27 | name: server 28 | protocol: TCP 29 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-health_hpa-part2/customer-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: customer 5 | namespace: kumuluzee-blog 6 | spec: 7 | type: NodePort 8 | ports: 9 | - port: 8080 10 | protocol: TCP 11 | targetPort: 8080 12 | selector: 13 | app: customer 14 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-health_hpa-part2/order-cm.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: kubernetes-order-config 5 | namespace: kumuluzee-blog 6 | data: 7 | KUMULUZEE_DISCOVERY_CLUSTER: private-coreos 8 | KUMULUZEE_DISCOVERY_ETCD_HOSTS: http://etcd:2379 9 | KUMULUZEE_CONFIG_ETCD_HOSTS: http://etcd:2379 10 | KUMULUZEE_DATASOURCES0_CONNECTIONURL: jdbc:postgresql://postgres-orders:5432/order 11 | KUMULUZEE_SERVER_BASEURL: http://192.168.29.246:32583 12 | KUMULUZEE_HEALTH_CHECKS_DATASOURCEHEALTHCHECK_CONNECTIONURL: jdbc:postgresql://postgres-orders:5432/order 13 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-health_hpa-part2/order-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: order-deployment 5 | namespace: kumuluzee-blog 6 | spec: 7 | replicas: 1 8 | template: 9 | metadata: 10 | labels: 11 | app: order 12 | spec: 13 | containers: 14 | - image: zvoneg/kubernetes-orders:v1.0.5 15 | name: kubernetes-orders 16 | envFrom: 17 | - configMapRef: 18 | name: kubernetes-order-config 19 | livenessProbe: 20 | httpGet: 21 | path: /health 22 | port: 8081 23 | initialDelaySeconds: 30 24 | periodSeconds: 5 25 | resources: 26 | limits: 27 | cpu: 1 28 | ports: 29 | - containerPort: 8081 30 | name: server 31 | protocol: TCP -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-health_hpa-part2/order-hpa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: autoscaling/v1 2 | kind: HorizontalPodAutoscaler 3 | metadata: 4 | name: order-deployment 5 | selfLink: /apis/autoscaling/v1/namespaces/kumuluzee-blog/horizontalpodautoscalers/order-deployment 6 | spec: 7 | maxReplicas: 4 8 | minReplicas: 1 9 | scaleTargetRef: 10 | apiVersion: extensions/v1beta1 11 | kind: Deployment 12 | name: order-deployment 13 | targetCPUUtilizationPercentage: 50 14 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-health_hpa-part2/order-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: order 5 | namespace: kumuluzee-blog 6 | labels: 7 | app: order 8 | spec: 9 | type: NodePort 10 | ports: 11 | - name: server 12 | port: 8081 13 | protocol: TCP 14 | targetPort: 8081 15 | selector: 16 | app: order 17 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-health_hpa-part2/postgres-customers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: postgres-customers-deployment 5 | namespace: kumuluzee-blog 6 | spec: 7 | replicas: 1 8 | template: 9 | metadata: 10 | labels: 11 | app: postgres-customers 12 | spec: 13 | containers: 14 | - image: postgres:latest 15 | name: postgres-customers 16 | env: 17 | - name: POSTGRES_USER 18 | value: dbuser 19 | - name: POSTGRES_PASSWORD 20 | value: postgres 21 | - name: POSTGRES_DB 22 | value: customer 23 | ports: 24 | - containerPort: 5432 25 | protocol: TCP 26 | 27 | --- 28 | 29 | apiVersion: v1 30 | kind: Service 31 | metadata: 32 | name: postgres-customers 33 | namespace: kumuluzee-blog 34 | spec: 35 | type: ClusterIP 36 | ports: 37 | - port: 5433 38 | protocol: TCP 39 | targetPort: 5432 40 | selector: 41 | app: postgres-customers -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/kubernetes-health_hpa-part2/postgres-orders.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: postgres-orders-deployment 5 | namespace: kumuluzee-blog 6 | spec: 7 | replicas: 1 8 | template: 9 | metadata: 10 | labels: 11 | app: postgres-orders 12 | spec: 13 | containers: 14 | - image: postgres:latest 15 | name: postgres-orders 16 | env: 17 | - name: POSTGRES_USER 18 | value: dbuser 19 | - name: POSTGRES_PASSWORD 20 | value: postgres 21 | - name: POSTGRES_DB 22 | value: order 23 | ports: 24 | - containerPort: 5432 25 | protocol: TCP 26 | 27 | --- 28 | 29 | apiVersion: v1 30 | kind: Service 31 | metadata: 32 | name: postgres-orders 33 | namespace: kumuluzee-blog 34 | spec: 35 | type: ClusterIP 36 | ports: 37 | - port: 5432 38 | protocol: TCP 39 | targetPort: 5432 40 | selector: 41 | app: postgres-orders -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jre-alpine 2 | 3 | RUN mkdir /app 4 | 5 | WORKDIR /app 6 | 7 | ADD ./orders-api/target/orders-api-1.0.0-SNAPSHOT.jar /app 8 | 9 | EXPOSE 8080 10 | 11 | CMD ["java", "-jar", "orders-api-1.0.0-SNAPSHOT.jar"] 12 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/OrdersApplication.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1; 2 | 3 | import com.kumuluz.ee.discovery.annotations.RegisterService; 4 | 5 | import javax.ws.rs.ApplicationPath; 6 | import javax.ws.rs.core.Application; 7 | 8 | @ApplicationPath("/v1") 9 | @RegisterService 10 | public class OrdersApplication extends Application { 11 | } 12 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/dtos/Error.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1.dtos; 2 | 3 | public class Error { 4 | 5 | private Integer status; 6 | private String code; 7 | private String message; 8 | 9 | public Integer getStatus() { 10 | return status; 11 | } 12 | 13 | public void setStatus(Integer status) { 14 | this.status = status; 15 | } 16 | 17 | public String getCode() { 18 | return code; 19 | } 20 | 21 | public void setCode(String code) { 22 | this.code = code; 23 | } 24 | 25 | public String getMessage() { 26 | return message; 27 | } 28 | 29 | public void setMessage(String message) { 30 | this.message = message; 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/exceptionmappers/NotFoundExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1.exceptionmappers; 2 | 3 | 4 | import com.kumuluz.ee.samples.tutorial.orders.api.v1.dtos.Error; 5 | 6 | import javax.enterprise.context.ApplicationScoped; 7 | import javax.ws.rs.NotFoundException; 8 | import javax.ws.rs.core.Response; 9 | import javax.ws.rs.ext.ExceptionMapper; 10 | import javax.ws.rs.ext.Provider; 11 | 12 | @Provider 13 | @ApplicationScoped 14 | public class NotFoundExceptionMapper implements ExceptionMapper { 15 | 16 | @Override 17 | public Response toResponse(NotFoundException e) { 18 | 19 | Error error = new Error(); 20 | error.setStatus(404); 21 | error.setCode("resource.not.found"); 22 | error.setMessage(e.getMessage()); 23 | 24 | return Response 25 | .status(Response.Status.NOT_FOUND) 26 | .entity(error) 27 | .build(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/health/HealthManagementDemo.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1.health; 2 | 3 | import javax.annotation.PostConstruct; 4 | import javax.enterprise.context.ApplicationScoped; 5 | 6 | @ApplicationScoped 7 | public class HealthManagementDemo { 8 | 9 | private boolean healthy; 10 | 11 | @PostConstruct 12 | private void init() { 13 | healthy = true; 14 | } 15 | 16 | public boolean isHealthy() { 17 | return healthy; 18 | } 19 | 20 | public void setHealthy(boolean healthy) { 21 | this.healthy = healthy; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/health/OrderServiceHealthCheck.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1.health; 2 | 3 | import org.eclipse.microprofile.health.Health; 4 | import org.eclipse.microprofile.health.HealthCheck; 5 | import org.eclipse.microprofile.health.HealthCheckResponse; 6 | 7 | import javax.enterprise.context.ApplicationScoped; 8 | import javax.inject.Inject; 9 | 10 | @Health 11 | @ApplicationScoped 12 | public class OrderServiceHealthCheck implements HealthCheck { 13 | 14 | @Inject 15 | private HealthManagementDemo healthManagementDemo; 16 | 17 | @Override 18 | public HealthCheckResponse call() { 19 | 20 | if (healthManagementDemo.isHealthy()) { 21 | return HealthCheckResponse.named(OrderServiceHealthCheck.class.getSimpleName()).up().build(); 22 | } else { 23 | return HealthCheckResponse.named(OrderServiceHealthCheck.class.getSimpleName()).down().build(); 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/producers/JacksonProducer.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1.producers; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.fasterxml.jackson.databind.SerializationFeature; 5 | 6 | import javax.ws.rs.ext.ContextResolver; 7 | import javax.ws.rs.ext.Provider; 8 | import java.text.SimpleDateFormat; 9 | import java.util.TimeZone; 10 | 11 | @Provider 12 | public class JacksonProducer implements ContextResolver { 13 | 14 | private final ObjectMapper mapper; 15 | 16 | public JacksonProducer() { 17 | 18 | mapper = new ObjectMapper(); 19 | 20 | mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); 21 | 22 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); 23 | dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); 24 | mapper.setDateFormat(dateFormat); 25 | } 26 | 27 | @Override 28 | public ObjectMapper getContext(Class aClass) { 29 | return mapper; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/resources/LoadResource.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1.resources; 2 | 3 | import javax.enterprise.context.RequestScoped; 4 | import javax.ws.rs.Consumes; 5 | import javax.ws.rs.POST; 6 | import javax.ws.rs.Path; 7 | import javax.ws.rs.Produces; 8 | import javax.ws.rs.core.MediaType; 9 | import javax.ws.rs.core.Response; 10 | 11 | /** 12 | * Created by zvoneg on 13/10/2017. 13 | */ 14 | @RequestScoped 15 | @Path("/load") 16 | @Produces(MediaType.APPLICATION_JSON) 17 | @Consumes(MediaType.APPLICATION_JSON) 18 | public class LoadResource { 19 | 20 | @POST 21 | public Response createLoad(Integer n) { 22 | 23 | for (int i = 1; i <= n; i++) { 24 | fibonacci(i); 25 | } 26 | 27 | return Response.status(Response.Status.OK).build(); 28 | } 29 | 30 | private long fibonacci(int n) { 31 | if (n <= 1) return n; 32 | else return fibonacci(n - 1) + fibonacci(n - 2); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/resources/ManagementResource.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1.resources; 2 | 3 | import com.kumuluz.ee.samples.tutorial.orders.api.v1.health.HealthManagementDemo; 4 | 5 | import javax.enterprise.context.RequestScoped; 6 | import javax.inject.Inject; 7 | import javax.ws.rs.Consumes; 8 | import javax.ws.rs.POST; 9 | import javax.ws.rs.Path; 10 | import javax.ws.rs.Produces; 11 | import javax.ws.rs.core.MediaType; 12 | import javax.ws.rs.core.Response; 13 | 14 | @RequestScoped 15 | @Path("/management") 16 | @Produces(MediaType.APPLICATION_JSON) 17 | @Consumes(MediaType.APPLICATION_JSON) 18 | public class ManagementResource { 19 | 20 | @Inject 21 | private HealthManagementDemo healthManagementDemo; 22 | 23 | @POST 24 | @Path("healthy") 25 | public Response setHealthStatus(Boolean healthy) { 26 | 27 | healthManagementDemo.setHealthy(healthy); 28 | 29 | return Response.ok().build(); 30 | 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/resources/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-api/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: order-service 3 | env: 4 | name: dev 5 | version: 1.0.0 6 | server: 7 | base-url: http://localhost:8081 8 | http: 9 | port: 8081 10 | datasources: 11 | - jndi-name: jdbc/OrdersDS 12 | connection-url: jdbc:postgresql://postgres-orders:5432/order 13 | username: dbuser 14 | password: postgres 15 | pool: 16 | max-size: 20 17 | discovery: 18 | etcd: 19 | hosts: http://192.168.99.100:2379 20 | metrics: 21 | web-instrumentation: 22 | - name: orders-endpoint 23 | url-pattern: /v1/orders/* 24 | registry-name: ordersRegistry 25 | health: 26 | checks: 27 | data-source-health-check: 28 | connection-url: jdbc:postgresql://postgres-orders:5432/order 29 | username: dbuser 30 | password: postgres 31 | disk-space-health-check: 32 | threshold: 100000000 33 | cors-filter: 34 | servlet: 35 | allow-origin: "*" -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-business-logic/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-orders 7 | com.kumuluz.ee.samples.blog 8 | 1.0.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | orders-business-logic 13 | 14 | 15 | 16 | com.kumuluz.ee 17 | kumuluzee-cdi-weld 18 | 19 | 20 | com.kumuluz.ee 21 | kumuluzee-jax-rs-jersey 22 | 23 | 24 | 25 | com.kumuluz.ee.samples.blog 26 | orders-persistence 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-business-logic/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-persistence/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-orders 7 | com.kumuluz.ee.samples.blog 8 | 1.0.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | orders-persistence 13 | 14 | 15 | 16 | com.kumuluz.ee 17 | kumuluzee-jpa-eclipselink 18 | 19 | 20 | com.kumuluz.ee.rest 21 | kumuluzee-rest-core 22 | 23 | 24 | 25 | org.postgresql 26 | postgresql 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-persistence/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jdbc/OrdersDS 5 | 6 | com.kumuluz.ee.samples.tutorial.orders.Order 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/orders-persistence/src/main/resources/sql-scripts/init-orders.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO orders (id, title, description, submitted, customer_id) VALUES (1, 'Keyboard', 'New mechanical keyboard.', TIMESTAMP '2017-03-01 11:23:38', 1); 2 | INSERT INTO orders (id, title, description, submitted, customer_id) VALUES (2, 'Mouse', 'Black mouse.', TIMESTAMP '2017-04-12 01:12:38', 1); 3 | INSERT INTO orders (id, title, description, submitted, customer_id) VALUES (3, 'Monitor', 'LCD monitor.', TIMESTAMP '2017-06-17 12:00:08', 3); -------------------------------------------------------------------------------- /kumuluzee-blog-samples/kumuluzee-kubernetes/orders/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | com.kumuluz.ee.samples.blog 9 | kumuluzee-kubernetes 10 | 1.0.0-SNAPSHOT 11 | 12 | kumuluzee-orders 13 | 14 | pom 15 | 16 | 17 | orders-api 18 | orders-business-logic 19 | orders-persistence 20 | 21 | 22 | -------------------------------------------------------------------------------- /kumuluzee-blog-samples/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-samples 7 | com.kumuluz.ee.samples 8 | 3.13.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | kumuluzee-blog-samples 13 | 14 | KumuluzEE Blog Samples 15 | 16 | pom 17 | 18 | kumuluzee-kubernetes 19 | 20 | 21 | -------------------------------------------------------------------------------- /kumuluzee-config-consul/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-config-consul/src/main/resources/META-INF/services/com.kumuluz.ee.configuration.ConfigurationDecoder: -------------------------------------------------------------------------------- 1 | com.kumuluz.ee.samples.kumuluz_config_consul.CustomConfigurationDecoder -------------------------------------------------------------------------------- /kumuluzee-config-consul/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: customer-service 3 | version: 1.0.0 4 | env: 5 | name: dev 6 | config: 7 | start-retry-delay-ms: 500 8 | max-retry-delay-ms: 900000 9 | 10 | rest-config: 11 | string-property: Monday 12 | boolean-property: true 13 | integer-property: 23 14 | encoded-property: ZW5jb2RlZCBwcm9wZXJ0eQ== 15 | -------------------------------------------------------------------------------- /kumuluzee-config-consul/src/main/resources/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /kumuluzee-config-etcd/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-config-etcd/src/main/resources/META-INF/services/com.kumuluz.ee.configuration.ConfigurationDecoder: -------------------------------------------------------------------------------- 1 | com.kumuluz.ee.samples.kumuluz_config_etcd.CustomConfigurationDecoder -------------------------------------------------------------------------------- /kumuluzee-config-etcd/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-config-mp/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-config-mp/src/main/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | mp.example-string=Hello MicroProfile Config! 2 | mp.example-boolean=true 3 | mp.example-customer=John:Doe 4 | mp.example-customers=James:White,Robert:Simpson,Ronald:Smith -------------------------------------------------------------------------------- /kumuluzee-config-mp/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource: -------------------------------------------------------------------------------- 1 | com.kumuluz.ee.samples.configsources.ExampleConfigSource -------------------------------------------------------------------------------- /kumuluzee-config-mp/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider: -------------------------------------------------------------------------------- 1 | com.kumuluz.ee.samples.configsources.ExampleConfigSourceProvider -------------------------------------------------------------------------------- /kumuluzee-config-mp/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.Converter: -------------------------------------------------------------------------------- 1 | com.kumuluz.ee.samples.converters.CustomerConverter -------------------------------------------------------------------------------- /kumuluzee-config-zookeeper/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-config-zookeeper/src/main/resources/META-INF/services/com.kumuluz.ee.configuration.ConfigurationDecoder: -------------------------------------------------------------------------------- 1 | com.kumuluz.ee.samples.kumuluz_config_etcd.CustomConfigurationDecoder -------------------------------------------------------------------------------- /kumuluzee-config-zookeeper/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: customer-service 3 | version: 1.0.0 4 | env: 5 | name: dev 6 | config: 7 | zookeeper: 8 | hosts: localhost:2181 9 | 10 | rest-config: 11 | string-property: Monday 12 | boolean-property: true 13 | integer-property: 23 14 | encoded-property: ZW5jb2RlZCBwcm9wZXJ0eQ== 15 | -------------------------------------------------------------------------------- /kumuluzee-config-zookeeper/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-config/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-config/src/main/resources/META-INF/services/com.kumuluz.ee.configuration.ConfigurationDecoder: -------------------------------------------------------------------------------- 1 | com.kumuluz.ee.samples.kumuluz_config.CustomConfigurationDecoder -------------------------------------------------------------------------------- /kumuluzee-config/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | rest-config: 2 | string-property: Monday 3 | boolean-property: true 4 | integer-property: 23 5 | encoded-property: ZW5jb2RlZCBwcm9wZXJ0eQ== -------------------------------------------------------------------------------- /kumuluzee-config/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-cors/src/main/java/com/kumuluz/ee/samples/cors/CustomerApplication.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.cors; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | /** 7 | * Created by zvoneg on 01/08/17. 8 | */ 9 | @ApplicationPath("v1") 10 | public class CustomerApplication extends Application { 11 | } 12 | -------------------------------------------------------------------------------- /kumuluzee-cors/src/main/java/com/kumuluz/ee/samples/cors/CustomerResource.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.cors; 2 | 3 | import com.kumuluz.ee.cors.annotations.CrossOrigin; 4 | 5 | import java.util.List; 6 | 7 | import javax.ws.rs.GET; 8 | import javax.ws.rs.Path; 9 | import javax.ws.rs.Produces; 10 | import javax.ws.rs.core.MediaType; 11 | import javax.ws.rs.core.Response; 12 | import java.util.ArrayList; 13 | 14 | /** 15 | * Created by zvoneg on 01/08/17. 16 | */ 17 | @Path("customers") 18 | @Produces(MediaType.APPLICATION_JSON) 19 | @CrossOrigin(allowOrigin = "http://resource-origin.com") 20 | public class CustomerResource { 21 | 22 | @GET 23 | public Response getCustomers() { 24 | 25 | List customers = new ArrayList<>(); 26 | Customer c = new Customer("1", "John", "Doe"); 27 | 28 | customers.add(c); 29 | 30 | return Response.status(Response.Status.OK).entity(customers).build(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /kumuluzee-cors/src/main/java/com/kumuluz/ee/samples/cors/CustomerServlet.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.cors; 2 | 3 | import com.kumuluz.ee.cors.annotations.CrossOrigin; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.io.IOException; 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | /** 15 | * Created by zvoneg on 01/08/17. 16 | */ 17 | @WebServlet("CustomerServlet") 18 | @CrossOrigin(name = "customer-servlet") 19 | public class CustomerServlet extends HttpServlet { 20 | 21 | @Override 22 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 23 | 24 | List customers = new ArrayList<>(); 25 | Customer c = new Customer("1", "John", "Doe"); 26 | 27 | customers.add(c); 28 | 29 | resp.getWriter().println(customers.toString()); 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /kumuluzee-cors/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | cors-filter: 3 | annotations: 4 | customer-servlet: 5 | allow-origin: "http://origin2.kumuluz.com" 6 | allow-subdomains: false -------------------------------------------------------------------------------- /kumuluzee-cors/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-database-schema-migrations-liquibase/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /kumuluzee-database-schema-migrations-liquibase/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | jdbc/BooksDS 10 | 11 | com.kumuluz.ee.samples.kumuluzee_database_schema_migrations_liquibase.Book 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /kumuluzee-database-schema-migrations-liquibase/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: kumuluzee-samples-migrations-liquibase 3 | datasources: 4 | - jndi-name: jdbc/BooksDS 5 | connection-url: jdbc:postgresql://localhost:5432/postgres 6 | username: postgres 7 | password: postgres 8 | pool: 9 | max-size: 20 10 | database-schema-migrations: 11 | enabled: true 12 | liquibase: 13 | changelogs: 14 | - jndi-name: jdbc/BooksDS 15 | file: db/books-changelog.xml 16 | contexts: "init" 17 | startup: 18 | drop-all: true 19 | update: true -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/README.md: -------------------------------------------------------------------------------- 1 | # KumuluzEE Discovery with Consul 2 | 3 | > Samples for KumuluzEE Discovery extension 4 | 5 | This module contains four samples that will introduce you to KumuluzEE Discovery extension using Consul: 6 | 7 | - [`discovery-consul-register`](http://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-discovery-consul/discovery-consul-register) JAX-RS microservice that registers itself to etcd 8 | - [`discovery-consul-discover-servlet`](http://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-discovery-consul/discovery-consul-discover-servlet) servlet microservice that discovers 9 | and calls `discovery-register` microservice 10 | - [`discovery-consul-discover-jaxrs`](http://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-discovery-consul/discovery-consul-discover-jaxrs) JAX-RS microservice that discovers 11 | and calls `discovery-consul-register` microservice 12 | 13 | More information about the samples can be found in the README of each sample. 14 | -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/discovery-consul-discover-jaxrs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8u131-jre-alpine 2 | 3 | 4 | COPY target /usr/src/myapp 5 | WORKDIR /usr/src/myapp 6 | 7 | EXPOSE 8080 8 | 9 | CMD ["java", "-server", "-cp", "classes:dependency/*", "com.kumuluz.ee.EeApplication"] -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/discovery-consul-discover-jaxrs/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/discovery-consul-discover-jaxrs/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | discovery: 3 | -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/discovery-consul-discover-jaxrs/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/discovery-consul-discover-servlet/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | discovery: 3 | -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/discovery-consul-discover-servlet/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/discovery-consul-register/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8u131-jre-alpine 2 | 3 | 4 | COPY target /usr/src/myapp 5 | WORKDIR /usr/src/myapp 6 | 7 | EXPOSE 8080 8 | 9 | CMD ["java", "-server", "-cp", "classes:dependency/*", "com.kumuluz.ee.EeApplication"] -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/discovery-consul-register/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: customer-service 3 | env: 4 | name: dev 5 | version: 1.0.0 6 | server: 7 | http: 8 | port: 8081 9 | discovery: 10 | ttl: 20 11 | ping-interval: 15 -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/discovery-consul-register/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-discovery-consul/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-samples 7 | com.kumuluz.ee.samples 8 | 3.13.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | kumuluzee-discovery-consul 13 | pom 14 | 15 | KumuluzEE Consul Discovery samples 16 | Samples for service discovery with KumuluzEE 17 | 18 | 19 | discovery-consul-register 20 | discovery-consul-discover-servlet 21 | discovery-consul-discover-jaxrs 22 | 23 | 24 | 25 | 1.2.0-SNAPSHOT 26 | 27 | 28 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/README.md: -------------------------------------------------------------------------------- 1 | # KumuluzEE Discovery with etcd 2 | 3 | > Samples for KumuluzEE Discovery extension 4 | 5 | This module contains four samples that will introduce you to KumuluzEE Discovery extension using etcd: 6 | 7 | - [`discovery-etcd-register`](http://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-discovery-etcd/discovery-etcd-register) JAX-RS microservice that registers itself to etcd 8 | - [`discovery-etcd-discover-servlet`](http://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-discovery-etcd/discovery-etcd-discover-servlet) servlet microservice that discovers 9 | and calls `discovery-register` microservice 10 | - [`discovery-etcd-discover-jaxrs`](http://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-discovery-etcd/discovery-etcd-discover-jaxrs) JAX-RS microservice that discovers 11 | and calls `discovery-register` microservice 12 | - [`discovery-etcd-kubernetes`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-discovery-etcd/discovery-etcd-kubernetes) deploy `discovery-register` and `discovery-discover-jaxrs` samples to Kubernetes cluster 13 | 14 | More information about the samples can be found in the README of each sample. 15 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-discover-jaxrs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8u131-jre-alpine 2 | 3 | 4 | COPY target /usr/src/myapp 5 | WORKDIR /usr/src/myapp 6 | 7 | EXPOSE 8080 8 | 9 | CMD ["java", "-server", "-cp", "classes:dependency/*", "com.kumuluz.ee.EeApplication"] -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-discover-jaxrs/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-discover-jaxrs/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | discovery: 3 | etcd: 4 | hosts: http://localhost:2379 5 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-discover-jaxrs/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-discover-servlet/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | discovery: 3 | etcd: 4 | hosts: http://127.0.0.1:2379 5 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-discover-servlet/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-kubernetes/discover-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: discover-deployment 5 | spec: 6 | replicas: 1 7 | template: 8 | metadata: 9 | labels: 10 | app: discover 11 | spec: 12 | containers: 13 | - image: discover-sample:v1 14 | name: discover 15 | env: 16 | - name: KUMULUZEE_DISCOVERY_CLUSTER 17 | value: minikube 18 | - name: KUMULUZEE_DISCOVERY_ETCD_HOSTS 19 | value: http://etcd:2379 20 | ports: 21 | - containerPort: 8080 22 | name: server 23 | protocol: TCP 24 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-kubernetes/discover-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: discover 5 | spec: 6 | type: NodePort 7 | ports: 8 | - port: 8080 9 | protocol: TCP 10 | targetPort: 8080 11 | selector: 12 | app: discover 13 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-kubernetes/etcd.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: etcd-deployment 5 | spec: 6 | replicas: 1 7 | template: 8 | metadata: 9 | labels: 10 | app: etcd 11 | spec: 12 | containers: 13 | - command: 14 | - /usr/local/bin/etcd 15 | - --name 16 | - etcd0 17 | - --initial-advertise-peer-urls 18 | - http://etcd:2380 19 | - --listen-peer-urls 20 | - http://0.0.0.0:2380 21 | - --listen-client-urls 22 | - http://0.0.0.0:2379 23 | - --advertise-client-urls 24 | - http://etcd:2379 25 | - --initial-cluster-state 26 | - new 27 | image: quay.io/coreos/etcd:latest 28 | name: etcd 29 | ports: 30 | - containerPort: 2379 31 | name: client 32 | protocol: TCP 33 | - containerPort: 2380 34 | name: server 35 | protocol: TCP 36 | 37 | --- 38 | 39 | apiVersion: v1 40 | kind: Service 41 | metadata: 42 | name: etcd 43 | spec: 44 | type: NodePort 45 | ports: 46 | - name: client 47 | port: 2379 48 | protocol: TCP 49 | targetPort: 2379 50 | - name: server 51 | port: 2380 52 | protocol: TCP 53 | targetPort: 2380 54 | selector: 55 | app: etcd 56 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-kubernetes/register-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: register-deployment 5 | spec: 6 | replicas: 1 7 | template: 8 | metadata: 9 | labels: 10 | app: register 11 | spec: 12 | containers: 13 | - image: register-sample:v1 14 | name: register 15 | env: 16 | # - name: KUMULUZEE_BASEURL 17 | # value: http://NODE-IP:SERVICE-NODEPORT 18 | - name: KUMULUZEE_DISCOVERY_CLUSTER 19 | value: minikube 20 | - name: KUMULUZEE_DISCOVERY_ETCD_HOSTS 21 | value: http://etcd:2379 22 | ports: 23 | - containerPort: 8080 24 | name: server 25 | protocol: TCP 26 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-register/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8u131-jre-alpine 2 | 3 | 4 | COPY target /usr/src/myapp 5 | WORKDIR /usr/src/myapp 6 | 7 | EXPOSE 8080 8 | 9 | CMD ["java", "-server", "-cp", "classes:dependency/*", "com.kumuluz.ee.EeApplication"] -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-register/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: customer-service 3 | env: 4 | name: dev 5 | version: 1.0.0 6 | server: 7 | base-url: http://localhost:8081 8 | http: 9 | port: 8081 10 | discovery: 11 | etcd: 12 | hosts: http://localhost:2379 13 | ttl: 20 14 | ping-interval: 15 15 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/discovery-etcd-register/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-discovery-etcd/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-samples 7 | com.kumuluz.ee.samples 8 | 3.13.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | kumuluzee-discovery-etcd 13 | pom 14 | 15 | KumuluzEE ETCD Discovery samples 16 | Samples for service discovery with KumuluzEE 17 | 18 | 19 | discovery-etcd-register 20 | discovery-etcd-discover-servlet 21 | discovery-etcd-discover-jaxrs 22 | 23 | 24 | 25 | 1.2.0-SNAPSHOT 26 | 27 | 28 | -------------------------------------------------------------------------------- /kumuluzee-ethereum-web3j/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-ethereum-web3j/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | ethereum: 3 | wallet: 4 | path: "kumuluzee-ethereum-web3j/wallet-sample-ebe82f9ac91697e8a81f4f3a30fcaf499ef65993.json" 5 | password: "kumuluz" 6 | client: 7 | address: "https://rinkeby.infura.io/RqMYnA77aiFY4oxoxMRD" -------------------------------------------------------------------------------- /kumuluzee-ethereum-web3j/wallet-sample-ebe82f9ac91697e8a81f4f3a30fcaf499ef65993.json: -------------------------------------------------------------------------------- 1 | {"address":"ebe82f9ac91697e8a81f4f3a30fcaf499ef65993","id":"3ec25e21-64d0-44ba-9050-b64916faa0bd","version":3,"crypto":{"cipher":"aes-128-ctr","ciphertext":"9e41b007ead554f8a15c642c33358ab24490fd63112fb51914b24e4b695a0058","cipherparams":{"iv":"a3c45ad79b2e5354dbe1d603ed5370e1"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"c4f3d2cf4a2e2872da8dc189bd13d6500693f5b0e5dd3ea488834016768f8cdb"},"mac":"ec92ae0e795c32f8fcad8da7733e12430932e07fd472d1faf96d997b6875588a"}} -------------------------------------------------------------------------------- /kumuluzee-fault-tolerance/common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-fault-tolerance 7 | com.kumuluz.ee.samples 8 | 3.13.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | kumuluzee-fault-tolerance-common 13 | 14 | KumuluzEE Fault Tolerance sample common 15 | KumuluzEE Fault Tolerance common for sample implementation 16 | 17 | -------------------------------------------------------------------------------- /kumuluzee-fault-tolerance/customer-api/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-fault-tolerance/customer-api/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | env: dev 3 | 4 | fault-tolerance: 5 | bulkhead: 6 | value: 5 7 | 8 | annotation-overrides: 9 | - class: com.kumuluz.ee.samples.circuit_breaker_hystrix.customer.beans.OrdersBean 10 | method: findOrdersByCustomerId 11 | annotation: timeout 12 | parameters: 13 | value: 1500 14 | - class: com.kumuluz.ee.samples.circuit_breaker_hystrix.customer.beans.OrdersBean 15 | method: findOrdersByCustomerId 16 | annotation: circuit-breaker 17 | parameters: 18 | request-threshold: 10 19 | failure-ratio: 0.3 20 | delay: 3000 21 | 22 | orders-api: 23 | path: http://localhost:8081/v1/orders 24 | -------------------------------------------------------------------------------- /kumuluzee-fault-tolerance/order-api/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | http: 4 | port: 8081 5 | -------------------------------------------------------------------------------- /kumuluzee-feature-flags-unleash/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-feature-flags-unleash/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: feature-flags-sample-service 3 | version: 1.0.0 4 | env: 5 | name: dev 6 | feature-flags: 7 | unleash: 8 | unleash-api: "http://localhost:4242/api" -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/beans/AssistantBean.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.beans; 2 | 3 | import com.kumuluz.ee.rest.beans.QueryParameters; 4 | import com.kumuluz.ee.rest.utils.JPAUtils; 5 | import com.kumuluz.ee.samples.graphql_advanced.entities.Assistant; 6 | 7 | import javax.enterprise.context.RequestScoped; 8 | import javax.persistence.EntityManager; 9 | import javax.persistence.PersistenceContext; 10 | import java.util.List; 11 | 12 | @RequestScoped 13 | public class AssistantBean { 14 | 15 | @PersistenceContext 16 | private EntityManager em; 17 | 18 | public List getAssistants(QueryParameters qp) { 19 | 20 | return JPAUtils.queryEntities(em, Assistant.class, qp); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/beans/LecturerBean.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.beans; 2 | 3 | import com.kumuluz.ee.rest.beans.QueryParameters; 4 | import com.kumuluz.ee.rest.utils.JPAUtils; 5 | import com.kumuluz.ee.samples.graphql_advanced.entities.Lecturer; 6 | import com.kumuluz.ee.samples.graphql_advanced.entities.connections.LecturerConnection; 7 | 8 | import javax.enterprise.context.RequestScoped; 9 | import javax.persistence.EntityManager; 10 | import javax.persistence.PersistenceContext; 11 | import java.util.List; 12 | 13 | @RequestScoped 14 | public class LecturerBean { 15 | 16 | @PersistenceContext 17 | private EntityManager entityManager; 18 | 19 | public List getLecturerList(QueryParameters queryParameters) { 20 | //use pagination, but do not return any metadata 21 | return JPAUtils.queryEntities(entityManager, Lecturer.class, queryParameters); 22 | } 23 | 24 | public LecturerConnection getLecturerConnection(QueryParameters queryParameters) { 25 | 26 | List result = JPAUtils.queryEntities(entityManager, Lecturer.class, queryParameters); 27 | long resultCount = JPAUtils.queryEntitiesCount(entityManager, Lecturer.class, queryParameters); 28 | 29 | return new LecturerConnection(result, resultCount); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/beans/StudentBean.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.beans; 2 | 3 | import com.kumuluz.ee.rest.beans.QueryParameters; 4 | import com.kumuluz.ee.rest.utils.JPAUtils; 5 | import com.kumuluz.ee.samples.graphql_advanced.entities.Student; 6 | import com.kumuluz.ee.samples.graphql_advanced.entities.connections.StudentConnection; 7 | 8 | import javax.enterprise.context.RequestScoped; 9 | import javax.persistence.EntityManager; 10 | import javax.persistence.PersistenceContext; 11 | import javax.transaction.Transactional; 12 | import java.time.LocalDate; 13 | 14 | @RequestScoped 15 | public class StudentBean { 16 | 17 | @PersistenceContext 18 | private EntityManager em; 19 | 20 | public StudentConnection getStudentConnection(QueryParameters qp) { 21 | 22 | return new StudentConnection(JPAUtils.queryEntities(em, Student.class, qp), 23 | JPAUtils.queryEntitiesCount(em, Student.class, qp)); 24 | } 25 | 26 | public Student getStudentById(Integer id) { 27 | 28 | return em.find(Student.class, id); 29 | } 30 | 31 | @Transactional 32 | public Student createStudent(Student s) { 33 | s.setEnrolled(LocalDate.now()); 34 | em.persist(s); 35 | 36 | return s; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/dtos/AssignmentResult.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.dtos; 2 | 3 | public class AssignmentResult { 4 | 5 | private String message; 6 | private Integer code; 7 | 8 | public AssignmentResult(String message, Integer code) { 9 | this.message = message; 10 | this.code = code; 11 | } 12 | 13 | public String getMessage() { 14 | return message; 15 | } 16 | 17 | public void setMessage(String message) { 18 | this.message = message; 19 | } 20 | 21 | public Integer getCode() { 22 | return code; 23 | } 24 | 25 | public void setCode(Integer code) { 26 | this.code = code; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/dtos/Subject.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.dtos; 2 | 3 | import org.eclipse.microprofile.graphql.Ignore; 4 | 5 | public class Subject { 6 | 7 | private Integer id; 8 | private String name; 9 | private String classroom; 10 | 11 | public Subject(Integer id, String name, String classroom) { 12 | this.id = id; 13 | this.name = name; 14 | this.classroom = classroom; 15 | } 16 | 17 | public Subject() { 18 | 19 | } 20 | 21 | public Integer getId() { 22 | return id; 23 | } 24 | 25 | @Ignore 26 | public void setId(Integer id) { 27 | this.id = id; 28 | } 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | public void setName(String name) { 35 | this.name = name; 36 | } 37 | 38 | public String getClassroom() { 39 | return classroom; 40 | } 41 | 42 | public void setClassroom(String classroom) { 43 | this.classroom = classroom; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/entities/Assistant.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.entities; 2 | 3 | import javax.persistence.*; 4 | 5 | @Entity 6 | public class Assistant extends Person { 7 | 8 | @Column 9 | private Double popularity; 10 | 11 | public Assistant() { 12 | } 13 | 14 | public Double getPopularity() { 15 | return popularity; 16 | } 17 | 18 | public void setPopularity(Double popularity) { 19 | this.popularity = popularity; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/entities/Lecturer.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.entities; 2 | 3 | import com.kumuluz.ee.samples.graphql_advanced.enums.LecturerStatus; 4 | 5 | import javax.persistence.*; 6 | 7 | @Entity 8 | @NamedQueries( 9 | @NamedQuery(name="getAllLecturers", query = "SELECT l FROM Lecturer l") 10 | ) 11 | public class Lecturer extends Person { 12 | 13 | @Column 14 | private String location; 15 | @Column 16 | private LecturerStatus status; 17 | @ManyToOne 18 | private Assistant assistant; 19 | 20 | public Lecturer() { 21 | } 22 | 23 | public String getLocation() { 24 | return location; 25 | } 26 | 27 | public LecturerStatus getStatus() { 28 | return status; 29 | } 30 | 31 | public Assistant getAssistant() { 32 | return assistant; 33 | } 34 | 35 | public void setLocation(String location) { 36 | this.location = location; 37 | } 38 | 39 | public void setStatus(LecturerStatus status) { 40 | this.status = status; 41 | } 42 | 43 | public void setAssistant(Assistant assistant) { 44 | this.assistant = assistant; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/entities/Person.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.entities; 2 | 3 | import javax.persistence.*; 4 | 5 | @MappedSuperclass 6 | public class Person { 7 | 8 | @Id 9 | @GeneratedValue(strategy = GenerationType.IDENTITY) 10 | private Integer id; 11 | @Column 12 | private String name; 13 | @Column 14 | private String surname; 15 | 16 | public Person() { 17 | } 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public String getSurname() { 24 | return surname; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | public void setSurname(String surname) { 32 | this.surname = surname; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/entities/Student.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.entities; 2 | 3 | import org.eclipse.microprofile.graphql.Ignore; 4 | 5 | import javax.persistence.*; 6 | import java.time.LocalDate; 7 | 8 | @Entity 9 | @NamedQueries( 10 | @NamedQuery(name = "getAllStudents", query="SELECT s FROM Student s") 11 | ) 12 | public class Student extends Person { 13 | 14 | @Column(unique=true) 15 | private Integer studentNumber; 16 | 17 | @Column 18 | private LocalDate enrolled; 19 | 20 | public Student() { 21 | //needs empty constructor to deserialize object when performing mutations 22 | } 23 | 24 | public Integer getStudentNumber() { 25 | //getters are resolvers for fields 26 | return studentNumber; 27 | } 28 | 29 | public LocalDate getEnrolled() { 30 | return enrolled; 31 | } 32 | 33 | public void setStudentNumber(Integer studentNumber) { 34 | this.studentNumber = studentNumber; 35 | } 36 | 37 | @Ignore 38 | public void setEnrolled(LocalDate enrolled) { 39 | this.enrolled = enrolled; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/entities/connections/ConnectionBase.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.entities.connections; 2 | 3 | import java.util.List; 4 | 5 | public abstract class ConnectionBase { 6 | 7 | private final List edges; 8 | private final long totalCount; 9 | 10 | public ConnectionBase(List edges, long totalCount) { 11 | this.edges = edges; 12 | this.totalCount = totalCount; 13 | } 14 | 15 | public List getEdges() { 16 | return edges; 17 | } 18 | 19 | public long getTotalCount() { 20 | return totalCount; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/entities/connections/LecturerConnection.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.entities.connections; 2 | 3 | import com.kumuluz.ee.samples.graphql_advanced.entities.Lecturer; 4 | 5 | import java.util.List; 6 | 7 | public class LecturerConnection extends ConnectionBase { 8 | 9 | public LecturerConnection(List edges, long totalCount) { 10 | super(edges, totalCount); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/entities/connections/StudentConnection.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.entities.connections; 2 | 3 | import com.kumuluz.ee.samples.graphql_advanced.entities.Student; 4 | 5 | import java.util.List; 6 | 7 | public class StudentConnection extends ConnectionBase { 8 | 9 | public StudentConnection(List edges, long totalCount) { 10 | super(edges, totalCount); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/entities/connections/SubjectConnection.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.entities.connections; 2 | 3 | import com.kumuluz.ee.samples.graphql_advanced.dtos.Subject; 4 | 5 | import java.util.List; 6 | 7 | public class SubjectConnection extends ConnectionBase { 8 | 9 | public SubjectConnection(List edges, long totalCount) { 10 | super(edges, totalCount); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/enums/LecturerStatus.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.enums; 2 | 3 | public enum LecturerStatus { 4 | FULLTIME, PARTTIME 5 | } 6 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/graphql/AssistantResolvers.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.graphql; 2 | 3 | import com.kumuluz.ee.graphql.mp.utils.GraphQLUtils; 4 | import com.kumuluz.ee.rest.beans.QueryParameters; 5 | import com.kumuluz.ee.rest.utils.QueryStringDefaults; 6 | import com.kumuluz.ee.samples.graphql_advanced.beans.AssistantBean; 7 | import com.kumuluz.ee.samples.graphql_advanced.entities.Assistant; 8 | import org.eclipse.microprofile.graphql.GraphQLApi; 9 | import org.eclipse.microprofile.graphql.Query; 10 | 11 | import javax.enterprise.context.ApplicationScoped; 12 | import javax.inject.Inject; 13 | import java.util.List; 14 | 15 | @GraphQLApi 16 | @ApplicationScoped 17 | public class AssistantResolvers { 18 | 19 | @Inject 20 | private QueryStringDefaults qsd; 21 | 22 | @Inject 23 | private AssistantBean assistantBean; 24 | 25 | @Query 26 | public List getAssistants(String sort) { 27 | 28 | QueryParameters qp = GraphQLUtils.queryParametersBuilder() 29 | .withQueryStringDefaults(qsd) 30 | .withOrder(sort) 31 | .build(); 32 | 33 | return assistantBean.getAssistants(qp); 34 | } 35 | } -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/java/com/kumuluz/ee/samples/graphql_advanced/utils/ApplicationDefaults.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_advanced.utils; 2 | 3 | import com.kumuluz.ee.rest.utils.QueryStringDefaults; 4 | 5 | import javax.enterprise.context.ApplicationScoped; 6 | import javax.enterprise.inject.Produces; 7 | 8 | public class ApplicationDefaults { 9 | 10 | @Produces 11 | @ApplicationScoped 12 | public QueryStringDefaults getQueryDefaults() { 13 | return new QueryStringDefaults() 14 | .defaultOffset(0) 15 | .defaultLimit(20) 16 | .maxLimit(100); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | env: 3 | name: production 4 | graphql: 5 | mapping: graphql 6 | ui: 7 | enabled: true 8 | defaults: 9 | offset: 0 10 | limit: 20 11 | datasources: 12 | - jndi-name: jdbc/Faculty 13 | connection-url: jdbc:postgresql://localhost:5432/faculty 14 | username: postgres 15 | password: postgres 16 | pool: 17 | max-size: 20 18 | -------------------------------------------------------------------------------- /kumuluzee-graphql-advanced/src/main/resources/sql-scripts/init-db.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO student (name, surname, studentnumber, enrolled) VALUES ('James', 'Smith', 63170000, '2018-03-21'); 2 | INSERT INTO student (name, surname, studentnumber, enrolled) VALUES ('John', 'Johnson', 63170001, '2018-04-12'); 3 | INSERT INTO student (name, surname, studentnumber, enrolled) VALUES ('Robert', 'Williams', 63170002, '2018-02-27'); 4 | INSERT INTO assistant (name, surname, popularity) VALUES ('Bradley', 'Cook', 10); 5 | INSERT INTO assistant (name, surname, popularity) VALUES ('Scott', 'Howard', 5.7); 6 | INSERT INTO assistant (name, surname, popularity) VALUES ('Jeffrey', 'Compton', 1.4); 7 | INSERT INTO lecturer (name, surname, location, status, assistant_id) VALUES ('Michael', 'Jones', 'R2.23', 0, 1); 8 | INSERT INTO lecturer (name, surname, location, status, assistant_id) VALUES ('William', 'Brown', 'R4.21', 1, 2); 9 | INSERT INTO lecturer (name, surname, location, status, assistant_id) VALUES ('David', 'Davis', 'R1.10', 0, 1); 10 | 11 | -------------------------------------------------------------------------------- /kumuluzee-graphql-jpa-security/src/main/java/com/kumuluz/ee/samples/graphql_security/CustomerApp.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.graphql_security; 2 | 3 | import com.kumuluz.ee.graphql.GraphQLApplication; 4 | import com.kumuluz.ee.graphql.annotations.GraphQLApplicationClass; 5 | 6 | import javax.annotation.security.DeclareRoles; 7 | 8 | @GraphQLApplicationClass 9 | @DeclareRoles({"user", "admin"}) 10 | public class CustomerApp extends GraphQLApplication { 11 | } 12 | -------------------------------------------------------------------------------- /kumuluzee-graphql-jpa-security/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-graphql-jpa-security/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | jdbc/CustomersDS 10 | 11 | com.kumuluz.ee.samples.graphql_security.Customer 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /kumuluzee-graphql-jpa-security/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | datasources: 3 | - jndi-name: jdbc/CustomersDS 4 | connection-url: jdbc:postgresql://localhost:5432/customers 5 | username: postgres 6 | password: postgres 7 | pool: 8 | max-size: 20 9 | 10 | security: 11 | keycloak: 12 | json: '{ 13 | "realm": "customers-realm", 14 | "bearer-only": true, 15 | "auth-server-url": "http://localhost:8082/auth", 16 | "ssl-required": "external", 17 | "resource": "customers-api", 18 | "confidential-port": 0 19 | }' 20 | -------------------------------------------------------------------------------- /kumuluzee-graphql-jpa-simple/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-graphql-jpa-simple/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | jdbc/CustomersDS 10 | 11 | com.kumuluz.ee.samples.graphql_simple.Customer 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /kumuluzee-graphql-jpa-simple/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | datasources: 3 | - jndi-name: jdbc/CustomersDS 4 | connection-url: jdbc:postgresql://localhost:5432/customers 5 | username: postgres 6 | password: postgres 7 | pool: 8 | max-size: 20 9 | -------------------------------------------------------------------------------- /kumuluzee-grpc/README.md: -------------------------------------------------------------------------------- 1 | # KumuluzEE gRPC 2 | 3 | > Samples for KumuluzEE gRPC extension 4 | 5 | This module contains two samples that will introduce you to KumuluzEE gRPC extension: 6 | - [grpc-server](grpc-server) gRPC server microservice 7 | - [grpc-client](grpc-client) gRPC client microservice 8 | 9 | More information about the samples can be found in the README of each sample. -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-client/src/main/java/Example.java: -------------------------------------------------------------------------------- 1 | import client.UserServiceClient; 2 | 3 | import javax.enterprise.context.ApplicationScoped; 4 | import javax.enterprise.context.Initialized; 5 | import javax.enterprise.event.Observes; 6 | import javax.inject.Inject; 7 | import java.util.logging.Logger; 8 | 9 | @ApplicationScoped 10 | public class Example { 11 | 12 | private final static Logger logger = Logger.getLogger(Example.class.getName()); 13 | 14 | @Inject 15 | UserServiceClient userClient; 16 | 17 | public void init(@Observes @Initialized(ApplicationScoped.class) Object o){ 18 | logger.info("Example initialized"); 19 | userClient.getUser(1); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-client/src/main/proto/user_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "client"; 3 | 4 | service User { 5 | rpc getUser(UserRequest) returns (UserResponse) {}; 6 | } 7 | 8 | message UserRequest { 9 | int32 id = 1; 10 | } 11 | 12 | message UserResponse { 13 | int32 id = 1; 14 | string name = 2; 15 | string surname = 3; 16 | } -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-client/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-client/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: "grpc client test" 3 | server: 4 | http: 5 | port: 8082 6 | grpc: 7 | clients: 8 | - name: client1 9 | port: 8081 10 | address: localhost 11 | -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM isuper/java-oracle 2 | 3 | COPY target /usr/src/myapp 4 | 5 | WORKDIR /usr/src/myapp 6 | 7 | EXPOSE 8443 8 | 9 | CMD ["java", "-jar", "grpc-server-1.0-SNAPSHOT.jar"] -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-server/src/main/java/beans/UserBean.java: -------------------------------------------------------------------------------- 1 | package beans; 2 | 3 | import entity.User; 4 | 5 | import javax.annotation.PostConstruct; 6 | import javax.enterprise.context.ApplicationScoped; 7 | import javax.persistence.EntityManager; 8 | import javax.persistence.PersistenceContext; 9 | import java.util.logging.Logger; 10 | 11 | @ApplicationScoped 12 | public class UserBean { 13 | 14 | private static final Logger logger = Logger.getLogger(UserBean.class.getName()); 15 | 16 | @PersistenceContext(name = "sample-user-jpa") 17 | private EntityManager em; 18 | 19 | @PostConstruct 20 | private void init() { 21 | logger.info("UserBean initialized"); 22 | } 23 | 24 | public User getUser(Integer id) { 25 | return em.find(User.class, id); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-server/src/main/java/entity/User.java: -------------------------------------------------------------------------------- 1 | package entity; 2 | 3 | import javax.persistence.*; 4 | 5 | @Entity 6 | @Table(name = "account") 7 | public class User { 8 | 9 | @Id 10 | @GeneratedValue(strategy = GenerationType.IDENTITY) 11 | private Integer id; 12 | private String name; 13 | private String surname; 14 | 15 | public String getSurname() { 16 | return surname; 17 | } 18 | 19 | public void setSurname(String surname) { 20 | this.surname = surname; 21 | } 22 | 23 | public int getId() { 24 | return id; 25 | } 26 | 27 | public void setId(int id) { 28 | this.id = id; 29 | } 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | public void setName(String name) { 36 | this.name = name; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-server/src/main/java/grpc/interceptors/HeaderInterceptor.java: -------------------------------------------------------------------------------- 1 | package grpc.interceptors; 2 | 3 | import io.grpc.*; 4 | 5 | import java.util.logging.Logger; 6 | 7 | public class HeaderInterceptor implements ServerInterceptor { 8 | 9 | private static final Logger logger = Logger.getLogger(HeaderInterceptor.class.getName()); 10 | 11 | static final Metadata.Key HEADER_KEY = Metadata.Key.of("server_header_key", Metadata.ASCII_STRING_MARSHALLER); 12 | 13 | @Override 14 | public ServerCall.Listener interceptCall(ServerCall serverCall, Metadata metadata, 15 | ServerCallHandler serverCallHandler) { 16 | 17 | logger.info("Header received from client " + metadata); 18 | return serverCallHandler.startCall(new ForwardingServerCall.SimpleForwardingServerCall(serverCall) { 19 | @Override 20 | public void sendHeaders(Metadata headers) { 21 | headers.put(HEADER_KEY, "respondValue"); 22 | super.sendHeaders(headers); 23 | } 24 | }, metadata); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-server/src/main/java/grpc/interceptors/HeaderInterceptor2.java: -------------------------------------------------------------------------------- 1 | package grpc.interceptors; 2 | 3 | import io.grpc.*; 4 | 5 | import java.util.logging.Logger; 6 | 7 | public class HeaderInterceptor2 implements ServerInterceptor { 8 | 9 | private static final Logger logger = Logger.getLogger(HeaderInterceptor.class.getName()); 10 | 11 | static final Metadata.Key HEADER_KEY = Metadata.Key.of("server_header_key", Metadata.ASCII_STRING_MARSHALLER); 12 | 13 | @Override 14 | public ServerCall.Listener interceptCall(ServerCall serverCall, Metadata metadata, 15 | ServerCallHandler serverCallHandler) { 16 | 17 | logger.info("Header received from client " + serverCall.getAuthority() + ": interceptor 2"); 18 | return serverCallHandler.startCall(new ForwardingServerCall.SimpleForwardingServerCall(serverCall) { 19 | @Override 20 | public void sendHeaders(Metadata headers) { 21 | headers.put(HEADER_KEY, "respondValue"); 22 | super.sendHeaders(headers); 23 | } 24 | }, metadata); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-server/src/main/proto/user_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "grpc"; 3 | 4 | service User { 5 | rpc getUser(UserRequest) returns (UserResponse) {}; 6 | } 7 | 8 | message UserRequest { 9 | int32 id = 1; 10 | } 11 | 12 | message UserResponse { 13 | int32 id = 1; 14 | string name = 2; 15 | string surname = 3; 16 | } -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-server/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-server/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | jdbc/UsersDB 10 | 11 | entity.User 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-server/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: "grpc-server" 3 | server: 4 | http: 5 | port: 8080 6 | datasources: 7 | - jndi-name: jdbc/UsersDB 8 | connection-url: jdbc:postgresql://192.168.99.100:5432/users 9 | username: postgres 10 | password: postgres 11 | grpc: 12 | server: 13 | http: 14 | port: 8081 15 | auth: 16 | public-key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDW6Angsf0Ry+GFD5HPstdcuaHJU5KhpT+gkzCCx7zZAbKRaEQexaTA9nPXK2Uzk2JqWTbZXSQYX2kBzYeiiedMpW6wvTaZWL9QhGjEnA9o97oNV1G5wQHKL/8FsvLXqt/81BCeZzWPDGvLNuU9l0qK3/xXL3efaZYPsZkB2AyZiQIDAQAB 17 | issuer: http://localhost -------------------------------------------------------------------------------- /kumuluzee-grpc/grpc-server/src/main/resources/sql-script/init-db.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO account (name, surname) VALUES ('Primoz', 'Hrovat'); -------------------------------------------------------------------------------- /kumuluzee-grpc/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | kumuluzee-samples 8 | com.kumuluz.ee.samples 9 | 3.13.0-SNAPSHOT 10 | 11 | 4.0.0 12 | pom 13 | 14 | kumuluzee-grpc 15 | 16 | KumuluzEE gRPC Sample 17 | Sample for KumuluzEE microservice with gRPC communication. 18 | 19 | 20 | grpc-server 21 | grpc-client 22 | 23 | 24 | 25 | 1.1.0 26 | 1.8 27 | 1.8 28 | 1.18.0 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /kumuluzee-health/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-health/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | jdbc/CustomersDS 10 | 11 | com.kumuluz.ee.samples.health.Customer 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /kumuluzee-health/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | datasources: 3 | - jndi-name: jdbc/CustomersDS 4 | connection-url: jdbc:postgresql://localhost:5432/customers 5 | username: postgres 6 | password: postgres 7 | pool: 8 | max-size: 20 9 | health: 10 | servlet: 11 | mapping: /health 12 | enabled: true 13 | logs: 14 | enabled: true 15 | level: INFO 16 | period-s: 30 17 | checks: 18 | data-source-health-check: 19 | jndi-name: jdbc/CustomersDS 20 | disk-space-health-check: 21 | threshold: 100000000 -------------------------------------------------------------------------------- /kumuluzee-health/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-jcache/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /kumuluzee-jcache/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: kumuluzee-jcache 3 | version: 1.0.0 4 | env: 5 | name: dev 6 | jcache: 7 | enabled: true 8 | caffeine: 9 | caffeine.jcache: 10 | default: 11 | policy: 12 | eager-expiration: 13 | after-write: "10s" 14 | maximum: 15 | size: 10000 16 | invoices: 17 | key-type: java.lang.String 18 | value-type: com.kumuluz.ee.samples.jcache.rest.lib.InvoiceData 19 | policy: 20 | eager-expiration: 21 | after-write: "15s" 22 | maximum: 23 | size: 2 -------------------------------------------------------------------------------- /kumuluzee-jcache/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /kumuluzee-jcache/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-logs-fluentd/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-logs-fluentd/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: fluentd-sample 3 | env: 4 | name: dev 5 | version: 1.0.0 6 | logs: 7 | fluentd: 8 | hostname: localhost 9 | port: 24224 10 | -------------------------------------------------------------------------------- /kumuluzee-logs-jul/src/main/resources/logging.properties: -------------------------------------------------------------------------------- 1 | # Default global logging level 2 | .level=FINER 3 | 4 | # ConsoleHandler definition 5 | handlers=java.util.logging.ConsoleHandler 6 | 7 | # ConsoleHandler configuration settings 8 | java.util.logging.ConsoleHandler.level=FINER 9 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter -------------------------------------------------------------------------------- /kumuluzee-logs-jul/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-logs-log4j2/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: customer-service 3 | version: 1.0.0 4 | env: 5 | name: dev -------------------------------------------------------------------------------- /kumuluzee-logs-log4j2/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /kumuluzee-logs-log4j2/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-metrics/src/main/java/com/kumuluz/ee/samples/kumuluzee_metrics/CustomerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2017 Kumuluz and/or its affiliates 3 | * and other contributors as indicated by the @author tags and 4 | * the contributor list. 5 | * 6 | * Licensed under the MIT License (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * https://opensource.org/licenses/MIT 11 | * 12 | * The software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, express or 13 | * implied, including but not limited to the warranties of merchantability, 14 | * fitness for a particular purpose and noninfringement. in no event shall the 15 | * authors or copyright holders be liable for any claim, damages or other 16 | * liability, whether in an action of contract, tort or otherwise, arising from, 17 | * out of or in connection with the software or the use or other dealings in the 18 | * software. See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | package com.kumuluz.ee.samples.kumuluzee_metrics; 22 | 23 | import javax.ws.rs.ApplicationPath; 24 | import javax.ws.rs.core.Application; 25 | 26 | @ApplicationPath("v1") 27 | public class CustomerApplication extends Application { 28 | } 29 | -------------------------------------------------------------------------------- /kumuluzee-metrics/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /kumuluzee-metrics/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: metrics-sample 3 | version: 1.0.0 4 | env: 5 | name: dev 6 | metrics: 7 | logstash: 8 | enabled: false 9 | address: 127.0.0.1 10 | port: 5043 11 | period-s: 15 12 | logs: 13 | enabled: false 14 | period-s: 30 15 | level: INFO 16 | web-instrumentation: 17 | - name: metricsEndpoint 18 | url-pattern: /metrics/* 19 | - name: customersEndpoint 20 | url-pattern: /v1/customers/* 21 | -------------------------------------------------------------------------------- /kumuluzee-microProfile-1.2/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /kumuluzee-microProfile-1.2/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: microProfile-1.2-sample 3 | version: 1.0.0 4 | env: 5 | name: dev 6 | metrics: 7 | web-instrumentation: 8 | - name: customersEndpoint 9 | url-pattern: /v1/customers/* 10 | jwt-auth: 11 | public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnOTgnGBISzm3pKuG8QXMVm6eEuTZx8Wqc8D9gy7vArzyE5QC/bVJNFwlz... 12 | issuer: http://example.org/auth 13 | healthy: true -------------------------------------------------------------------------------- /kumuluzee-openapi-mp/src/main/java/com/kumuluz/ee/samples/openapi/Membership.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.openapi; 2 | 3 | public enum Membership { 4 | GOLD, SILVER 5 | } 6 | -------------------------------------------------------------------------------- /kumuluzee-openapi-mp/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | #context-path: /kumuluzee-openapi-mp/v1 4 | openapi-mp: 5 | enabled: true 6 | scan: 7 | packages: com.kumuluz.ee.samples.openapi,com.kumuluz.ee.samples.openapi.v2 8 | servlet: 9 | mapping: /openapi 10 | servers: https://example-api.com 11 | ui: 12 | server-auto-config: 13 | enabled: true 14 | original-uri-check: true 15 | enabled: true 16 | mapping: /openapi/ui 17 | scanning: 18 | debug: true 19 | -------------------------------------------------------------------------------- /kumuluzee-openapi-mp/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /kumuluzee-openapi/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | #context-path: /custom 4 | openapi: 5 | enabled: true 6 | #servlet: 7 | #mapping: "" 8 | #base-url: http://behind.proxy.example.com 9 | ui: 10 | enabled: true 11 | #mapping: /openapi/ui -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/alpha/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/alpha/Application.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.alpha; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | 5 | @ApplicationPath("v1") 6 | public class Application extends javax.ws.rs.core.Application { 7 | } 8 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/alpha/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/alpha/Resource.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.alpha; 2 | 3 | import javax.ws.rs.Consumes; 4 | import javax.ws.rs.GET; 5 | import javax.ws.rs.Path; 6 | import javax.ws.rs.Produces; 7 | import javax.ws.rs.client.Client; 8 | import javax.ws.rs.client.ClientBuilder; 9 | import javax.ws.rs.core.MediaType; 10 | import javax.ws.rs.core.Response; 11 | 12 | @Path("alpha") 13 | @Consumes(MediaType.APPLICATION_JSON) 14 | @Produces(MediaType.APPLICATION_JSON) 15 | public class Resource { 16 | private Client client = ClientBuilder.newClient(); 17 | 18 | @GET 19 | public Response get() { 20 | return Response.ok("alpha").build(); 21 | } 22 | 23 | @GET 24 | @Path("beta") 25 | public Response get2() { 26 | Response r = client 27 | .target("http://localhost:8083/v1") 28 | .path("gamma") 29 | .request() 30 | .get(); 31 | String response = r.readEntity(String.class); 32 | return Response.ok("alpha->" + response).build(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/alpha/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/alpha/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | http: 4 | port: 8081 -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/beta/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/beta/Application.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.beta; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | 5 | @ApplicationPath("v1") 6 | public class Application extends javax.ws.rs.core.Application { 7 | } 8 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/beta/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/beta/Resource.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.beta; 2 | 3 | import javax.ws.rs.Consumes; 4 | import javax.ws.rs.GET; 5 | import javax.ws.rs.Path; 6 | import javax.ws.rs.Produces; 7 | import javax.ws.rs.client.Client; 8 | import javax.ws.rs.client.ClientBuilder; 9 | import javax.ws.rs.core.MediaType; 10 | import javax.ws.rs.core.Response; 11 | import java.util.concurrent.ThreadLocalRandom; 12 | 13 | @Path("beta") 14 | @Consumes(MediaType.APPLICATION_JSON) 15 | @Produces(MediaType.APPLICATION_JSON) 16 | public class Resource { 17 | private Client client = ClientBuilder.newClient(); 18 | 19 | @GET 20 | public Response get() { 21 | try { 22 | Thread.sleep(ThreadLocalRandom.current().nextInt(1, 1000 + 1)); 23 | Response r1 = client 24 | .target("http://localhost:8081/v1") //alpha 25 | .path("alpha") 26 | .path("beta") 27 | .request() 28 | .get(); 29 | String response = r1.readEntity(String.class); 30 | return Response.ok("beta->" + response).build(); 31 | } catch (Exception e) { 32 | return Response.serverError().build(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/beta/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/beta/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | http: 4 | port: 8082 -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/delta/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/delta/Application.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.delta; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | 5 | @ApplicationPath("v1") 6 | public class Application extends javax.ws.rs.core.Application { 7 | } 8 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/delta/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/delta/Resource.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.delta; 2 | 3 | import javax.ws.rs.Consumes; 4 | import javax.ws.rs.GET; 5 | import javax.ws.rs.Path; 6 | import javax.ws.rs.Produces; 7 | import javax.ws.rs.core.MediaType; 8 | import javax.ws.rs.core.Response; 9 | 10 | @Path("delta") 11 | @Consumes(MediaType.APPLICATION_JSON) 12 | @Produces(MediaType.APPLICATION_JSON) 13 | public class Resource { 14 | 15 | @GET 16 | public Response get() { 17 | return Response.ok("delta").build(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/delta/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/delta/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | http: 4 | port: 8084 -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumuluz/kumuluzee-samples/ecd51a3c87d587ef0f11403311dc6e4f4d2aa308/kumuluzee-opentracing-tutorial/diagram.png -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/gamma/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/gamma/Application.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.gamma; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | 5 | @ApplicationPath("v1") 6 | public class Application extends javax.ws.rs.core.Application { 7 | } 8 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/gamma/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/gamma/Database.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.gamma; 2 | 3 | import javax.annotation.PostConstruct; 4 | import javax.enterprise.context.ApplicationScoped; 5 | import java.util.HashMap; 6 | 7 | @ApplicationScoped 8 | public class Database { 9 | private HashMap data; 10 | 11 | @PostConstruct 12 | private void init() { 13 | data = new HashMap(); 14 | data.put(1, "gamma"); 15 | } 16 | 17 | public String get(Integer id) { 18 | return data.get(id); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/gamma/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/gamma/Resource.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.gamma; 2 | 3 | import javax.enterprise.context.ApplicationScoped; 4 | import javax.inject.Inject; 5 | import javax.ws.rs.*; 6 | import javax.ws.rs.client.Client; 7 | import javax.ws.rs.client.ClientBuilder; 8 | import javax.ws.rs.core.MediaType; 9 | import javax.ws.rs.core.Response; 10 | 11 | @Path("gamma") 12 | @Consumes(MediaType.APPLICATION_JSON) 13 | @Produces(MediaType.APPLICATION_JSON) 14 | @ApplicationScoped 15 | public class Resource { 16 | private Client client = ClientBuilder.newClient(); 17 | 18 | @Inject 19 | private Database database; 20 | 21 | @GET 22 | public Response get() { 23 | Response r = client 24 | .target("http://localhost:8084/v1") 25 | .path("delta") 26 | .request() 27 | .get(); 28 | String response = r.readEntity(String.class); 29 | return Response.ok( database.get(1) + "->" + response).build(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/gamma/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/gamma/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | http: 4 | port: 8083 -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/master/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/master/Application.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.master; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | 5 | @ApplicationPath("v1") 6 | public class Application extends javax.ws.rs.core.Application { 7 | } 8 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/master/src/main/java/com/kumuluz/ee/samples/opentracing/tutorial/master/Resource.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.opentracing.tutorial.master; 2 | 3 | import javax.ws.rs.Consumes; 4 | import javax.ws.rs.GET; 5 | import javax.ws.rs.Path; 6 | import javax.ws.rs.Produces; 7 | import javax.ws.rs.client.Client; 8 | import javax.ws.rs.client.ClientBuilder; 9 | import javax.ws.rs.core.MediaType; 10 | import javax.ws.rs.core.Response; 11 | 12 | @Path("master") 13 | @Consumes(MediaType.APPLICATION_JSON) 14 | @Produces(MediaType.APPLICATION_JSON) 15 | public class Resource { 16 | private Client client = ClientBuilder.newClient(); 17 | 18 | @GET 19 | public Response get() { 20 | Response r1 = client 21 | .target("http://localhost:8081/v1") //alpha 22 | .path("alpha") 23 | .request() 24 | .get(); 25 | Response r2 = client 26 | .target("http://localhost:8082/v1") //beta 27 | .path("beta") 28 | .request() 29 | .get(); 30 | String response1 = r1.readEntity(String.class); 31 | String response2 = r2.readEntity(String.class); 32 | return Response.ok("master->" + response1 + " --- " + "master->" + response2).build(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/master/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/master/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | http: 4 | port: 8080 -------------------------------------------------------------------------------- /kumuluzee-opentracing-tutorial/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-samples 7 | com.kumuluz.ee.samples 8 | 3.13.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | kumuluzee-opentracing-tutorial 13 | pom 14 | 15 | KumuluzEE OpenTracing tutorial 16 | Sample project for blog tutorial 17 | 18 | 19 | master 20 | alpha 21 | beta 22 | gamma 23 | delta 24 | 25 | 26 | 27 | 1.3.1 28 | 29 | 30 | -------------------------------------------------------------------------------- /kumuluzee-opentracing/customers/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-opentracing/customers/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: Customers Microservice 3 | server: 4 | http: 5 | port: 3000 6 | opentracing: 7 | jaeger: 8 | agent-host: localhost 9 | agent-port: 5775 10 | zipkin: 11 | agent-host: http://localhost 12 | agent-port: 9411 13 | 14 | mp: 15 | opentracing: 16 | server: 17 | operation-name-provider: http-path 18 | skip-pattern: /openapi.*|/health.* -------------------------------------------------------------------------------- /kumuluzee-opentracing/orders/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-opentracing/orders/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: Orders Microservice 3 | server: 4 | http: 5 | port: 3001 6 | opentracing: 7 | jaeger: 8 | agent-host: localhost 9 | agent-port: 5775 10 | zipkin: 11 | agent-host: http://localhost 12 | agent-port: 9411 13 | 14 | mp: 15 | opentracing: 16 | server: 17 | operation-name-provider: class-method 18 | skip-pattern: /openapi.*|/health.* -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/README.md: -------------------------------------------------------------------------------- 1 | # KumuluzEE Reactive samples using Vert.x 2 | 3 | > Samples for KumuluzEE Reactive Vert.x extension 4 | 5 | This module contains four samples that will introduce you to KumuluzEE Reactive extension using Vert.x: 6 | 7 | - [`kumuluzee-reactive-vertx-publisher`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-publisher) Microservice that publishes messages to Vert.x event bus 8 | 9 | - [`kumuluzee-reactive-vertx-listener`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-listener) Microservice that listens to messages on Vert.x event bus 10 | 11 | - [`kumuluzee-reactive-vertx-bridge`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-bridge) Microservice that acts as a bridge between KumuluzEE Discovery and Vert.x Service Discovery 12 | 13 | - [`simple-verticles`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-reactive-vertx/simple-verticles) Simple verticle samples for publishing, listening and service discovery 14 | 15 | More information about the samples can be found in the README of each sample. 16 | 17 | -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-bridge/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-bridge/src/main/resources/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-bridge/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: vertx-bridge 3 | version: 1.0.0 4 | env: 5 | name: dev 6 | server: 7 | base-url: http://localhost:8080 8 | http: 9 | port: 8080 10 | discovery: 11 | etcd: 12 | hosts: http://localhost:2379 13 | ttl: 20 14 | ping-interval: 15 15 | reactive: 16 | vertx: 17 | clustered: true 18 | cluster-host: localhost 19 | cluster-port: 0 20 | discovery: 21 | env: 22 | name: dev 23 | ttl: 20 24 | ping-interval: 15 -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-listener/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-listener/src/main/resources/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-listener/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: vertx-listener 3 | version: 1.0.0 4 | env: 5 | name: dev 6 | server: 7 | http: 8 | port: 8081 9 | ttl: 20 10 | ping-interval: 15 11 | reactive: 12 | vertx: 13 | clustered: true 14 | cluster-host: localhost 15 | cluster-port: 0 -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-publisher/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-publisher/src/main/resources/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/kumuluzee-reactive-vertx-publisher/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: vertx-publisher 3 | version: 1.0.0 4 | server: 5 | http: 6 | port: 8080 7 | reactive: 8 | vertx: 9 | clustered: true 10 | cluster-host: localhost 11 | cluster-port: 0 -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/simple-verticles/README.md: -------------------------------------------------------------------------------- 1 | # Simple Verticle samples 2 | 3 | > Simple verticle samples for KumuluzEE Reactive Vert.x extension 4 | 5 | This module contains two samples that can be used with microservices which contain the KumuluzEE Reactive Vert.x extension: 6 | 7 | - [`verticle-publisher`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-reactive-vertx//simple-verticles/verticle-publisher) Verticle that publishes messages to Vert.x event bus 8 | 9 | - [`verticle-listener`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-reactive-vertx/simple-verticles/verticle-listener) Verticle that listens to messages on Vert.x event bus 10 | 11 | - [`verticle-discovery`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-reactive-vertx/simple-verticles/verticle-discovery) Verticle that registers and discovers a service -------------------------------------------------------------------------------- /kumuluzee-reactive-vertx/simple-verticles/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-reactive-vertx 7 | com.kumuluz.ee.samples 8 | 3.13.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | simple-verticles 13 | pom 14 | 15 | 16 | verticle-discovery 17 | verticle-listener 18 | verticle-publisher 19 | 20 | 21 | -------------------------------------------------------------------------------- /kumuluzee-rest-client/src/main/java/com/kumuluz/ee/samples/kumuluzee_rest_client/exceptions/SensitiveDataException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2017 Kumuluz and/or its affiliates 3 | * and other contributors as indicated by the @author tags and 4 | * the contributor list. 5 | * 6 | * Licensed under the MIT License (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * https://opensource.org/licenses/MIT 11 | * 12 | * The software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, express or 13 | * implied, including but not limited to the warranties of merchantability, 14 | * fitness for a particular purpose and noninfringement. in no event shall the 15 | * authors or copyright holders be liable for any claim, damages or other 16 | * liability, whether in an action of contract, tort or otherwise, arising from, 17 | * out of or in connection with the software or the use or other dealings in the 18 | * software. See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | package com.kumuluz.ee.samples.kumuluzee_rest_client.exceptions; 22 | 23 | /** 24 | * @author Urban Malc 25 | * @since 3.1.0 26 | */ 27 | public class SensitiveDataException extends RuntimeException { 28 | } 29 | -------------------------------------------------------------------------------- /kumuluzee-rest-client/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /kumuluzee-rest-client/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | http: 4 | port: 8081 5 | 6 | rest-client: 7 | propagate-headers: Authorization 8 | registrations: 9 | - class: com.kumuluz.ee.samples.kumuluzee_rest_client.api.CustomerApi 10 | url: http://localhost:8080/v1 11 | -------------------------------------------------------------------------------- /kumuluzee-rest/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-rest/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | jdbc/CustomersDS 10 | 11 | com.kumuluz.ee.samples.rest.Customer 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /kumuluzee-rest/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | datasources: 3 | - jndi-name: jdbc/CustomersDS 4 | connection-url: jdbc:postgresql://localhost:5432/customers 5 | username: postgres 6 | password: postgres 7 | pool: 8 | max-size: 20 -------------------------------------------------------------------------------- /kumuluzee-rest/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-security-cdi-keycloak/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-security-cdi-keycloak/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: customer-service 3 | env: 4 | name: dev 5 | version: 1.0.0 6 | server: 7 | base-url: http://localhost:8080 8 | http: 9 | port: 8080 10 | security: 11 | keycloak: 12 | json: '{ 13 | "realm": "customers-realm", 14 | "bearer-only": true, 15 | "auth-server-url": "http://localhost:8082/auth", 16 | "ssl-required": "external", 17 | "resource": "customers-api", 18 | "confidential-port": 0 19 | }' -------------------------------------------------------------------------------- /kumuluzee-security-cdi-keycloak/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-security-keycloak/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: customer-service 3 | env: 4 | name: dev 5 | version: 1.0.0 6 | server: 7 | base-url: http://localhost:8080 8 | http: 9 | port: 8080 10 | security: 11 | keycloak: 12 | json: '{ 13 | "realm": "customers-realm", 14 | "bearer-only": true, 15 | "auth-server-url": "http://localhost:8082/auth", 16 | "ssl-required": "external", 17 | "resource": "customers-api", 18 | "confidential-port": 0 19 | }' -------------------------------------------------------------------------------- /kumuluzee-security-keycloak/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/.gitignore: -------------------------------------------------------------------------------- 1 | tmp/ 2 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-consumer/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-consumer/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | http: 4 | port: 8079 5 | streaming: 6 | kafka: 7 | consumer-avro: 8 | bootstrap-servers: localhost:29092 9 | group-id: group1 10 | enable-auto-commit: true 11 | auto-commit-interval-ms: 1000 12 | auto-offset-reset: latest 13 | key-deserializer: org.apache.kafka.common.serialization.StringDeserializer 14 | value-deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer 15 | schema-registry-url: http://localhost:8081 16 | specific-avro-reader: true -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-consumer/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-consumer/src/main/resources/schemas/avro/pricing-avro-value.avsc: -------------------------------------------------------------------------------- 1 | {"type":"record","name":"Pricing","namespace":"com.kumuluz.ee.samples.kafka.registry.avro.lib","fields":[{"name":"price","type":"string"},{"name":"priceExTax","type":"string"},{"name":"basePrice","type":"string"},{"name":"taxAmount","type":"string"},{"name":"description","type":"string"}]} -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-producer/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-producer/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | streaming: 3 | kafka: 4 | producer-avro: 5 | bootstrap-servers: localhost:29092 6 | key-serializer: org.apache.kafka.common.serialization.StringSerializer 7 | value-serializer: io.confluent.kafka.serializers.KafkaAvroSerializer 8 | schema-registry-url: http://localhost:8081 9 | auto-register-schemas: false -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-producer/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-producer/src/main/resources/schemas/avro/v1.0.0/pricing.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "namespace": "com.kumuluz.ee.samples.kafka.registry.avro.lib", 3 | "type": "record", 4 | "name": "Pricing", 5 | "fields": [ 6 | {"name": "price", "type": "string"}, 7 | {"name": "priceExTax", "type": "string"}, 8 | {"name": "basePrice", "type": "string"}, 9 | {"name": "taxAmount", "type": "string"}, 10 | {"name": "description", "type": "string"} 11 | ] 12 | } -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-producer/src/main/resources/schemas/avro/v2.0.0/pricing.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "namespace": "com.kumuluz.ee.samples.kafka.registry.avro.lib", 3 | "type": "record", 4 | "name": "Pricing", 5 | "fields": [ 6 | {"name": "price", "type": "string"}, 7 | {"name": "priceExTax", "type": "string"}, 8 | {"name": "basePrice", "type": "string"}, 9 | {"name": "taxAmount", "type": "string"}, 10 | {"name": "description", "type": "string"}, 11 | {"name": "taxPercentRequired", "type": "string"}, 12 | {"name": "taxPercentOptional", "type": "string", "default": "undefined"} 13 | ] 14 | } -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-streams/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-streams/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | server: 3 | http: 4 | port: 8078 5 | streaming: 6 | kafka: 7 | streams-avro: 8 | bootstrap-servers: localhost:29092 9 | application-id: sample-price-sum 10 | default-key-serde: org.apache.kafka.common.serialization.Serdes$StringSerde 11 | default-value-serde: org.apache.kafka.common.serialization.Serdes$StringSerde 12 | commit-interval-ms: 500 13 | schema-registry-url: http://localhost:8081 14 | specific-avro-reader: true 15 | auto-register-schemas: false -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-streams/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-streams/src/main/resources/schemas/avro/pricing-avro-value.avsc: -------------------------------------------------------------------------------- 1 | {"type":"record","name":"Pricing","namespace":"com.kumuluz.ee.samples.kafka.registry.avro.lib","fields":[{"name":"price","type":"string"},{"name":"priceExTax","type":"string"},{"name":"basePrice","type":"string"},{"name":"taxAmount","type":"string"},{"name":"description","type":"string"}]} -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka-registry/kumuluzee-streaming-kafka-registry-streams/src/main/resources/schemas/avro/sum.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "namespace": "com.kumuluz.ee.samples.kafka.registry.avro.lib", 3 | "type": "record", 4 | "name": "Sum", 5 | "fields": [ 6 | {"name": "sum", "type": "string"} 7 | ] 8 | } -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/README.md: -------------------------------------------------------------------------------- 1 | # KumuluzEE Event Streaming samples using Kafka 2 | 3 | > Samples for KumuluzEE Event Streaming Kafka project 4 | 5 | This module contains three samples that will introduce you to KumuluzEE 6 | Event Streaming project using Kafka: 7 | 8 | - [`kumuluzee-streaming-kafka-producer`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-producer) Kafka message producer microservice that produces messages 9 | - [`kumuluzee-streaming-kafka-consumer`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-consumer) Kafka message consumer microservice that consumes messages 10 | - [`kumuluzee-streaming-kafka-streams`](https://github.com/kumuluz/kumuluzee-samples/tree/master/kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-streams) Kafka Streams microservice for stream processing 11 | 12 | More information about the samples can be found in the README of each sample. 13 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-consumer/src/main/java/com/kumuluz/ee/samples/kafka/consumer/ConsumerApplication.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.kumuluz.ee.samples.kafka.consumer; 4 | 5 | import javax.ws.rs.ApplicationPath; 6 | import javax.ws.rs.core.Application; 7 | 8 | /** 9 | * @author Matija Kljun 10 | */ 11 | @ApplicationPath("v1") 12 | public class ConsumerApplication extends Application { 13 | } -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-consumer/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-consumer/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | streaming: 3 | kafka: 4 | consumer: 5 | bootstrap-servers: localhost:9092 6 | group-id: group1 7 | enable-auto-commit: true 8 | auto-commit-interval-ms: 1000 9 | auto-offset-reset: earliest 10 | key-deserializer: org.apache.kafka.common.serialization.StringDeserializer 11 | value-deserializer: org.apache.kafka.common.serialization.StringDeserializer -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-consumer/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-producer/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-producer/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | streaming: 3 | kafka: 4 | producer: 5 | bootstrap-servers: localhost:9092 6 | acks: all 7 | retries: 0 8 | batch-size: 16384 9 | linger-ms: 1 10 | buffer-memory: 33554432 11 | key-serializer: org.apache.kafka.common.serialization.StringSerializer 12 | value-serializer: org.apache.kafka.common.serialization.StringSerializer -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-producer/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-streams/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-streams/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | streaming: 3 | kafka: 4 | streams: 5 | bootstrap-servers: localhost:9092 6 | application-id: sample-word-count 7 | default-key-serde: org.apache.kafka.common.serialization.Serdes$StringSerde 8 | default-value-serde: org.apache.kafka.common.serialization.Serdes$StringSerde 9 | commit-interval-ms: 500 -------------------------------------------------------------------------------- /kumuluzee-streaming-kafka/kumuluzee-streaming-kafka-streams/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /kumuluzee-swagger/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jre-alpine 2 | 3 | RUN mkdir /app 4 | 5 | WORKDIR /app 6 | 7 | ADD ./target/classes /app/classes 8 | ADD ./target/dependency /app/dependency 9 | 10 | EXPOSE 8080 11 | 12 | CMD ["java", "-cp", "classes:dependency/*", "com.kumuluz.ee.EeApplication"] 13 | -------------------------------------------------------------------------------- /kumuluzee-swagger/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /kumuluzee-swagger/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: customer-service 3 | env: 4 | name: dev 5 | version: 1.0.0 6 | server: 7 | base-url: http://localhost:8080 8 | http: 9 | port: 8080 10 | swagger: 11 | enabled: true 12 | ui: 13 | enabled: true -------------------------------------------------------------------------------- /kumuluzee-swagger/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /kumuluzee-version/src/main/resources/VERSION.json: -------------------------------------------------------------------------------- 1 | { 2 | "maven_group_id": "${project.groupId}", 3 | "maven_artifact_id": "${project.parent.artifactId}", 4 | "maven_version": "${project.version}", 5 | "project_artifactId": "${project.artifactId}", 6 | "git_commit_id": "${buildNumber}" 7 | } -------------------------------------------------------------------------------- /kumuluzee-version/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: customer-service 3 | version: 1.0.0 4 | env: 5 | name: dev 6 | version-info: 7 | endpoint: /version 8 | values: 9 | docker-image-name: my_docker_image -------------------------------------------------------------------------------- /microservices-simple/catalogue/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /microservices-simple/catalogue/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | datasources: 3 | - jndi-name: jdbc/BooksDS 4 | connection-url: jdbc:postgresql://localhost:5432/postgres 5 | username: postgres 6 | password: postgres 7 | pool: 8 | max-size: 20 -------------------------------------------------------------------------------- /microservices-simple/catalogue/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /microservices-simple/models/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | microservices-simple 7 | com.kumuluz.ee.samples 8 | 3.13.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | microservices-simple-models 13 | 14 | Simple microservices sample with KumuluzEE models 15 | Models sample using KumuluzEE using a shared database module 16 | 17 | 18 | 19 | com.kumuluz.ee 20 | kumuluzee-jpa-eclipselink 21 | 22 | 23 | 24 | org.postgresql 25 | postgresql 26 | 42.0.0 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /microservices-simple/models/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | jdbc/BooksDS 11 | 12 | com.kumuluz.ee.samples.microservices.simple.models.Book 13 | com.kumuluz.ee.samples.microservices.simple.models.Order 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /microservices-simple/orders/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /microservices-simple/orders/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | datasources: 3 | - jndi-name: jdbc/BooksDS 4 | connection-url: jdbc:postgresql://localhost:5432/postgres 5 | username: postgres 6 | password: postgres 7 | pool: 8 | max-size: 20 -------------------------------------------------------------------------------- /microservices-simple/orders/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /servlet/src/main/resources/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jre-alpine 2 | 3 | RUN mkdir /app 4 | 5 | WORKDIR /app 6 | 7 | ADD ./customers-api/target/customers-api-1.0.0-SNAPSHOT.jar /app 8 | 9 | EXPOSE 8080 10 | 11 | CMD ["java", "-jar", "customers-api-1.0.0-SNAPSHOT.jar"] -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-api/src/main/java/com/kumuluz/ee/samples/tutorial/customers/api/v1/CustomerApplication.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.api.v1; 2 | 3 | import javax.annotation.security.DeclareRoles; 4 | import javax.ws.rs.ApplicationPath; 5 | import javax.ws.rs.core.Application; 6 | 7 | @ApplicationPath("/v1") 8 | @DeclareRoles({"user", "admin"}) 9 | public class CustomerApplication extends Application { 10 | } 11 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-api/src/main/java/com/kumuluz/ee/samples/tutorial/customers/api/v1/dtos/Error.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.api.v1.dtos; 2 | 3 | public class Error { 4 | 5 | private Integer status; 6 | private String code; 7 | private String message; 8 | 9 | public Integer getStatus() { 10 | return status; 11 | } 12 | 13 | public void setStatus(Integer status) { 14 | this.status = status; 15 | } 16 | 17 | public String getCode() { 18 | return code; 19 | } 20 | 21 | public void setCode(String code) { 22 | this.code = code; 23 | } 24 | 25 | public String getMessage() { 26 | return message; 27 | } 28 | 29 | public void setMessage(String message) { 30 | this.message = message; 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-api/src/main/java/com/kumuluz/ee/samples/tutorial/customers/api/v1/exceptionmappers/NotFoundExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.api.v1.exceptionmappers; 2 | 3 | 4 | import com.kumuluz.ee.samples.tutorial.customers.api.v1.dtos.Error; 5 | 6 | import javax.enterprise.context.ApplicationScoped; 7 | import javax.ws.rs.NotFoundException; 8 | import javax.ws.rs.core.Response; 9 | import javax.ws.rs.ext.ExceptionMapper; 10 | import javax.ws.rs.ext.Provider; 11 | 12 | @Provider 13 | @ApplicationScoped 14 | public class NotFoundExceptionMapper implements ExceptionMapper { 15 | 16 | @Override 17 | public Response toResponse(NotFoundException e) { 18 | 19 | Error error = new Error(); 20 | error.setStatus(404); 21 | error.setCode("resource.not.found"); 22 | error.setMessage(e.getMessage()); 23 | 24 | return Response 25 | .status(Response.Status.NOT_FOUND) 26 | .entity(error) 27 | .build(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-api/src/main/java/com/kumuluz/ee/samples/tutorial/customers/api/v1/producers/JacksonProducer.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.api.v1.producers; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.fasterxml.jackson.databind.SerializationFeature; 5 | 6 | import javax.ws.rs.ext.ContextResolver; 7 | import javax.ws.rs.ext.Provider; 8 | import java.text.SimpleDateFormat; 9 | import java.util.TimeZone; 10 | 11 | @Provider 12 | public class JacksonProducer implements ContextResolver { 13 | 14 | private final ObjectMapper mapper; 15 | 16 | public JacksonProducer() { 17 | 18 | mapper = new ObjectMapper(); 19 | 20 | mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); 21 | 22 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); 23 | dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); 24 | mapper.setDateFormat(dateFormat); 25 | } 26 | 27 | @Override 28 | public ObjectMapper getContext(Class aClass) { 29 | return mapper; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-api/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-api/src/main/resources/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-business-logic/src/main/java/com/kumuluz/ee/samples/tutorial/customers/cdi/configuration/RestProperties.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.customers.cdi.configuration; 2 | 3 | import com.kumuluz.ee.configuration.cdi.ConfigBundle; 4 | import com.kumuluz.ee.configuration.cdi.ConfigValue; 5 | 6 | import javax.enterprise.context.ApplicationScoped; 7 | 8 | @ApplicationScoped 9 | @ConfigBundle("rest-properties") 10 | public class RestProperties { 11 | 12 | @ConfigValue(value = "external-dependencies.order-service.enabled", watch = true) 13 | private boolean orderServiceEnabled; 14 | 15 | public boolean isOrderServiceEnabled() { 16 | return orderServiceEnabled; 17 | } 18 | 19 | public void setOrderServiceEnabled(boolean orderServiceEnabled) { 20 | this.orderServiceEnabled = orderServiceEnabled; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-business-logic/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-persistence/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-tutorial-customers 7 | com.kumuluz.ee.samples.tutorial 8 | 1.0.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | customers-persistence 13 | 14 | 15 | 16 | 17 | com.kumuluz.ee.samples.tutorial 18 | orders-persistence 19 | 20 | 21 | 22 | com.kumuluz.ee 23 | kumuluzee-jpa-eclipselink 24 | 25 | 26 | 27 | org.postgresql 28 | postgresql 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-persistence/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jdbc/CustomersDS 5 | 6 | com.kumuluz.ee.samples.tutorial.customers.Customer 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/customers-persistence/src/main/resources/sql-scripts/init-customers.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO customer (id, date_of_birth, first_name, last_name, address) VALUES (1, TIMESTAMP '2006-01-01 15:36:38', 'James', 'Smith', '32 Threadneedle Street, London'); 2 | INSERT INTO customer (id, date_of_birth, first_name, last_name, address) VALUES (2, TIMESTAMP '2009-03-17 15:36:38', 'John', 'Williams', '21 Foster Lane, London'); 3 | INSERT INTO customer (id, date_of_birth, first_name, last_name, address) VALUES (3, TIMESTAMP '2013-11-29 15:36:38', 'Robert', 'Jones', '11 Ludgate Hill, London'); -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | postgres: 4 | image: postgres:latest 5 | environment: 6 | - POSTGRES_PASSWORD=postgres 7 | - POSTGRES_DB=customer 8 | ports: 9 | - "5432:5432" 10 | customer-service: 11 | image: customer-service:1.0.0 12 | environment: 13 | - KUMULUZEE_DATASOURCES0_CONNECTIONURL=jdbc:postgresql://postgres:5432/customer 14 | ports: 15 | - "8080:8080" 16 | depends_on: 17 | - postgres -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/customers/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | com.kumuluz.ee.samples.tutorial 9 | kumuluzee-tutorial 10 | 1.0.0-SNAPSHOT 11 | 12 | kumuluzee-tutorial-customers 13 | 14 | pom 15 | 16 | 17 | customers-api 18 | customers-business-logic 19 | customers-persistence 20 | 21 | 22 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/OrdersApplication.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1; 2 | 3 | import com.kumuluz.ee.discovery.annotations.RegisterService; 4 | 5 | import javax.ws.rs.ApplicationPath; 6 | import javax.ws.rs.core.Application; 7 | 8 | @ApplicationPath("/v1") 9 | @RegisterService 10 | public class OrdersApplication extends Application { 11 | } 12 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/dtos/Error.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1.dtos; 2 | 3 | public class Error { 4 | 5 | private Integer status; 6 | private String code; 7 | private String message; 8 | 9 | public Integer getStatus() { 10 | return status; 11 | } 12 | 13 | public void setStatus(Integer status) { 14 | this.status = status; 15 | } 16 | 17 | public String getCode() { 18 | return code; 19 | } 20 | 21 | public void setCode(String code) { 22 | this.code = code; 23 | } 24 | 25 | public String getMessage() { 26 | return message; 27 | } 28 | 29 | public void setMessage(String message) { 30 | this.message = message; 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/exceptionmappers/NotFoundExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1.exceptionmappers; 2 | 3 | 4 | import com.kumuluz.ee.samples.tutorial.orders.api.v1.dtos.Error; 5 | 6 | import javax.enterprise.context.ApplicationScoped; 7 | import javax.ws.rs.NotFoundException; 8 | import javax.ws.rs.core.Response; 9 | import javax.ws.rs.ext.ExceptionMapper; 10 | import javax.ws.rs.ext.Provider; 11 | 12 | @Provider 13 | @ApplicationScoped 14 | public class NotFoundExceptionMapper implements ExceptionMapper { 15 | 16 | @Override 17 | public Response toResponse(NotFoundException e) { 18 | 19 | Error error = new Error(); 20 | error.setStatus(404); 21 | error.setCode("resource.not.found"); 22 | error.setMessage(e.getMessage()); 23 | 24 | return Response 25 | .status(Response.Status.NOT_FOUND) 26 | .entity(error) 27 | .build(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-api/src/main/java/com/kumuluz/ee/samples/tutorial/orders/api/v1/producers/JacksonProducer.java: -------------------------------------------------------------------------------- 1 | package com.kumuluz.ee.samples.tutorial.orders.api.v1.producers; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.fasterxml.jackson.databind.SerializationFeature; 5 | 6 | import javax.ws.rs.ext.ContextResolver; 7 | import javax.ws.rs.ext.Provider; 8 | import java.text.SimpleDateFormat; 9 | import java.util.TimeZone; 10 | 11 | @Provider 12 | public class JacksonProducer implements ContextResolver { 13 | 14 | private final ObjectMapper mapper; 15 | 16 | public JacksonProducer() { 17 | 18 | mapper = new ObjectMapper(); 19 | 20 | mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); 21 | 22 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); 23 | dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); 24 | mapper.setDateFormat(dateFormat); 25 | } 26 | 27 | @Override 28 | public ObjectMapper getContext(Class aClass) { 29 | return mapper; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-api/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-api/src/main/resources/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-api/src/main/resources/config.yaml: -------------------------------------------------------------------------------- 1 | kumuluzee: 2 | name: order-service 3 | env: 4 | name: dev 5 | version: 1.0.0 6 | server: 7 | base-url: http://localhost:8081 8 | http: 9 | port: 8081 10 | datasources: 11 | - jndi-name: jdbc/OrdersDS 12 | connection-url: jdbc:postgresql://192.168.99.100:5433/order 13 | username: postgres 14 | password: postgres 15 | pool: 16 | max-size: 20 17 | discovery: 18 | etcd: 19 | hosts: http://192.168.99.100:2379 -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-business-logic/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-tutorial-orders 7 | com.kumuluz.ee.samples.tutorial 8 | 1.0.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | orders-business-logic 13 | 14 | 15 | 16 | com.kumuluz.ee 17 | kumuluzee-cdi-weld 18 | 19 | 20 | com.kumuluz.ee 21 | kumuluzee-jax-rs-jersey 22 | 23 | 24 | 25 | com.kumuluz.ee.samples.tutorial 26 | orders-persistence 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-business-logic/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-persistence/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | kumuluzee-tutorial-orders 7 | com.kumuluz.ee.samples.tutorial 8 | 1.0.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | orders-persistence 13 | 14 | 15 | 16 | com.kumuluz.ee 17 | kumuluzee-jpa-eclipselink 18 | 19 | 20 | com.kumuluz.ee.rest 21 | kumuluzee-rest-core 22 | 23 | 24 | 25 | org.postgresql 26 | postgresql 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-persistence/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jdbc/OrdersDS 5 | 6 | com.kumuluz.ee.samples.tutorial.orders.Order 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/orders-persistence/src/main/resources/sql-scripts/init-orders.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO orders (id, title, description, submitted, customer_id) VALUES (1, 'Keyboard', 'New mechanical keyboard.', TIMESTAMP '2017-03-01 11:23:38', 1); 2 | INSERT INTO orders (id, title, description, submitted, customer_id) VALUES (2, 'Mouse', 'Black mouse.', TIMESTAMP '2017-04-12 01:12:38', 1); 3 | INSERT INTO orders (id, title, description, submitted, customer_id) VALUES (3, 'Monitor', 'LCD monitor.', TIMESTAMP '2017-06-17 12:00:08', 3); -------------------------------------------------------------------------------- /tutorial-microservice-config-discovery-faulttolerance-logs-metrics-security/orders/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | com.kumuluz.ee.samples.tutorial 9 | kumuluzee-tutorial 10 | 1.0.0-SNAPSHOT 11 | 12 | kumuluzee-tutorial-orders 13 | 14 | pom 15 | 16 | 17 | orders-api 18 | orders-business-logic 19 | orders-persistence 20 | 21 | 22 | --------------------------------------------------------------------------------