├── event-cep ├── .dockerignore ├── Dockerfile ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── logback.xml │ │ │ └── camel-route-spring.xml │ │ └── java │ │ │ └── ws │ │ │ └── cogito │ │ │ └── microservices │ │ │ ├── EventCEPRouterApplication.java │ │ │ └── EventCEPRouteBuilder.java │ └── test │ │ ├── jmeter │ │ ├── resources │ │ │ ├── encounter2.json │ │ │ └── encounter3.json │ │ └── Mock Camel Publisher.jmx │ │ ├── resources │ │ ├── ws │ │ │ └── cogito │ │ │ │ └── microservices │ │ │ │ ├── encounter1.json │ │ │ │ ├── encounter2.json │ │ │ │ └── encounter3.json │ │ ├── logback.xml │ │ └── camel-route-spring.xml │ │ └── java │ │ └── ws │ │ └── cogito │ │ └── microservices │ │ └── EventCEPRouteBuilderTest.java ├── docker-compose.yml ├── README.md └── pom.xml ├── mock-saas ├── .dockerignore ├── Dockerfile ├── src │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── logback.xml │ │ └── java │ │ └── ws │ │ └── cogito │ │ └── test │ │ └── saas │ │ ├── Application.java │ │ └── EventController.java ├── README.md └── pom.xml ├── event-auditing ├── .dockerignore ├── Dockerfile ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── logback.xml │ │ │ └── camel-route-spring.xml │ │ └── java │ │ │ └── ws │ │ │ └── cogito │ │ │ └── microservices │ │ │ ├── EventAuditingRouterApplication.java │ │ │ └── EventAuditingRouteBuilder.java │ └── test │ │ ├── jmeter │ │ ├── resources │ │ │ ├── encounter1.json │ │ │ └── encounter2.json │ │ └── Mock Camel Publisher.jmx │ │ ├── resources │ │ ├── ws │ │ │ └── cogito │ │ │ │ └── microservices │ │ │ │ ├── encounter1.json │ │ │ │ ├── encounter2.json │ │ │ │ └── encounter3.json │ │ └── logback.xml │ │ └── java │ │ └── ws │ │ └── cogito │ │ └── microservices │ │ └── EventAuditingRouteBuilderTest.java ├── docker-compose.yml ├── README.md └── pom.xml ├── event-ingestion ├── .dockerignore ├── Dockerfile ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── logback.xml │ │ │ └── camel-route-spring.xml │ │ └── java │ │ │ └── ws │ │ │ └── cogito │ │ │ └── microservices │ │ │ ├── EventIngestionRouterApplication.java │ │ │ ├── CircuitBreakerOpenException.java │ │ │ └── EventIngestionRouteBuilder.java │ └── test │ │ ├── jmeter │ │ ├── resources │ │ │ ├── encounter1.json │ │ │ └── encounter2.json │ │ └── Mock Camel Publisher.jmx │ │ ├── resources │ │ ├── ws │ │ │ └── cogito │ │ │ │ └── microservices │ │ │ │ ├── encounter1.json │ │ │ │ ├── encounter2.json │ │ │ │ └── encounter3.json │ │ └── logback.xml │ │ └── java │ │ └── ws │ │ └── cogito │ │ └── microservices │ │ └── EventIngestionRouteBuilderTest.java ├── docker-compose.yml ├── README.md └── pom.xml ├── event-care-management ├── .dockerignore ├── Dockerfile ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── logback.xml │ │ │ └── camel-route-spring.xml │ │ └── java │ │ │ └── ws │ │ │ └── cogito │ │ │ └── microservices │ │ │ ├── EventCareManagementRouterApplication.java │ │ │ └── EventCareManagementRouteBuilder.java │ └── test │ │ ├── jmeter │ │ ├── resources │ │ │ ├── encounter1.json │ │ │ └── encounter2.json │ │ └── Mock Camel Publisher.jmx │ │ ├── resources │ │ ├── ws │ │ │ └── cogito │ │ │ │ └── microservices │ │ │ │ └── encounter2.json │ │ └── logback.xml │ │ └── java │ │ └── ws │ │ └── cogito │ │ └── microservices │ │ └── EventCareManagementRouteBuilderTest.java ├── docker-compose.yml ├── README.md └── pom.xml ├── .gitignore ├── event-common ├── README.md ├── src │ ├── test │ │ ├── resources │ │ │ ├── ws │ │ │ │ └── cogito │ │ │ │ │ └── microservices │ │ │ │ │ └── encounter1.json │ │ │ └── logback.xml │ │ └── java │ │ │ └── ws │ │ │ └── cogito │ │ │ └── microservices │ │ │ └── TrackingIdProcessorTest.java │ └── main │ │ └── java │ │ └── ws │ │ └── cogito │ │ └── microservices │ │ └── TrackingIdProcessor.java └── pom.xml ├── event-test-harness ├── Dockerfile ├── src │ └── main │ │ ├── resources │ │ ├── ws │ │ │ └── cogito │ │ │ │ └── test │ │ │ │ └── application │ │ │ │ ├── encounter1.json │ │ │ │ ├── encounter2.json │ │ │ │ └── encounter3.json │ │ ├── log4j.xml │ │ └── event-client-spring.xml │ │ └── java │ │ └── ws │ │ └── cogito │ │ └── test │ │ └── application │ │ └── EventClient.java ├── README.md └── pom.xml ├── docker-compose.yml ├── commands └── README.md /event-cep/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | .dockerignore 3 | 4 | .git 5 | .gitignore -------------------------------------------------------------------------------- /mock-saas/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | .dockerignore 3 | 4 | .git 5 | .gitignore -------------------------------------------------------------------------------- /event-auditing/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | .dockerignore 3 | 4 | .git 5 | .gitignore -------------------------------------------------------------------------------- /event-ingestion/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | .dockerignore 3 | 4 | .git 5 | .gitignore -------------------------------------------------------------------------------- /event-care-management/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | .dockerignore 3 | 4 | .git 5 | .gitignore -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #ignored files 2 | .classpath 3 | .project 4 | .settings/ 5 | target/ 6 | dependency-reduced-pom.xml 7 | .DS_Store -------------------------------------------------------------------------------- /event-common/README.md: -------------------------------------------------------------------------------- 1 | event-common 2 | ======================= 3 | 4 | Built with Java 8+ and Apache Camel (2.19.2) 5 | 6 | Tested with JUnit (4.11) 7 | 8 | Used to create or pass along Tracking ID via a Camel Processor -------------------------------------------------------------------------------- /mock-saas/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8u141-jdk-slim 2 | MAINTAINER jeremydeane.net 3 | EXPOSE 8080 4 | RUN mkdir /app/ 5 | COPY target/mock-saas-1.0.3.jar /app/ 6 | ENTRYPOINT exec java $JAVA_OPTS -jar /app/mock-saas-1.0.3.jar -------------------------------------------------------------------------------- /event-test-harness/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8u141-jdk-slim 2 | MAINTAINER jeremydeane.net 3 | RUN mkdir /app/ 4 | COPY target/event-client-1.0.2.jar /app/ 5 | ENTRYPOINT exec java -Dactivemq.hostname='event-broker' -jar /app/event-client-1.0.2.jar $PATIENT -------------------------------------------------------------------------------- /event-cep/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8u141-jdk-slim 2 | MAINTAINER jeremydeane.net 3 | EXPOSE 9004 4 | RUN mkdir /app/ 5 | COPY target/event-cep-router-1.0.4.jar /app/ 6 | ENTRYPOINT exec java $JAVA_OPTS -Dactivemq.hostname='event-broker' -jar /app/event-cep-router-1.0.4.jar -------------------------------------------------------------------------------- /event-care-management/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8u141-jdk-slim 2 | MAINTAINER jeremydeane.net 3 | EXPOSE 9003 4 | RUN mkdir /app/ 5 | COPY target/event-care-router-1.0.4.jar /app/ 6 | ENTRYPOINT exec java $JAVA_OPTS -Dactivemq.hostname='event-broker' -jar /app/event-care-router-1.0.4.jar -------------------------------------------------------------------------------- /event-ingestion/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8u141-jdk-slim 2 | MAINTAINER jeremydeane.net 3 | EXPOSE 9001 4 | RUN mkdir /app/ 5 | COPY target/event-ingestion-router-1.0.4.jar /app/ 6 | ENTRYPOINT exec java $JAVA_OPTS -Dactivemq.hostname='event-broker' -jar /app/event-ingestion-router-1.0.4.jar -------------------------------------------------------------------------------- /event-auditing/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8u141-jdk-slim 2 | MAINTAINER jeremydeane.net 3 | EXPOSE 9002 4 | RUN mkdir /app/ 5 | COPY target/event-audit-router-1.0.4.jar /app/ 6 | VOLUME /target/events 7 | ENTRYPOINT exec java $JAVA_OPTS -Dactivemq.hostname='event-broker' -jar /app/event-audit-router-1.0.4.jar -------------------------------------------------------------------------------- /mock-saas/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #captured from maven 2 | info.build.artifact=@project.artifactId@ 3 | info.build.name=@project.name@ 4 | info.build.description=@project.description@ 5 | info.build.version=@project.version@ 6 | 7 | management.endpoints.web.exposure.include=info,health,metrics -------------------------------------------------------------------------------- /mock-saas/README.md: -------------------------------------------------------------------------------- 1 | mock-saas 2 | ======================= 3 | 4 | Built with Java 8+, Spring-Boot (1.5.6.RELEASE) 5 | 6 | Test http endpoint for Event-driven Microservices Demo - Not for Production 7 | > GET http://localhost:8080/event 8 | 9 | Health and Metric Information 10 | > GET http://localhost:8080/actuator -------------------------------------------------------------------------------- /event-cep/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #captured from maven 2 | info.build.artifact=@project.artifactId@ 3 | info.build.name=@project.name@ 4 | info.build.description=@project.description@ 5 | info.build.version=@project.version@ 6 | 7 | server.port=9004 8 | 9 | endpoints.jolokia.sensitive=false 10 | 11 | management.endpoints.web.exposure.include=info,health,metrics -------------------------------------------------------------------------------- /event-auditing/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #captured from maven 2 | info.build.artifact=@project.artifactId@ 3 | info.build.name=@project.name@ 4 | info.build.description=@project.description@ 5 | info.build.version=@project.version@ 6 | 7 | server.port=9002 8 | 9 | endpoints.jolokia.sensitive=false 10 | 11 | management.endpoints.web.exposure.include=info,health,metrics -------------------------------------------------------------------------------- /event-ingestion/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #captured from maven 2 | info.build.artifact=@project.artifactId@ 3 | info.build.name=@project.name@ 4 | info.build.description=@project.description@ 5 | info.build.version=@project.version@ 6 | 7 | server.port=9001 8 | 9 | endpoints.jolokia.sensitive=false 10 | 11 | management.endpoints.web.exposure.include=info,health,metrics -------------------------------------------------------------------------------- /event-cep/src/test/jmeter/resources/encounter2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56788", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with chest pains" 7 | }, 8 | "status": "in-progress", 9 | "class": "inpatient", 10 | "patient": { 11 | "reference": "Patient/P12345", 12 | "display": "Roy Batty" 13 | } 14 | } -------------------------------------------------------------------------------- /event-auditing/src/test/jmeter/resources/encounter1.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56789", 4 | "text": { 5 | "status": "generated", 6 | "div": "Nose bleeding and headaches" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/P45678", 12 | "display": "Leon Kowalski" 13 | } 14 | } -------------------------------------------------------------------------------- /event-auditing/src/test/jmeter/resources/encounter2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56788", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with chest pains" 7 | }, 8 | "status": "in-progress", 9 | "class": "inpatient", 10 | "patient": { 11 | "reference": "Patient/P12345", 12 | "display": "Roy Batty" 13 | } 14 | } -------------------------------------------------------------------------------- /event-care-management/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #captured from maven 2 | info.build.artifact=@project.artifactId@ 3 | info.build.name=@project.name@ 4 | info.build.description=@project.description@ 5 | info.build.version=@project.version@ 6 | 7 | server.port=9003 8 | 9 | endpoints.jolokia.sensitive=false 10 | 11 | management.endpoints.web.exposure.include=info,health,metrics -------------------------------------------------------------------------------- /event-cep/src/test/jmeter/resources/encounter3.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56799", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with massive headache" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/99999", 12 | "display": "Eldon Tyrell" 13 | } 14 | } -------------------------------------------------------------------------------- /event-ingestion/src/test/jmeter/resources/encounter1.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56789", 4 | "text": { 5 | "status": "generated", 6 | "div": "Nose bleeding and headaches" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/P45678", 12 | "display": "Leon Kowalski" 13 | } 14 | } -------------------------------------------------------------------------------- /event-ingestion/src/test/jmeter/resources/encounter2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56788", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with chest pains" 7 | }, 8 | "status": "in-progress", 9 | "class": "inpatient", 10 | "patient": { 11 | "reference": "Patient/P12345", 12 | "display": "Roy Batty" 13 | } 14 | } -------------------------------------------------------------------------------- /event-care-management/src/test/jmeter/resources/encounter1.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56789", 4 | "text": { 5 | "status": "generated", 6 | "div": "Nose bleeding and headaches" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/P45678", 12 | "display": "Leon Kowalski" 13 | } 14 | } -------------------------------------------------------------------------------- /event-care-management/src/test/jmeter/resources/encounter2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56788", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with chest pains" 7 | }, 8 | "status": "in-progress", 9 | "class": "inpatient", 10 | "patient": { 11 | "reference": "Patient/P12345", 12 | "display": "Roy Batty" 13 | } 14 | } -------------------------------------------------------------------------------- /event-cep/src/test/resources/ws/cogito/microservices/encounter1.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56789", 4 | "text": { 5 | "status": "generated", 6 | "div": "Nose bleading and headaches" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/P45678", 12 | "display": "Leon Kowalski" 13 | } 14 | } -------------------------------------------------------------------------------- /event-cep/src/test/resources/ws/cogito/microservices/encounter2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56788", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with chest pains" 7 | }, 8 | "status": "in-progress", 9 | "class": "inpatient", 10 | "patient": { 11 | "reference": "Patient/P12345", 12 | "display": "Roy Batty" 13 | } 14 | } -------------------------------------------------------------------------------- /event-ingestion/src/test/resources/ws/cogito/microservices/encounter1.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56789", 4 | "text": { 5 | "status": "generated", 6 | "div": "Nose bleading and headaches" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/P45678", 12 | "display": "Leon Kowalski" 13 | } 14 | } -------------------------------------------------------------------------------- /event-ingestion/src/test/resources/ws/cogito/microservices/encounter2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56788", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with chest pains" 7 | }, 8 | "status": "in-progress", 9 | "class": "inpatient", 10 | "patient": { 11 | "reference": "Patient/P12345", 12 | "display": "Roy Batty" 13 | } 14 | } -------------------------------------------------------------------------------- /event-auditing/src/test/resources/ws/cogito/microservices/encounter1.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56789", 4 | "text": { 5 | "status": "generated", 6 | "div": "Nose bleading and headaches" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/P45678", 12 | "display": "Leon Kowalski" 13 | } 14 | } -------------------------------------------------------------------------------- /event-auditing/src/test/resources/ws/cogito/microservices/encounter2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56788", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with chest pains" 7 | }, 8 | "status": "in-progress", 9 | "class": "inpatient", 10 | "patient": { 11 | "reference": "Patient/P12345", 12 | "display": "Roy Batty" 13 | } 14 | } -------------------------------------------------------------------------------- /event-common/src/test/resources/ws/cogito/microservices/encounter1.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56789", 4 | "text": { 5 | "status": "generated", 6 | "div": "Nose bleeding and headaches" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/P45678", 12 | "display": "Leon Kowalski" 13 | } 14 | } -------------------------------------------------------------------------------- /event-test-harness/src/main/resources/ws/cogito/test/application/encounter1.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56789", 4 | "text": { 5 | "status": "generated", 6 | "div": "Nose bleading and headaches" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/P45678", 12 | "display": "Leon Kowalski" 13 | } 14 | } -------------------------------------------------------------------------------- /event-test-harness/src/main/resources/ws/cogito/test/application/encounter2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56788", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with chest pains" 7 | }, 8 | "status": "in-progress", 9 | "class": "inpatient", 10 | "patient": { 11 | "reference": "Patient/P12345", 12 | "display": "Roy Batty" 13 | } 14 | } -------------------------------------------------------------------------------- /event-cep/src/test/resources/ws/cogito/microservices/encounter3.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56799", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with massive headache" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/99999", 12 | "display": "Eldon Tyrell" 13 | } 14 | } -------------------------------------------------------------------------------- /event-ingestion/src/test/resources/ws/cogito/microservices/encounter3.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56799", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with massive headache" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/99999", 12 | "display": "Eldon Tyrell" 13 | } 14 | } -------------------------------------------------------------------------------- /event-auditing/src/test/resources/ws/cogito/microservices/encounter3.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56799", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with massive headache" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/99999", 12 | "display": "Eldon Tyrell" 13 | } 14 | } -------------------------------------------------------------------------------- /event-care-management/src/test/resources/ws/cogito/microservices/encounter2.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56788", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with chest pains" 7 | }, 8 | "status": "in-progress", 9 | "class": "inpatient", 10 | "patient": { 11 | "reference": "Patient/P12345", 12 | "display": "Roy Batty" 13 | } 14 | } -------------------------------------------------------------------------------- /event-test-harness/src/main/resources/ws/cogito/test/application/encounter3.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Encounter", 3 | "id": "EMR56799", 4 | "text": { 5 | "status": "generated", 6 | "div": "Patient admitted with massive headache" 7 | }, 8 | "status": "in-progress", 9 | "class": "outpatient", 10 | "patient": { 11 | "reference": "Patient/99999", 12 | "display": "Eldon Tyrell" 13 | } 14 | } -------------------------------------------------------------------------------- /mock-saas/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} | [%thread] | %-5level| %logger{0} | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /event-ingestion/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} | [%thread] | %-5level| %logger{0} | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /event-cep/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} | [%thread] | %-5level| %logger{0} | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /event-cep/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} | [%thread] | %-5level| %logger{0} | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /event-auditing/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} | [%thread] | %-5level| %logger{0} | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /event-auditing/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} | [%thread] | %-5level| %logger{0} | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /event-ingestion/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} | [%thread] | %-5level| %logger{0} | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /mock-saas/src/main/java/ws/cogito/test/saas/Application.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.test.saas; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Simple application that is used to mock a SAAS service. 8 | * @author jeremydeane 9 | * 10 | */ 11 | @SpringBootApplication 12 | public class Application { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(Application.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /event-care-management/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} | [%thread] | %-5level| %logger{0} | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /event-care-management/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} | [%thread] | %-5level| %logger{0} | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /event-cep/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | event-cep: 4 | build: . 5 | hostname: event-cep 6 | environment: 7 | - JAVA_OPTS=-Xmx256m -Xms128m 8 | ports: 9 | - "9004:9004" 10 | depends_on: 11 | - "event-broker" 12 | event-broker: 13 | hostname: event-broker 14 | image: "rmohr/activemq:5.14.3-alpine" 15 | ports: 16 | - "61616:61616" 17 | - "8161:8161" 18 | hawtio: 19 | hostname: event-ops 20 | image: "indigo/hawtio" 21 | ports: 22 | - "8090:8090" -------------------------------------------------------------------------------- /event-auditing/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | event-audit: 4 | build: . 5 | hostname: event-audit 6 | environment: 7 | - JAVA_OPTS=-Xmx256m -Xms128m 8 | ports: 9 | - "9002:9002" 10 | depends_on: 11 | - "event-broker" 12 | event-broker: 13 | hostname: event-broker 14 | image: "rmohr/activemq:5.14.3-alpine" 15 | ports: 16 | - "61616:61616" 17 | - "8161:8161" 18 | hawtio: 19 | hostname: event-ops 20 | image: "indigo/hawtio" 21 | ports: 22 | - "8090:8090" -------------------------------------------------------------------------------- /event-care-management/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | event-care: 4 | build: . 5 | hostname: event-care 6 | environment: 7 | - JAVA_OPTS=-Xmx256m -Xms128m 8 | ports: 9 | - "9003:9003" 10 | depends_on: 11 | - "event-broker" 12 | event-broker: 13 | hostname: event-broker 14 | image: "rmohr/activemq:5.14.3-alpine" 15 | ports: 16 | - "61616:61616" 17 | - "8161:8161" 18 | hawtio: 19 | hostname: event-ops 20 | image: "indigo/hawtio" 21 | ports: 22 | - "8090:8090" -------------------------------------------------------------------------------- /event-common/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} | [%thread] | %-5level| %logger{0} | %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /event-ingestion/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | event-ingestion: 4 | build: . 5 | hostname: event-ingestion 6 | environment: 7 | - JAVA_OPTS=-Xmx256m -Xms128m 8 | ports: 9 | - "9001:9001" 10 | depends_on: 11 | - "event-broker" 12 | event-broker: 13 | hostname: event-broker 14 | image: "rmohr/activemq:5.14.3-alpine" 15 | ports: 16 | - "61616:61616" 17 | - "8161:8161" 18 | hawtio: 19 | hostname: event-ops 20 | image: "indigo/hawtio" 21 | ports: 22 | - "8090:8090" -------------------------------------------------------------------------------- /event-cep/src/main/java/ws/cogito/microservices/EventCEPRouterApplication.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.context.annotation.ComponentScan; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.annotation.ImportResource; 8 | 9 | /** 10 | * Standalone Microservice Application for Complex Event Processing 11 | * @author jeremydeane 12 | */ 13 | @Configuration 14 | @ComponentScan 15 | @EnableAutoConfiguration 16 | @ImportResource("classpath:camel-route-spring.xml") 17 | public class EventCEPRouterApplication { 18 | 19 | public static void main(String[] args) { 20 | SpringApplication.run(EventCEPRouterApplication.class, args); 21 | } 22 | } -------------------------------------------------------------------------------- /event-auditing/src/main/java/ws/cogito/microservices/EventAuditingRouterApplication.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.context.annotation.ComponentScan; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.annotation.ImportResource; 8 | 9 | /** 10 | * Standalone Microservice Application for Event Auditing 11 | * @author jeremydeane 12 | */ 13 | @Configuration 14 | @ComponentScan 15 | @EnableAutoConfiguration 16 | @ImportResource("classpath:camel-route-spring.xml") 17 | public class EventAuditingRouterApplication { 18 | 19 | public static void main(String[] args) { 20 | SpringApplication.run(EventAuditingRouterApplication.class, args); 21 | } 22 | } -------------------------------------------------------------------------------- /event-ingestion/src/main/java/ws/cogito/microservices/EventIngestionRouterApplication.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.context.annotation.ComponentScan; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.annotation.ImportResource; 8 | 9 | /** 10 | * Standalone Microservice Application for Event Ingestion 11 | * @author jeremydeane 12 | */ 13 | @Configuration 14 | @ComponentScan 15 | @EnableAutoConfiguration 16 | @ImportResource("classpath:camel-route-spring.xml") 17 | public class EventIngestionRouterApplication { 18 | 19 | public static void main(String[] args) { 20 | SpringApplication.run(EventIngestionRouterApplication.class, args); 21 | } 22 | } -------------------------------------------------------------------------------- /event-ingestion/src/main/java/ws/cogito/microservices/CircuitBreakerOpenException.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | public final class CircuitBreakerOpenException extends Exception { 4 | 5 | private static final long serialVersionUID = -6147511481360982113L; 6 | 7 | private String message = "Circuit Breaker is Open!"; 8 | 9 | public CircuitBreakerOpenException() { 10 | super(); 11 | } 12 | 13 | public CircuitBreakerOpenException(String message) { 14 | super(message); 15 | this.message = message; 16 | } 17 | 18 | public CircuitBreakerOpenException(Throwable cause) { 19 | super(cause); 20 | } 21 | 22 | @Override 23 | public String toString() { 24 | return message; 25 | } 26 | 27 | @Override 28 | public String getMessage() { 29 | return message; 30 | } 31 | } -------------------------------------------------------------------------------- /event-care-management/src/main/java/ws/cogito/microservices/EventCareManagementRouterApplication.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.context.annotation.ComponentScan; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.annotation.ImportResource; 8 | 9 | /** 10 | * Standalone Microservice Application for Care Event Processing 11 | * @author jeremydeane 12 | */ 13 | @Configuration 14 | @ComponentScan 15 | @EnableAutoConfiguration 16 | @ImportResource("classpath:camel-route-spring.xml") 17 | public class EventCareManagementRouterApplication { 18 | 19 | public static void main(String[] args) { 20 | SpringApplication.run(EventCareManagementRouterApplication.class, args); 21 | } 22 | } -------------------------------------------------------------------------------- /event-test-harness/README.md: -------------------------------------------------------------------------------- 1 | event-client 2 | ======================= 3 | 4 | Built with Java 8+, Spring (4.3.7), and ActiveMQ (5.14.0) 5 | 6 | > Test harness for Event-driven Microservices Demo - Not for Production 7 | 8 | ### Java Examples 9 | 10 | Assumes ActiveMQ is running on localhost 11 | 12 | java -Dactivemq.hostname=localhost -jar event-client-1.0.2.jar Roy 13 | 14 | java -Dactivemq.hostname=localhost -jar event-client-1.0.2.jar Leon 15 | 16 | java -Dactivemq.hostname=localhost -jar event-client-1.0.2.jar Eldon 17 | 18 | ### Docker Examples 19 | 20 | Assumes ActiveMQ is running within _messaging-network_ on host _event-broker_ 21 | 22 | docker run -e PATIENT=‘Roy’ --net=messaging-network event-client:latest 23 | 24 | docker run -e PATIENT='Leon' --net=messaging-network event-client:latest 25 | 26 | docker run -e PATIENT=‘Eldon' --net=messaging-network event-client:latest 27 | 28 | -------------------------------------------------------------------------------- /event-test-harness/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /event-auditing/src/main/java/ws/cogito/microservices/EventAuditingRouteBuilder.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import org.apache.camel.RoutesBuilder; 4 | import org.apache.camel.builder.RouteBuilder; 5 | import org.springframework.stereotype.Component; 6 | 7 | 8 | /** 9 | * Event Auditing Route Builder 10 | */ 11 | @Component 12 | public class EventAuditingRouteBuilder extends RouteBuilder implements RoutesBuilder { 13 | 14 | public void configure() { 15 | 16 | /** 17 | * Route errors to DLQ after one retry and one second delay 18 | */ 19 | errorHandler(deadLetterChannel("activemq:event.audit.dlq"). 20 | maximumRedeliveries(1).redeliveryDelay(1000)); 21 | 22 | /** 23 | * Audit Storage (Mock) - Normally would use something like Elasticsearch 24 | */ 25 | from("activemq:event.audit"). 26 | process(new TrackingIdProcessor()). 27 | wireTap("activemq:event.cep"). 28 | to("file:target/events?fileName=event-${in.header.TrackingID}.json"); 29 | } 30 | } -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | event-ingestion: 4 | image: "jtdeane/event-ingestion:latest" 5 | hostname: event-ingestion 6 | environment: 7 | - JAVA_OPTS=-Xmx256m -Xms128m 8 | depends_on: 9 | - "event-broker" 10 | event-audit: 11 | image: "jtdeane/event-audit:latest" 12 | hostname: event-audit 13 | environment: 14 | - JAVA_OPTS=-Xmx256m -Xms128m 15 | depends_on: 16 | - "event-broker" 17 | event-care: 18 | image: "jtdeane/event-care:latest" 19 | hostname: event-care 20 | environment: 21 | - JAVA_OPTS=-Xmx256m -Xms128m 22 | depends_on: 23 | - "event-broker" 24 | event-cep: 25 | image: "jtdeane/event-cep:latest" 26 | hostname: event-cep 27 | environment: 28 | - JAVA_OPTS=-Xmx256m -Xms128m 29 | depends_on: 30 | - "event-broker" 31 | event-broker: 32 | hostname: event-broker 33 | image: "rmohr/activemq:5.14.3-alpine" 34 | ports: 35 | - "61616:61616" 36 | - "8161:8161" 37 | hawtio: 38 | hostname: event-ops 39 | image: "indigo/hawtio" 40 | ports: 41 | - "8090:8090" -------------------------------------------------------------------------------- /mock-saas/src/main/java/ws/cogito/test/saas/EventController.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.test.saas; 2 | 3 | import java.util.UUID; 4 | 5 | import javax.servlet.http.HttpServletResponse; 6 | 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestMethod; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | 14 | /** 15 | * Mocking a SAAS Endoint for testing Camel Circuit Breaker 16 | * @author jeremydeane 17 | */ 18 | @RestController 19 | @RequestMapping("/") 20 | public class EventController { 21 | 22 | private static final Logger logger = LoggerFactory.getLogger 23 | (EventController.class); 24 | 25 | /** 26 | * Process Event 27 | * @throws Exception 28 | */ 29 | @RequestMapping(value = "event", method=RequestMethod.GET) 30 | public String handleEvent (HttpServletResponse response) throws Exception { 31 | 32 | String message = "Processing Event " + UUID.randomUUID(); 33 | 34 | logger.info(message); 35 | 36 | response.setContentType("text/plain"); 37 | response.setCharacterEncoding("UTF-8"); 38 | 39 | return message; 40 | } 41 | } -------------------------------------------------------------------------------- /event-common/src/main/java/ws/cogito/microservices/TrackingIdProcessor.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import java.util.UUID; 4 | 5 | import org.apache.camel.Exchange; 6 | import org.apache.camel.Processor; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | /** 11 | * Create a Tracking ID if one does not already exist 12 | * @author jeremydeane 13 | * 14 | */ 15 | public class TrackingIdProcessor implements Processor { 16 | 17 | public static final String trackingId = "TrackingID"; 18 | 19 | private static final Logger logger = LoggerFactory.getLogger 20 | (TrackingIdProcessor.class); 21 | 22 | /** 23 | * create Tracking ID if it does not already exist 24 | */ 25 | public void process(Exchange exchange) throws Exception { 26 | 27 | 28 | if (exchange.getIn().getHeader(trackingId) != null) { 29 | 30 | logger.info("Existing Tracking ID: " + 31 | exchange.getIn().getHeader(trackingId)); 32 | 33 | } else { 34 | 35 | String uuid = UUID.randomUUID().toString(); 36 | 37 | exchange.getIn().setHeader(trackingId, uuid); 38 | 39 | logger.info("Created Tracking ID: " + uuid); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /event-cep/README.md: -------------------------------------------------------------------------------- 1 | event-cep-router 2 | ======================= 3 | 4 | Built with Java 8+, Apache Camel (2.22.0) and Spring Boot (2.0.3.RELEASE) 5 | 6 | Tested with JUnit (4.11) 7 | 8 | Execution 9 | * Spring-boot, assumes ActiveMQ is running locally 10 | * Docker (w/ Compose) - also starts up ActiveMQ and Hawtio 11 | 12 | Both require building the project first 13 | 14 | `mvn clean install` 15 | 16 | ### Docker Execution 17 | 18 | Start Docker 19 | 20 | `docker-compose up` 21 | 22 | View ActiveMQ (_admin/admin_) 23 | 24 | `http://localhost:8161/admin/` 25 | 26 | View Spring-Boot App 27 | 28 | `http://localhost:9004/actuator/info` 29 | 30 | View Hawtio 31 | 32 | `http://localhost:8090/hawtio/welcome` 33 | 34 | 35 | ### Spring-Boot Execution 36 | 37 | Executes with Spring Boot 38 | 39 | `mvn spring-boot:run -Drun.arguments="-Xmx256m,-Xms128m"` 40 | 41 | Runs against ActiveMQ (5.14.0) using JMeter (2.13); requires activemq-all-5.14.0.jar in lib directory 42 | 43 | >Message content can viewed in the ActiveMQ or hawtio Web Consoles. 44 | 45 | Navigate to http://localhost:8161/admin/ 46 | 47 | OR 48 | 49 | launch hawtio 50 | 51 | $java -jar hawtio-app.jar --port 8090 52 | 53 | and navigate to http://localhost:8090/hawtio/welcome 54 | -------------------------------------------------------------------------------- /event-auditing/README.md: -------------------------------------------------------------------------------- 1 | event-audit-router 2 | ======================= 3 | 4 | Built with Java 8+, Apache Camel (2.22.0) and Spring Boot (2.0.3.RELEASE) 5 | 6 | Tested with JUnit (4.11) 7 | 8 | Execution 9 | * Spring-boot, assumes ActiveMQ is running locally 10 | * Docker (w/ Compose) - also starts up ActiveMQ and Hawtio 11 | 12 | Both require building the project first 13 | 14 | `mvn clean install` 15 | 16 | ### Docker Execution 17 | 18 | Start Docker 19 | 20 | `docker-compose up` 21 | 22 | View ActiveMQ (_admin/admin_) 23 | 24 | `http://localhost:8161/admin/` 25 | 26 | View Spring-Boot App 27 | 28 | `http://localhost:9002/actuator/info` 29 | 30 | View Hawtio 31 | 32 | `http://localhost:8090/hawtio/welcome` 33 | 34 | 35 | ### Spring-Boot Execution 36 | 37 | Executes with Spring Boot 38 | 39 | `mvn spring-boot:run -Drun.arguments="-Xmx256m,-Xms128m"` 40 | 41 | Runs against ActiveMQ (5.14.0) using JMeter (2.13); requires activemq-all-5.14.0.jar in lib directory 42 | 43 | >Message content can viewed in the ActiveMQ or hawtio Web Consoles. 44 | 45 | Navigate to http://localhost:8161/admin/ 46 | 47 | OR 48 | 49 | launch hawtio 50 | 51 | $java -jar hawtio-app.jar --port 8090 52 | 53 | and navigate to http://localhost:8090/hawtio/welcome -------------------------------------------------------------------------------- /event-care-management/README.md: -------------------------------------------------------------------------------- 1 | event-care-router 2 | ======================= 3 | 4 | Built with Java 8+, Apache Camel (2.22.0) and Spring Boot (2.0.3.RELEASE) 5 | 6 | Tested with JUnit (4.11) 7 | 8 | Execution 9 | * Spring-boot, assumes ActiveMQ is running locally 10 | * Docker (w/ Compose) - also starts up ActiveMQ and Hawtio 11 | 12 | Both require building the project first 13 | 14 | `mvn clean install` 15 | 16 | ### Docker Execution 17 | 18 | Start Docker 19 | 20 | `docker-compose up` 21 | 22 | View ActiveMQ (_admin/admin_) 23 | 24 | `http://localhost:8161/admin/` 25 | 26 | View Spring-Boot App 27 | 28 | `http://localhost:9003/actuator/info` 29 | 30 | View Hawtio 31 | 32 | `http://localhost:8090/hawtio/welcome` 33 | 34 | 35 | ### Spring-Boot Execution 36 | 37 | Executes with Spring Boot 38 | 39 | `mvn spring-boot:run -Drun.arguments="-Xmx256m,-Xms128m"` 40 | 41 | Runs against ActiveMQ (5.14.0) using JMeter (2.13); requires activemq-all-5.14.0.jar in lib directory 42 | 43 | >Message content can viewed in the ActiveMQ or hawtio Web Consoles. 44 | 45 | Navigate to http://localhost:8161/admin/ 46 | 47 | OR 48 | 49 | launch hawtio 50 | 51 | $java -jar hawtio-app.jar --port 8090 52 | 53 | and navigate to http://localhost:8090/hawtio/welcome 54 | -------------------------------------------------------------------------------- /event-ingestion/README.md: -------------------------------------------------------------------------------- 1 | event-ingestion-router 2 | ======================= 3 | 4 | Built with Java 8+, Apache Camel (2.22.0) and Spring Boot (2.0.3.RELEASE) 5 | 6 | Tested with JUnit (4.11) 7 | 8 | Execution 9 | * Spring-boot, assumes ActiveMQ is running locally 10 | * Docker (w/ Compose) - also starts up ActiveMQ and Hawtio 11 | 12 | Both require building the project first 13 | 14 | `mvn clean install` 15 | 16 | ### Docker Execution 17 | 18 | Start Docker 19 | 20 | `docker-compose up` 21 | 22 | View ActiveMQ (_admin/admin_) 23 | 24 | `http://localhost:8161/admin/` 25 | 26 | View Spring-Boot App 27 | 28 | `http://localhost:9001/actuator/info` 29 | 30 | View Hawtio 31 | 32 | `http://localhost:8090/hawtio/welcome` 33 | 34 | 35 | ### Spring-Boot Execution 36 | 37 | Executes with Spring Boot 38 | 39 | `mvn spring-boot:run -Drun.arguments="-Xmx256m,-Xms128m"` 40 | 41 | Runs against ActiveMQ (5.14.0) using JMeter (2.13); requires activemq-all-5.14.0.jar in lib directory 42 | 43 | >Message content can viewed in the ActiveMQ or hawtio Web Consoles. 44 | 45 | Navigate to http://localhost:8161/admin/ 46 | 47 | OR 48 | 49 | launch hawtio 50 | 51 | $java -jar hawtio-app.jar --port 8090 52 | 53 | and navigate to http://localhost:8090/hawtio/welcome 54 | -------------------------------------------------------------------------------- /event-care-management/src/main/java/ws/cogito/microservices/EventCareManagementRouteBuilder.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import java.util.UUID; 4 | 5 | import org.apache.camel.RoutesBuilder; 6 | import org.apache.camel.builder.RouteBuilder; 7 | import org.springframework.stereotype.Component; 8 | 9 | 10 | /** 11 | * Event Care Management Route Builder 12 | */ 13 | @Component 14 | public class EventCareManagementRouteBuilder extends RouteBuilder implements RoutesBuilder { 15 | 16 | public void configure() { 17 | 18 | /* 19 | * Route errors to DLQ after one retry and one second delay 20 | */ 21 | errorHandler(deadLetterChannel("activemq:event.care.dlq"). 22 | maximumRedeliveries(1).redeliveryDelay(1000)); 23 | 24 | /* 25 | * Enrichment - assign Care Management ID and route to task queue 26 | * http://camel.apache.org/maven/camel-2.15.0/camel-core/apidocs/org/apache/camel/Processor.html 27 | */ 28 | from("activemq:event.inpatient"). 29 | process(new TrackingIdProcessor()). 30 | process((exchange) -> { 31 | String uuid = UUID.randomUUID().toString(); 32 | exchange.getIn().setHeader("CareManagementID", uuid); 33 | }). 34 | to("activemq:event.care.tasks"); 35 | } 36 | } -------------------------------------------------------------------------------- /event-test-harness/src/main/resources/event-client-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /event-ingestion/src/main/resources/camel-route-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /event-cep/src/main/resources/camel-route-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /event-auditing/src/main/resources/camel-route-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /event-care-management/src/main/resources/camel-route-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /event-cep/src/main/java/ws/cogito/microservices/EventCEPRouteBuilder.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | import org.apache.camel.RoutesBuilder; 7 | import org.apache.camel.builder.RouteBuilder; 8 | import org.springframework.stereotype.Component; 9 | 10 | import com.jayway.jsonpath.JsonPath; 11 | 12 | 13 | /** 14 | * Event Complext Event Processing Route Builder 15 | */ 16 | @Component 17 | public class EventCEPRouteBuilder extends RouteBuilder implements RoutesBuilder { 18 | 19 | static final List patients = Arrays.asList 20 | ("Rick Deckard","Hannibal Chew", "Eldon Tyrell"); 21 | 22 | public void configure() { 23 | 24 | /* 25 | * Route errors to DLQ after one retry and one second delay 26 | */ 27 | errorHandler(deadLetterChannel("activemq:event.care.dlq"). 28 | maximumRedeliveries(1).redeliveryDelay(1000)); 29 | 30 | /* 31 | * Complex Event Processing (CEP) - Check fradulent paitent list 32 | * https://github.com/jayway/JsonPath 33 | * http://camel.apache.org/maven/camel-2.15.0/camel-core/apidocs/org/apache/camel/Processor.html 34 | */ 35 | from("activemq:event.cep"). 36 | process(new TrackingIdProcessor()). 37 | process(exchange -> { 38 | 39 | String json = (String) exchange.getIn().getBody(); 40 | String patient = JsonPath.read(json,"$.patient.display"); 41 | 42 | if (patients.contains(patient)) { 43 | exchange.getIn().setHeader("Fraud", "true"); 44 | } else { 45 | exchange.getIn().setHeader("Fraud", "false"); 46 | } 47 | }). 48 | choice(). 49 | when().simple("${in.header.Fraud} contains 'true'"). 50 | log("FRAUD ALERT"). 51 | to("activemq:topic:event.fraud.alert"). 52 | otherwise(). 53 | log("...off into the ether"); 54 | } 55 | } -------------------------------------------------------------------------------- /commands: -------------------------------------------------------------------------------- 1 | #NO DOCKER 2 | 3 | #execute test 4 | java -jar -Dactivemq.hostname=localhost event-client-1.0.2.jar 5 | 6 | #view activemq 7 | Open http://localhost:8161/admin/queues.jsp 8 | 9 | #view Hawtio 10 | java -jar hawtio-app.jar --port 8090 11 | 12 | http://localhost:8090/hawtio 13 | 14 | #Start ActiveMQ 15 | ./activemq start 16 | 17 | #Build Demo (in each sub-project, in order) 18 | mvn clean install 19 | 20 | #Start Microservices 21 | mvn spring-boot:run -Drun.arguments="-Xmx256m,-Xms128m" 22 | 23 | #Execute Tests 24 | java -jar -Dactivemq.hostname=localhost event-client-1.0.2.jar Leon 25 | java -jar -Dactivemq.hostname=localhost event-client-1.0.2.jar Roy 26 | java -jar -Dactivemq.hostname=localhost event-client-1.0.2.jar Eldon 27 | 28 | #DOCKER 29 | 30 | #Execute Test 31 | docker network create messaging-network 32 | 33 | docker run -d -p 61616:61616 -p 8161:8161 --net=messaging-network --hostname event-broker --name event-broker rmohr/activemq:5.14.3-alpine 34 | 35 | docker run -e PATIENT='Roy' --net=messaging-network jtdeane/event-client:latest 36 | 37 | #View activemq 38 | Open http://localhost:8161/admin/queues.jsp 39 | 40 | #view hawtio 41 | docker run -d -p 8090:8090 --net=messaging-network indigo/hawtio:latest 42 | 43 | http://localhost:8090/hawtio 44 | 45 | 46 | #Portainer - Create Volume 47 | docker volume create portainer_data 48 | 49 | #Execute Portainer 50 | docker run -d -p 9898:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer 51 | 52 | #View Portainer (change admin password first time) 53 | http://localhost:9898/#/auth 54 | 55 | 56 | #Start Demo 57 | docker-compose up 58 | 59 | #Capture Docker Compose Network 60 | docker network ls 61 | 62 | #set docker compose network e.g. microservices_default 63 | docker run -e PATIENT='Leon' --net=microservices_default jtdeane/event-client:latest 64 | docker run -e PATIENT='Roy' --net=microservices_default jtdeane/event-client:latest 65 | docker run -e PATIENT='Eldon' --net=microservices_default jtdeane/event-client:latest -------------------------------------------------------------------------------- /event-care-management/src/test/java/ws/cogito/microservices/EventCareManagementRouteBuilderTest.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import java.util.UUID; 4 | 5 | import org.apache.camel.CamelContext; 6 | import org.apache.camel.LoggingLevel; 7 | import org.apache.camel.builder.RouteBuilder; 8 | import org.apache.camel.component.mock.MockEndpoint; 9 | import org.apache.camel.test.junit4.CamelTestSupport; 10 | import org.apache.commons.io.IOUtils; 11 | import org.junit.Test; 12 | 13 | public class EventCareManagementRouteBuilderTest extends CamelTestSupport { 14 | 15 | @Override 16 | protected CamelContext createCamelContext() throws Exception { 17 | 18 | CamelContext context = super.createCamelContext(); 19 | 20 | //setup routes to Mock Endpoints 21 | context.addRoutes(new RouteBuilder() { 22 | 23 | public void configure() { 24 | 25 | from("direct:inpatient"). 26 | log(LoggingLevel.DEBUG, "Event ${body}"). 27 | process(new TrackingIdProcessor()). 28 | process((exchange) -> { 29 | String uuid = UUID.randomUUID().toString(); 30 | exchange.getIn().setHeader("CareManagementID", uuid); 31 | }). 32 | to("mock:tasks"); 33 | } 34 | }); 35 | 36 | return context; 37 | } 38 | 39 | @Test 40 | public void testProcessorLogic() throws Exception { 41 | 42 | //Set expectations 43 | MockEndpoint tasks = getMockEndpoint("mock:tasks"); 44 | tasks.expectedMessageCount(1); 45 | 46 | //read and send inpatient encounter 47 | String encounter2 = IOUtils.toString(this.getClass(). 48 | getResourceAsStream("encounter2.json"), "UTF-8"); 49 | 50 | template.sendBody("direct:inpatient", encounter2); 51 | 52 | //verify processing 53 | tasks.assertIsSatisfied(); 54 | 55 | String careManagementId = (String) tasks.getExchanges().get(0).getIn(). 56 | getHeader("CareManagementID"); 57 | 58 | log.debug("Care Management ID: " + careManagementId); 59 | 60 | //Tracking ID should not be null 61 | assertNotNull(careManagementId); 62 | } 63 | } -------------------------------------------------------------------------------- /event-cep/src/test/resources/camel-route-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | ws.cogito.microservices 12 | 13 | 14 | 15 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /event-auditing/src/test/java/ws/cogito/microservices/EventAuditingRouteBuilderTest.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import java.io.File; 4 | 5 | import org.apache.camel.CamelContext; 6 | import org.apache.camel.builder.RouteBuilder; 7 | import org.apache.camel.component.mock.MockEndpoint; 8 | import org.apache.camel.test.junit4.CamelTestSupport; 9 | import org.apache.commons.io.FileUtils; 10 | import org.apache.commons.io.IOUtils; 11 | import org.junit.Test; 12 | 13 | public class EventAuditingRouteBuilderTest extends CamelTestSupport { 14 | 15 | 16 | @Override 17 | protected CamelContext createCamelContext() throws Exception { 18 | 19 | CamelContext context = super.createCamelContext(); 20 | 21 | //setup routes to Mock Endpoints 22 | context.addRoutes(new RouteBuilder() { 23 | 24 | public void configure() { 25 | 26 | from("direct:audit"). 27 | process(new TrackingIdProcessor()). 28 | wireTap("mock:cep"). 29 | to("file:target/events?fileName=event-${in.header.TrackingID}.json"); 30 | } 31 | }); 32 | 33 | return context; 34 | } 35 | 36 | @Override 37 | public void setUp() throws Exception { 38 | 39 | super.setUp(); 40 | 41 | FileUtils.deleteDirectory(new File ("target/events")); 42 | } 43 | 44 | @Test 45 | public void testRoutingLogic() throws Exception { 46 | 47 | //Set expectations 48 | MockEndpoint cep = getMockEndpoint("mock:cep"); 49 | cep.expectedMessageCount(3); 50 | 51 | 52 | //send encounters 53 | String encounter1 = IOUtils.toString(this.getClass(). 54 | getResourceAsStream("encounter1.json"), "UTF-8"); 55 | 56 | String encounter2 = IOUtils.toString(this.getClass(). 57 | getResourceAsStream("encounter2.json"), "UTF-8"); 58 | 59 | String encounter3 = IOUtils.toString(this.getClass(). 60 | getResourceAsStream("encounter3.json"), "UTF-8"); 61 | 62 | template.sendBody("direct:audit", encounter1); 63 | template.sendBody("direct:audit", encounter2); 64 | template.sendBody("direct:audit", encounter3); 65 | 66 | //verify routing 67 | assertEquals(3, new File("target/events").listFiles().length); 68 | 69 | cep.assertIsSatisfied(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /event-common/src/test/java/ws/cogito/microservices/TrackingIdProcessorTest.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import org.apache.camel.CamelContext; 4 | import org.apache.camel.builder.RouteBuilder; 5 | import org.apache.camel.component.mock.MockEndpoint; 6 | import org.apache.camel.test.junit4.CamelTestSupport; 7 | import org.apache.commons.io.IOUtils; 8 | import org.junit.Test; 9 | 10 | public class TrackingIdProcessorTest extends CamelTestSupport { 11 | 12 | @Override 13 | protected CamelContext createCamelContext() throws Exception { 14 | 15 | CamelContext context = super.createCamelContext(); 16 | 17 | //setup routes to Mock Endpoints 18 | context.addRoutes(new RouteBuilder() { 19 | 20 | public void configure() { 21 | 22 | //test xpath split 23 | from ("direct:event"). 24 | process(new TrackingIdProcessor()). 25 | to("mock:order"); 26 | } 27 | }); 28 | 29 | return context; 30 | } 31 | 32 | @Test 33 | public void testTrackingIdCreateLogic() throws Exception { 34 | 35 | //Set expectations 36 | MockEndpoint event = getMockEndpoint("mock:order"); 37 | event.expectedMessageCount(1); 38 | 39 | //event.expectedHeaderReceived(name, value); 40 | 41 | //read event 42 | String json = IOUtils.toString(this.getClass(). 43 | getResourceAsStream("encounter1.json"), "UTF-8"); 44 | 45 | //execute the test 46 | template.sendBody("direct:event", json); 47 | 48 | String trackingId = (String) event.getExchanges().get(0).getIn(). 49 | getHeader(TrackingIdProcessor.trackingId); 50 | 51 | //Tracking ID should not be null 52 | assertNotNull(trackingId); 53 | 54 | //should be one event 55 | event.assertIsSatisfied(); 56 | } 57 | 58 | @Test 59 | public void testTrackingIdLogicExists() throws Exception { 60 | 61 | //Set expectations 62 | MockEndpoint event = getMockEndpoint("mock:order"); 63 | event.expectedMessageCount(1); 64 | 65 | String expectedTrackingId = "Foo12345"; 66 | 67 | //event.expectedHeaderReceived(name, value); 68 | 69 | //read event 70 | String json = IOUtils.toString(this.getClass(). 71 | getResourceAsStream("encounter1.json"), "UTF-8"); 72 | 73 | //execute the test 74 | template.sendBodyAndHeader("direct:event", json, TrackingIdProcessor.trackingId, expectedTrackingId); 75 | 76 | event.expectedHeaderReceived(TrackingIdProcessor.trackingId, expectedTrackingId); 77 | 78 | //should be one event 79 | event.assertIsSatisfied(); 80 | } 81 | } -------------------------------------------------------------------------------- /event-cep/src/test/java/ws/cogito/microservices/EventCEPRouteBuilderTest.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | import org.apache.camel.CamelContext; 7 | import org.apache.camel.builder.RouteBuilder; 8 | import org.apache.camel.component.mock.MockEndpoint; 9 | import org.apache.camel.test.junit4.CamelTestSupport; 10 | import org.apache.commons.io.IOUtils; 11 | import org.junit.Test; 12 | 13 | import com.jayway.jsonpath.JsonPath; 14 | 15 | public class EventCEPRouteBuilderTest extends CamelTestSupport { 16 | 17 | static final List patients = Arrays.asList 18 | ("Rick Deckard","Hannibal Chew", "Eldon Tyrell"); 19 | 20 | @Override 21 | protected CamelContext createCamelContext() throws Exception { 22 | 23 | CamelContext context = super.createCamelContext(); 24 | 25 | //setup routes to Mock Endpoints 26 | context.addRoutes(new RouteBuilder() { 27 | 28 | public void configure() { 29 | 30 | from("direct:cep"). 31 | process(new TrackingIdProcessor()). 32 | process(exchange -> { 33 | 34 | String json = (String) exchange.getIn().getBody(); 35 | String patient = JsonPath.read(json,"$.patient.display"); 36 | 37 | if (patients.contains(patient)) { 38 | exchange.getIn().setHeader("Fraud", "true"); 39 | } else { 40 | exchange.getIn().setHeader("Fraud", "false"); 41 | } 42 | }). 43 | choice(). 44 | when().simple("${in.header.Fraud} contains 'true'"). 45 | to("mock:fraud"). 46 | log("FRAUD ALERT!!" + "${body}"). 47 | otherwise(). 48 | log("...off into the ether"); 49 | } 50 | }); 51 | 52 | return context; 53 | } 54 | 55 | @Test 56 | public void testRoutingLogic() throws Exception { 57 | 58 | //Set expectations 59 | MockEndpoint cep = getMockEndpoint("mock:fraud"); 60 | cep.expectedMessageCount(1); 61 | 62 | //send encounters 63 | String encounter1 = IOUtils.toString(this.getClass(). 64 | getResourceAsStream("encounter1.json"), "UTF-8"); 65 | 66 | String encounter2 = IOUtils.toString(this.getClass(). 67 | getResourceAsStream("encounter2.json"), "UTF-8"); 68 | 69 | String encounter3 = IOUtils.toString(this.getClass(). 70 | getResourceAsStream("encounter3.json"), "UTF-8"); 71 | 72 | template.sendBody("direct:cep", encounter1); 73 | template.sendBody("direct:cep", encounter2); 74 | template.sendBody("direct:cep", encounter3); 75 | 76 | //verify routing 77 | cep.assertIsSatisfied(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /event-ingestion/src/test/java/ws/cogito/microservices/EventIngestionRouteBuilderTest.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import org.apache.camel.CamelContext; 4 | import org.apache.camel.LoggingLevel; 5 | import org.apache.camel.builder.RouteBuilder; 6 | import org.apache.camel.component.mock.MockEndpoint; 7 | import org.apache.camel.test.junit4.CamelTestSupport; 8 | import org.apache.commons.io.IOUtils; 9 | import org.junit.Test; 10 | 11 | public class EventIngestionRouteBuilderTest extends CamelTestSupport { 12 | 13 | 14 | @Override 15 | protected CamelContext createCamelContext() throws Exception { 16 | 17 | CamelContext context = super.createCamelContext(); 18 | 19 | context.setUseMDCLogging(true); 20 | 21 | //setup routes to Mock Endpoints 22 | context.addRoutes(new RouteBuilder() { 23 | 24 | public void configure() { 25 | 26 | from("direct:ingestion"). 27 | log(LoggingLevel.DEBUG, "Event ${body}"). 28 | process(new TrackingIdProcessor()). 29 | choice(). 30 | when().jsonpath("$[?(@.class==inpatient)]"). 31 | to("mock:inpatient"). 32 | otherwise(). 33 | to("mock:outpatient"). 34 | end(). 35 | to("mock:audit"); 36 | } 37 | }); 38 | 39 | return context; 40 | } 41 | 42 | @Test 43 | public void testChoiceLogic() throws Exception { 44 | 45 | //Set expectations 46 | MockEndpoint inpatient = getMockEndpoint("mock:inpatient"); 47 | inpatient.expectedMessageCount(1); 48 | 49 | MockEndpoint outpatient = getMockEndpoint("mock:outpatient"); 50 | outpatient.expectedMessageCount(2); 51 | 52 | MockEndpoint audit = getMockEndpoint("mock:audit"); 53 | audit.expectedMessageCount(3); 54 | 55 | //ingest encounters 56 | String encounter1 = IOUtils.toString(this.getClass(). 57 | getResourceAsStream("encounter1.json"), "UTF-8"); 58 | 59 | String encounter2 = IOUtils.toString(this.getClass(). 60 | getResourceAsStream("encounter2.json"), "UTF-8"); 61 | 62 | String encounter3 = IOUtils.toString(this.getClass(). 63 | getResourceAsStream("encounter3.json"), "UTF-8"); 64 | 65 | template.sendBody("direct:ingestion", encounter1); 66 | template.sendBody("direct:ingestion", encounter2); 67 | template.sendBody("direct:ingestion", encounter3); 68 | 69 | //verify routing 70 | inpatient.assertIsSatisfied(); 71 | 72 | String inpatientEncouter = (String) inpatient.getExchanges().get(0).getIn().getBody(); 73 | assertTrue(inpatientEncouter.contains("Roy Batty")); 74 | 75 | outpatient.assertIsSatisfied(); 76 | audit.assertIsSatisfied(); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Event-Driven Microservices Demo 2 | ======================= 3 | 4 | ### Docker Execution 5 | 6 | 1) Start-up Docker via Compose 7 | 8 | docker-compose up 9 | 10 | 2) Open Hawtio send messages to _event.ingestion_ (admin/admin) 11 | 12 | http://localhost:8090/hawtio/welcome 13 | 14 | Connect Remote: 15 | 16 | * Name: broker 17 | * Scheme: http 18 | * Host: event-broker 19 | * Port: 8161 20 | * Path: api/jolokia 21 | 22 | Open Queue-->event.injestion 23 | 24 | Open Send Tab 25 | 26 | 27 | OR 28 | 29 | 2) Open ActiveMQ Queues (admin/admin) 30 | 31 | http://localhost:8161/admin 32 | 33 | Click Send Tab 34 | 35 | * Destination: event-ingestion 36 | 37 | 3) Send messages 38 | 39 | Leon Kowalksi 40 | 41 | { 42 | "resourceType": "Encounter", 43 | "id": "EMR56789", 44 | "text": { 45 | "status": "generated", 46 | "div": "Nose bleading and headaches" 47 | }, 48 | "status": "in-progress", 49 | "class": "outpatient", 50 | "patient": { 51 | "reference": "Patient/P45678", 52 | "display": "Leon Kowalski" 53 | } 54 | } 55 | 56 | Roy Batty 57 | 58 | { 59 | "resourceType": "Encounter", 60 | "id": "EMR56788", 61 | "text": { 62 | "status": "generated", 63 | "div": "Patient admitted with chest pains" 64 | }, 65 | "status": "in-progress", 66 | "class": "inpatient", 67 | "patient": { 68 | "reference": "Patient/P12345", 69 | "display": "Roy Batty" 70 | } 71 | } 72 | 73 | Eldon Tyrell 74 | 75 | 76 | { 77 | "resourceType": "Encounter", 78 | "id": "EMR56799", 79 | "text": { 80 | "status": "generated", 81 | "div": "Patient admitted with massive headache" 82 | }, 83 | "status": "in-progress", 84 | "class": "outpatient", 85 | "patient": { 86 | "reference": "Patient/99999", 87 | "display": "Eldon Tyrell" 88 | } 89 | } 90 | 91 | 92 | 93 | ### Spring-Boot Execution 94 | 95 | Requires ActiveMQ listening on tcp://localhost:61616 96 | 97 | 1) Build all the sub-projects - mvn clean install 98 | 99 | - event-common 100 | - event-test-harness 101 | - event-ingestion 102 | - event-auditing 103 | - event-care-management 104 | - event-cep 105 | 106 | 2) Start all Microservices - mvn spring-boot:run -Drun.arguments="-Xmx256m,-Xms128m" 107 | 108 | - event-ingestion 109 | - event-auditing 110 | - event-care-management 111 | - event-cep 112 | 113 | 3) Run Test Harness 114 | 115 | cd event-test-harness/target 116 | 117 | * java -Dactivemq.hostname=localhost -jar event-client-1.0.2.jar Leon 118 | 119 | * java -Dactivemq.hostname=localhost -jar event-client-1.0.2.jar Roy 120 | 121 | * java -Dactivemq.hostname=localhost -jar event-client-1.0.2.jar Eldon 122 | 123 | or start JMeter and run test suite 124 | 125 | ..event-ingestion/src/test/jmeter/Camel Mock Publisher 126 | 127 | 128 | 4) View Results in ActiveMQ Console - http://localhost:8161/admin 129 | 130 | default uid/pw = admin/admin 131 | 132 | 133 | 5) View Audit File Results 134 | 135 | cd event-auditing/target/events -------------------------------------------------------------------------------- /event-ingestion/src/main/java/ws/cogito/microservices/EventIngestionRouteBuilder.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.microservices; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.LoggingLevel; 5 | import org.apache.camel.builder.RouteBuilder; 6 | import org.springframework.stereotype.Component; 7 | import org.apache.camel.RoutesBuilder; 8 | 9 | 10 | /** 11 | * Event Ingestion Route Builder 12 | */ 13 | @Component 14 | public class EventIngestionRouteBuilder extends RouteBuilder implements RoutesBuilder { 15 | 16 | @SuppressWarnings("deprecation") 17 | public void configure() { 18 | 19 | /* 20 | * Route errors to DLQ after one retry and one second delay 21 | */ 22 | errorHandler(deadLetterChannel("activemq:event.ingestion.dlq"). 23 | maximumRedeliveries(1).redeliveryDelay(1000)); 24 | 25 | /* 26 | * Content Based Routing V1 - Inpatient-Outpatient Events 27 | * http://camel.apache.org/jsonpath.html 28 | */ 29 | from("activemq:event.ingestion"). 30 | process(new TrackingIdProcessor()). 31 | choice(). 32 | when().jsonpath("$[?(@.class==inpatient)]"). 33 | to("activemq:event.inpatient"). 34 | otherwise(). 35 | to("activemq:event.outpatient"). 36 | end(). 37 | to("activemq:event.audit"); 38 | 39 | 40 | /* 41 | * Content Based Routing V2 - Inpatient-Outpatient Events with Throttle 42 | * http://camel.apache.org/jsonpath.html 43 | * http://camel.apache.org/throttler.html 44 | * limit 100 requests per second with non-blocking delay using thread pool 45 | 46 | from("activemq:event.ingestion"). 47 | to("seda:audit"); 48 | 49 | from ("seda:audit"). 50 | throttle(100).asyncDelayed(). 51 | process(new TrackingIdProcessor()). 52 | choice(). 53 | when().jsonpath("$[?(@.class==inpatient)]"). 54 | to("activemq:event.inpatient"). 55 | otherwise(). 56 | to("activemq:event.outpatient"). 57 | end(). 58 | to("activemq:event.audit"); */ 59 | 60 | /* 61 | * Content Based Routing V3 - Inpatient-Outpatient Events with circuit breaker 62 | * http://camel.apache.org/jsonpath.html 63 | * http://camel.apache.org/load-balancer.html 64 | * Requires Mock SaaS Running - http4://localhost:8080/event 65 | * After two failures circuit breaker goes into Open State; after five 66 | * seconds will try again. In Open State messages go to DLQ. 67 | 68 | from("activemq:event.ingestion"). 69 | process(new TrackingIdProcessor()). 70 | choice(). 71 | when().jsonpath("$[?(@.class==inpatient)]"). 72 | to("activemq:event.inpatient"). 73 | otherwise(). 74 | to("activemq:event.outpatient"). 75 | end(). 76 | to("direct:saas"); 77 | 78 | from("direct:saas"). 79 | log("Sending SAAS HTTP Request"). 80 | setHeader(Exchange.HTTP_METHOD, constant(org.apache.camel.component.http4.HttpMethods.GET)). 81 | loadBalance(). 82 | circuitBreaker(2, 5000L, CircuitBreakerOpenException.class). 83 | to("http4://localhost:8080/event");*/ 84 | } 85 | } -------------------------------------------------------------------------------- /mock-saas/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.0.3.RELEASE 10 | 11 | 12 | 13 | 14 | 15 | Mock SasS 16 | ws.cogito.test 17 | mock-saas 18 | 1.0.3 19 | jar 20 | 21 | 22 | 1.8 23 | 2.0.3.RELEASE 24 | UTF-8 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-actuator 34 | ${spring.boot.version} 35 | 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-configuration-processor 40 | ${spring.boot.version} 41 | 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-starter-web 46 | ${spring.boot.version} 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | central 56 | Maven Repository Switchboard 57 | http://repo1.maven.org/maven2 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | src/main/resources 68 | true 69 | 70 | 71 | 72 | 73 | org.springframework.boot 74 | spring-boot-maven-plugin 75 | ${spring.boot.version} 76 | 77 | 78 | 79 | repackage 80 | 81 | 82 | 83 | 84 | 85 | org.apache.maven.plugins 86 | maven-compiler-plugin 87 | 3.3 88 | 89 | ${java-version} 90 | ${java-version} 91 | 92 | 93 | 94 | org.apache.maven.plugins 95 | maven-dependency-plugin 96 | 2.10 97 | 98 | 99 | org.apache.maven.plugins 100 | maven-resources-plugin 101 | 2.7 102 | 103 | UTF-8 104 | 105 | 106 | 107 | org.apache.maven.plugins 108 | maven-eclipse-plugin 109 | 2.10 110 | 111 | false 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 12456789 121 | Jeremy Deane 122 | jeremy.deane@gmail.com 123 | http://www.jeremydeane.net 124 | 125 | 123-435-2345 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /event-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | ws.cogito.microservices 8 | event-common 9 | jar 10 | 1.0.6 11 | 12 | Cogito 13 | http://www.cogito.ws 14 | 15 | 16 | 2.22.0 17 | UTF-8 18 | UTF-8 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | org.apache.camel 27 | camel-core 28 | ${camel.version} 29 | 30 | 31 | 32 | org.apache.camel 33 | camel-spring 34 | ${camel.version} 35 | 36 | 37 | 38 | 39 | org.apache.camel 40 | camel-test 41 | ${camel.version} 42 | test 43 | 44 | 45 | 46 | ch.qos.logback 47 | logback-classic 48 | 1.1.7 49 | test 50 | 51 | 52 | 53 | junit 54 | junit 55 | 4.11 56 | test 57 | 58 | 59 | 60 | commons-io 61 | commons-io 62 | 1.3.2 63 | test 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | central 73 | Maven Repository Switchboard 74 | http://repo1.maven.org/maven2 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-compiler-plugin 86 | 3.3 87 | 88 | 1.8 89 | 1.8 90 | 91 | 92 | 93 | org.apache.maven.plugins 94 | maven-dependency-plugin 95 | 2.10 96 | 97 | 98 | org.apache.maven.plugins 99 | maven-resources-plugin 100 | 2.7 101 | 102 | UTF-8 103 | 104 | 105 | 106 | org.apache.maven.plugins 107 | maven-eclipse-plugin 108 | 2.10 109 | 110 | false 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 12456789 120 | Jeremy Deane 121 | jeremy.deane@gmail.com 122 | http://www.jeremydeane.net 123 | 124 | 123-435-2345 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /event-test-harness/src/main/java/ws/cogito/test/application/EventClient.java: -------------------------------------------------------------------------------- 1 | package ws.cogito.test.application; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStreamReader; 5 | 6 | import javax.jms.TextMessage; 7 | 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | import org.springframework.context.ApplicationContext; 11 | import org.springframework.context.support.ClassPathXmlApplicationContext; 12 | import org.springframework.jms.core.JmsTemplate; 13 | 14 | /** 15 | * Event-driven Microservices Article 16 | * @author jeremydeane 17 | */ 18 | public final class EventClient { 19 | 20 | private static final Logger logger = LoggerFactory.getLogger 21 | (EventClient.class); 22 | 23 | public static void main(String[] args) { 24 | 25 | logger.debug("Loading Spring Application Context from Classpath"); 26 | 27 | ApplicationContext context = new ClassPathXmlApplicationContext 28 | ("event-client-spring.xml"); 29 | 30 | //argument determines the encounter json file 31 | if (args.length > 0) { 32 | 33 | switch (args[0]) { 34 | 35 | case "Leon": 36 | 37 | sendEncounter1(context); 38 | 39 | break; 40 | 41 | case "Roy": 42 | 43 | sendEncounter2(context); 44 | 45 | break; 46 | 47 | case "Eldon": 48 | 49 | sendEncounter3(context); 50 | 51 | break; 52 | } 53 | 54 | 55 | } else { 56 | 57 | //no argument passed 58 | sendEncounter2(context); 59 | } 60 | } 61 | 62 | /** 63 | * Send an Encounter 1 JSON to the Ingenstion Queue 64 | * @param context 65 | */ 66 | private static void sendEncounter1(ApplicationContext context) { 67 | 68 | JmsTemplate jmsTemplate = (JmsTemplate) context.getBean("jmsQueueTemplate"); 69 | 70 | /* 71 | * http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/jms/core/MessageCreator.html 72 | */ 73 | jmsTemplate.send(session -> { 74 | 75 | TextMessage message = null; 76 | 77 | message = session.createTextMessage 78 | (getJSONFromFile("encounter1.json")); 79 | 80 | message.setStringProperty("Mime Type", "application/json"); 81 | 82 | return message; 83 | 84 | }); 85 | 86 | logger.debug("Check: http://localhost:8161/admin/queues.jsp"); 87 | } 88 | 89 | /** 90 | * Send an Encounter 2 JSON to the Ingenstion Queue 91 | * @param context 92 | */ 93 | private static void sendEncounter2(ApplicationContext context) { 94 | 95 | JmsTemplate jmsTemplate = (JmsTemplate) context.getBean("jmsQueueTemplate"); 96 | 97 | /* 98 | * http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/jms/core/MessageCreator.html 99 | */ 100 | jmsTemplate.send(session -> { 101 | 102 | TextMessage message = null; 103 | 104 | message = session.createTextMessage 105 | (getJSONFromFile("encounter2.json")); 106 | 107 | message.setStringProperty("Mime Type", "application/json"); 108 | 109 | return message; 110 | 111 | }); 112 | 113 | logger.debug("Check: http://localhost:8161/admin/queues.jsp"); 114 | } 115 | 116 | /** 117 | * Send an Encounter 3 JSON to the Ingenstion Queue 118 | * @param context 119 | */ 120 | private static void sendEncounter3(ApplicationContext context) { 121 | 122 | JmsTemplate jmsTemplate = (JmsTemplate) context.getBean("jmsQueueTemplate"); 123 | 124 | /* 125 | * http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/jms/core/MessageCreator.html 126 | */ 127 | jmsTemplate.send(session -> { 128 | 129 | TextMessage message = null; 130 | 131 | message = session.createTextMessage 132 | (getJSONFromFile("encounter3.json")); 133 | 134 | message.setStringProperty("Mime Type", "application/json"); 135 | 136 | return message; 137 | 138 | }); 139 | 140 | logger.debug("Check: http://localhost:8161/admin/queues.jsp"); 141 | } 142 | 143 | /** 144 | * Helper method for retrieving json from file 145 | * @param fileName 146 | * @return String 147 | */ 148 | private static String getJSONFromFile(String fileName) { 149 | String json = null; 150 | StringBuffer text = new StringBuffer(); 151 | String line = null; 152 | 153 | try (BufferedReader in = new BufferedReader 154 | (new InputStreamReader(EventClient.class 155 | .getResourceAsStream(fileName)))) { 156 | 157 | while ((line = in.readLine()) != null) { 158 | text.append(line); 159 | } 160 | 161 | json = text.toString(); 162 | 163 | } catch (Exception e) { 164 | 165 | logger.debug("Failed to read test file " + fileName + " " + e.toString()); 166 | System.exit(1); 167 | } 168 | 169 | return json; 170 | } 171 | } -------------------------------------------------------------------------------- /event-test-harness/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | 8 | Event Client Application 9 | ws.cogito.test 10 | event-client 11 | 1.0.2 12 | jar 13 | 14 | 15 | 1.8 16 | 4.3.7.RELEASE 17 | 5.14.0 18 | 18.0 19 | UTF-8 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | org.springframework 28 | spring-core 29 | ${spring.version} 30 | 31 | 32 | 33 | org.springframework 34 | spring-context 35 | ${spring.version} 36 | 37 | 38 | 39 | org.springframework 40 | spring-context-support 41 | ${spring.version} 42 | 43 | 44 | 45 | org.springframework 46 | spring-jms 47 | ${spring.version} 48 | 49 | 50 | 51 | 52 | org.apache.activemq 53 | activemq-all 54 | ${activemq.version} 55 | 56 | 57 | 58 | commons-io 59 | commons-io 60 | 2.4 61 | 62 | 63 | 64 | 65 | 66 | com.google.guava 67 | guava 68 | ${google-guava.version} 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | central 78 | Maven Repository Switchboard 79 | http://repo1.maven.org/maven2 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | org.apache.maven.plugins 90 | maven-compiler-plugin 91 | 3.3 92 | 93 | ${java-version} 94 | ${java-version} 95 | 96 | 97 | 98 | org.apache.maven.plugins 99 | maven-shade-plugin 100 | 2.4.1 101 | 102 | 103 | package 104 | 105 | shade 106 | 107 | 108 | 109 | 111 | ws.cogito.test.application.EventClient 112 | 113 | 115 | META-INF/spring.handlers 116 | 117 | 119 | META-INF/spring.schemas 120 | 121 | 123 | META-INF/spring.tooling 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | org.apache.maven.plugins 132 | maven-dependency-plugin 133 | 2.10 134 | 135 | 136 | org.apache.maven.plugins 137 | maven-resources-plugin 138 | 2.7 139 | 140 | UTF-8 141 | 142 | 143 | 144 | org.apache.maven.plugins 145 | maven-eclipse-plugin 146 | 2.10 147 | 148 | false 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 12456789 158 | Jeremy Deane 159 | jeremy.deane@gmail.com 160 | http://www.jeremydeane.net 161 | 162 | 123-435-2345 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /event-care-management/src/test/jmeter/Mock Camel Publisher.jmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | true 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | false 17 | 1 18 | 19 | 1 20 | 0 21 | 1192735910000 22 | 1192735910000 23 | false 24 | continue 25 | 26 | 27 | 28 | 29 | 30 | Assumes ActiveMQ All JAR in JMeter Lib Directory 31 | ConnectionFactory 32 | EventInpatient 33 | 34 | true 35 | false 36 | false 37 | 38 | { 39 | "resourceType": "Encounter", 40 | "id": "EMR56788", 41 | "text": { 42 | "status": "generated", 43 | "div": "Patient admitted with chest pains</div>" 44 | }, 45 | "status": "in-progress", 46 | "class": "inpatient", 47 | "patient": { 48 | "reference": "Patient/P12345", 49 | "display": "Roy Batty" 50 | } 51 | } 52 | org.apache.activemq.jndi.ActiveMQInitialContextFactory 53 | tcp://localhost:61616 54 | 55 | 56 | 57 | queue.EventInpatient 58 | event.inpatient 59 | = 60 | 61 | 62 | 63 | 64 | 65 | 66 | mimetype 67 | application/json 68 | java.lang.String 69 | 70 | 71 | 72 | 73 | 74 | 75 | false 76 | 77 | saveConfig 78 | 79 | 80 | true 81 | true 82 | true 83 | 84 | true 85 | true 86 | true 87 | true 88 | false 89 | true 90 | true 91 | false 92 | false 93 | true 94 | false 95 | false 96 | false 97 | false 98 | false 99 | 0 100 | true 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /event-auditing/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.0.3.RELEASE 10 | 11 | 12 | ws.cogito.microservices 13 | event-audit-router 14 | 1.0.4 15 | jar 16 | Audits event messages 17 | Event Auditor 18 | http://www.cogito.ws 19 | 20 | 21 | 2.0.3.RELEASE 22 | 2.22.0 23 | 5.14.0 24 | UTF-8 25 | UTF-8 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-actuator 34 | ${spring.boot.version} 35 | 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-web 40 | ${spring.boot.version} 41 | 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-configuration-processor 46 | ${spring.boot.version} 47 | 48 | 49 | 50 | org.apache.camel 51 | camel-spring-boot 52 | ${camel.version} 53 | 54 | 55 | 56 | org.apache.camel 57 | camel-core 58 | ${camel.version} 59 | 60 | 61 | 62 | org.apache.camel 63 | camel-jms 64 | ${camel.version} 65 | 66 | 67 | 68 | org.apache.camel 69 | camel-spring 70 | ${camel.version} 71 | 72 | 73 | 74 | org.jolokia 75 | jolokia-core 76 | 1.6.0 77 | 78 | 79 | 80 | ws.cogito.microservices 81 | event-common 82 | 1.0.6 83 | 84 | 85 | 86 | org.apache.activemq 87 | activemq-all 88 | ${activemq.version} 89 | 90 | 91 | 92 | org.apache.activemq 93 | activemq-pool 94 | ${activemq.version} 95 | 96 | 97 | 98 | 99 | org.apache.camel 100 | camel-test 101 | ${camel.version} 102 | test 103 | 104 | 105 | 106 | junit 107 | junit 108 | 4.11 109 | test 110 | 111 | 112 | 113 | commons-io 114 | commons-io 115 | 1.3.2 116 | test 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | central 126 | Maven Repository Switchboard 127 | http://repo1.maven.org/maven2 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | src/main/resources 137 | true 138 | 139 | 140 | 141 | 142 | org.springframework.boot 143 | spring-boot-maven-plugin 144 | ${spring.boot.version} 145 | 146 | 147 | 148 | repackage 149 | 150 | 151 | 152 | 153 | 154 | org.apache.maven.plugins 155 | maven-compiler-plugin 156 | 3.3 157 | 158 | 1.8 159 | 1.8 160 | 161 | 162 | 163 | org.apache.maven.plugins 164 | maven-dependency-plugin 165 | 2.10 166 | 167 | 168 | org.apache.maven.plugins 169 | maven-resources-plugin 170 | 2.7 171 | 172 | UTF-8 173 | 174 | 175 | 176 | org.apache.maven.plugins 177 | maven-eclipse-plugin 178 | 2.10 179 | 180 | false 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 12456789 190 | Jeremy Deane 191 | jeremy.deane@gmail.com 192 | http://www.jeremydeane.net 193 | 194 | 123-435-2345 195 | 196 | 197 | 198 | 199 | -------------------------------------------------------------------------------- /event-cep/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.0.3.RELEASE 10 | 11 | 12 | ws.cogito.microservices 13 | event-cep-router 14 | 1.0.4 15 | jar 16 | Processing events for fraud 17 | Complex Event Processing 18 | http://www.cogito.ws 19 | 20 | 21 | 2.0.3.RELEASE 22 | 2.22.0 23 | 5.14.0 24 | UTF-8 25 | UTF-8 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-actuator 34 | ${spring.boot.version} 35 | 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-web 40 | ${spring.boot.version} 41 | 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-configuration-processor 46 | ${spring.boot.version} 47 | 48 | 49 | 50 | org.apache.camel 51 | camel-spring-boot 52 | ${camel.version} 53 | 54 | 55 | 56 | org.apache.camel 57 | camel-core 58 | ${camel.version} 59 | 60 | 61 | 62 | org.apache.camel 63 | camel-jms 64 | ${camel.version} 65 | 66 | 67 | 68 | org.apache.camel 69 | camel-spring 70 | ${camel.version} 71 | 72 | 73 | 74 | org.jolokia 75 | jolokia-core 76 | 1.6.0 77 | 78 | 79 | 80 | com.jayway.jsonpath 81 | json-path 82 | 2.0.0 83 | 84 | 85 | 86 | ws.cogito.microservices 87 | event-common 88 | 1.0.6 89 | 90 | 91 | 92 | org.apache.activemq 93 | activemq-all 94 | ${activemq.version} 95 | 96 | 97 | 98 | org.apache.activemq 99 | activemq-pool 100 | ${activemq.version} 101 | 102 | 103 | 104 | 105 | org.apache.camel 106 | camel-test 107 | ${camel.version} 108 | test 109 | 110 | 111 | 112 | junit 113 | junit 114 | 4.11 115 | test 116 | 117 | 118 | 119 | commons-io 120 | commons-io 121 | 1.3.2 122 | test 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | central 132 | Maven Repository Switchboard 133 | http://repo1.maven.org/maven2 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | src/main/resources 143 | true 144 | 145 | 146 | 147 | 148 | org.springframework.boot 149 | spring-boot-maven-plugin 150 | ${spring.boot.version} 151 | 152 | 153 | 154 | repackage 155 | 156 | 157 | 158 | 159 | 160 | org.apache.maven.plugins 161 | maven-compiler-plugin 162 | 3.3 163 | 164 | 1.8 165 | 1.8 166 | 167 | 168 | 169 | org.apache.maven.plugins 170 | maven-dependency-plugin 171 | 2.10 172 | 173 | 174 | org.apache.maven.plugins 175 | maven-resources-plugin 176 | 2.7 177 | 178 | UTF-8 179 | 180 | 181 | 182 | org.apache.maven.plugins 183 | maven-eclipse-plugin 184 | 2.10 185 | 186 | false 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 12456789 196 | Jeremy Deane 197 | jeremy.deane@gmail.com 198 | http://www.jeremydeane.net 199 | 200 | 123-435-2345 201 | 202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /event-care-management/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.0.3.RELEASE 10 | 11 | 12 | ws.cogito.microservices 13 | event-care-router 14 | 1.0.4 15 | jar 16 | Routes Care Events 17 | Care Event Router 18 | http://www.cogito.ws 19 | 20 | 21 | 2.0.3.RELEASE 22 | 2.22.0 23 | 5.14.0 24 | UTF-8 25 | UTF-8 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-actuator 34 | ${spring.boot.version} 35 | 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-web 40 | ${spring.boot.version} 41 | 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-configuration-processor 46 | ${spring.boot.version} 47 | 48 | 49 | 50 | org.apache.camel 51 | camel-spring-boot 52 | ${camel.version} 53 | 54 | 55 | 56 | org.apache.camel 57 | camel-core 58 | ${camel.version} 59 | 60 | 61 | 62 | org.apache.camel 63 | camel-jms 64 | ${camel.version} 65 | 66 | 67 | 68 | org.apache.camel 69 | camel-spring 70 | ${camel.version} 71 | 72 | 73 | 74 | org.jolokia 75 | jolokia-core 76 | 1.6.0 77 | 78 | 79 | 80 | ws.cogito.microservices 81 | event-common 82 | 1.0.6 83 | 84 | 85 | 86 | org.apache.activemq 87 | activemq-all 88 | ${activemq.version} 89 | 90 | 91 | 92 | org.apache.activemq 93 | activemq-pool 94 | ${activemq.version} 95 | 96 | 97 | 98 | 99 | org.apache.camel 100 | camel-test 101 | ${camel.version} 102 | test 103 | 104 | 105 | 106 | junit 107 | junit 108 | 4.11 109 | test 110 | 111 | 112 | 113 | commons-io 114 | commons-io 115 | 1.3.2 116 | test 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | central 126 | Maven Repository Switchboard 127 | http://repo1.maven.org/maven2 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | src/main/resources 137 | true 138 | 139 | 140 | 141 | 142 | org.springframework.boot 143 | spring-boot-maven-plugin 144 | ${spring.boot.version} 145 | 146 | 147 | 148 | repackage 149 | 150 | 151 | 152 | 153 | 154 | org.springframework.boot 155 | spring-boot-maven-plugin 156 | ${spring.boot.version} 157 | 158 | 159 | org.apache.maven.plugins 160 | maven-compiler-plugin 161 | 3.3 162 | 163 | 1.8 164 | 1.8 165 | 166 | 167 | 168 | org.apache.maven.plugins 169 | maven-dependency-plugin 170 | 2.10 171 | 172 | 173 | org.apache.maven.plugins 174 | maven-resources-plugin 175 | 2.7 176 | 177 | UTF-8 178 | 179 | 180 | 181 | org.apache.maven.plugins 182 | maven-eclipse-plugin 183 | 2.10 184 | 185 | false 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 12456789 195 | Jeremy Deane 196 | jeremy.deane@gmail.com 197 | http://www.jeremydeane.net 198 | 199 | 123-435-2345 200 | 201 | 202 | 203 | 204 | -------------------------------------------------------------------------------- /event-ingestion/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.0.3.RELEASE 10 | 11 | 12 | ws.cogito.microservices 13 | event-ingestion-router 14 | 1.0.4 15 | jar 16 | Ingests and routes event messages 17 | Event Ingestion Router 18 | http://www.cogito.ws 19 | 20 | 21 | 2.0.3.RELEASE 22 | 2.22.0 23 | 5.14.0 24 | UTF-8 25 | UTF-8 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-actuator 35 | ${spring.boot.version} 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-web 41 | ${spring.boot.version} 42 | 43 | 44 | 45 | org.springframework.boot 46 | spring-boot-configuration-processor 47 | ${spring.boot.version} 48 | 49 | 50 | 51 | org.apache.camel 52 | camel-spring-boot 53 | ${camel.version} 54 | 55 | 56 | 57 | org.apache.camel 58 | camel-core 59 | ${camel.version} 60 | 61 | 62 | 63 | org.apache.camel 64 | camel-jms 65 | ${camel.version} 66 | 67 | 68 | 69 | org.apache.camel 70 | camel-hystrix 71 | ${camel.version} 72 | 73 | 74 | 75 | org.apache.camel 76 | camel-http4 77 | ${camel.version} 78 | 79 | 80 | 81 | org.apache.camel 82 | camel-spring 83 | ${camel.version} 84 | 85 | 86 | 87 | org.apache.camel 88 | camel-jsonpath 89 | ${camel.version} 90 | 91 | 92 | 93 | org.jolokia 94 | jolokia-core 95 | 1.6.0 96 | 97 | 98 | 99 | net.minidev 100 | json-smart 101 | 2.2 102 | 103 | 104 | 105 | com.jayway.jsonpath 106 | json-path 107 | 2.0.0 108 | 109 | 110 | 111 | ws.cogito.microservices 112 | event-common 113 | 1.0.6 114 | 115 | 116 | 117 | org.apache.activemq 118 | activemq-all 119 | ${activemq.version} 120 | 121 | 122 | 123 | org.apache.activemq 124 | activemq-pool 125 | ${activemq.version} 126 | 127 | 128 | 129 | 130 | org.apache.camel 131 | camel-test 132 | ${camel.version} 133 | test 134 | 135 | 136 | 137 | junit 138 | junit 139 | 4.11 140 | test 141 | 142 | 143 | 144 | commons-io 145 | commons-io 146 | 1.3.2 147 | test 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | central 157 | Maven Repository Switchboard 158 | http://repo1.maven.org/maven2 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | src/main/resources 168 | true 169 | 170 | 171 | 172 | 173 | org.springframework.boot 174 | spring-boot-maven-plugin 175 | ${spring.boot.version} 176 | 177 | 178 | 179 | repackage 180 | 181 | 182 | 183 | 184 | 185 | org.apache.maven.plugins 186 | maven-compiler-plugin 187 | 3.3 188 | 189 | 1.8 190 | 1.8 191 | 192 | 193 | 194 | org.apache.maven.plugins 195 | maven-dependency-plugin 196 | 2.10 197 | 198 | 199 | org.apache.maven.plugins 200 | maven-resources-plugin 201 | 2.7 202 | 203 | UTF-8 204 | 205 | 206 | 207 | org.apache.maven.plugins 208 | maven-eclipse-plugin 209 | 2.10 210 | 211 | false 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 12456789 221 | Jeremy Deane 222 | jeremy.deane@gmail.com 223 | http://www.jeremydeane.net 224 | 225 | 123-435-2345 226 | 227 | 228 | 229 | 230 | -------------------------------------------------------------------------------- /event-auditing/src/test/jmeter/Mock Camel Publisher.jmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | true 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | false 17 | 1 18 | 19 | 1 20 | 0 21 | 1192735910000 22 | 1192735910000 23 | false 24 | continue 25 | 26 | 27 | 28 | 29 | 30 | Assumes ActiveMQ All JAR in JMeter Lib Directory 31 | ConnectionFactory 32 | EventAuditing 33 | 34 | true 35 | false 36 | false 37 | 38 | { 39 | "resourceType": "Encounter", 40 | "id": "EMR56789", 41 | "text": { 42 | "status": "generated", 43 | "div": "Nose bleeding and headaches</div>" 44 | }, 45 | "status": "in-progress", 46 | "class": "outpatient", 47 | "patient": { 48 | "reference": "Patient/P45678", 49 | "display": "Leon Kowalski" 50 | } 51 | } 52 | org.apache.activemq.jndi.ActiveMQInitialContextFactory 53 | tcp://localhost:61616 54 | 55 | 56 | 57 | queue.EventAuditing 58 | event.audit 59 | = 60 | 61 | 62 | 63 | 64 | 65 | 66 | mimetype 67 | application/json 68 | java.lang.String 69 | 70 | 71 | 72 | 73 | 74 | 75 | Assumes ActiveMQ All JAR in JMeter Lib Directory 76 | ConnectionFactory 77 | EventAuditing 78 | 79 | true 80 | false 81 | false 82 | 83 | { 84 | "resourceType": "Encounter", 85 | "id": "EMR56788", 86 | "text": { 87 | "status": "generated", 88 | "div": "Patient admitted with chest pains</div>" 89 | }, 90 | "status": "in-progress", 91 | "class": "inpatient", 92 | "patient": { 93 | "reference": "Patient/P12345", 94 | "display": "Roy Batty" 95 | } 96 | } 97 | org.apache.activemq.jndi.ActiveMQInitialContextFactory 98 | tcp://localhost:61616 99 | 100 | 101 | 102 | queue.EventAuditing 103 | event.audit 104 | = 105 | 106 | 107 | 108 | 109 | 110 | 111 | mimetype 112 | application/xml 113 | java.lang.String 114 | 115 | 116 | 117 | 118 | 119 | 120 | false 121 | 122 | saveConfig 123 | 124 | 125 | true 126 | true 127 | true 128 | 129 | true 130 | true 131 | true 132 | true 133 | false 134 | true 135 | true 136 | false 137 | false 138 | true 139 | false 140 | false 141 | false 142 | false 143 | false 144 | 0 145 | true 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /event-cep/src/test/jmeter/Mock Camel Publisher.jmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | true 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | false 17 | 1 18 | 19 | 1 20 | 0 21 | 1192735910000 22 | 1192735910000 23 | false 24 | continue 25 | 26 | 27 | 28 | 29 | 30 | Assumes ActiveMQ All JAR in JMeter Lib Directory 31 | ConnectionFactory 32 | EventCEP 33 | 34 | true 35 | false 36 | false 37 | 38 | { 39 | "resourceType": "Encounter", 40 | "id": "EMR56789", 41 | "text": { 42 | "status": "generated", 43 | "div": "Nose bleeding and headaches</div>" 44 | }, 45 | "status": "in-progress", 46 | "class": "outpatient", 47 | "patient": { 48 | "reference": "Patient/P45678", 49 | "display": "Leon Kowalski" 50 | } 51 | } 52 | org.apache.activemq.jndi.ActiveMQInitialContextFactory 53 | tcp://localhost:61616 54 | 55 | 56 | 57 | queue.EventCEP 58 | event.cep 59 | = 60 | 61 | 62 | 63 | 64 | 65 | 66 | mimetype 67 | application/json 68 | java.lang.String 69 | 70 | 71 | 72 | 73 | 74 | 75 | Assumes ActiveMQ All JAR in JMeter Lib Directory 76 | ConnectionFactory 77 | EventCEP 78 | 79 | true 80 | false 81 | false 82 | 83 | { 84 | "resourceType": "Encounter", 85 | "id": "EMR56788", 86 | "text": { 87 | "status": "generated", 88 | "div": "Patient admitted with chest pains</div>" 89 | }, 90 | "status": "in-progress", 91 | "class": "inpatient", 92 | "patient": { 93 | "reference": "Patient/P12345", 94 | "display": "Roy Batty" 95 | } 96 | } 97 | org.apache.activemq.jndi.ActiveMQInitialContextFactory 98 | tcp://localhost:61616 99 | 100 | 101 | 102 | queue.EventCEP 103 | event.cep 104 | = 105 | 106 | 107 | 108 | 109 | 110 | 111 | mimetype 112 | application/json 113 | java.lang.String 114 | 115 | 116 | 117 | 118 | 119 | 120 | Assumes ActiveMQ All JAR in JMeter Lib Directory 121 | ConnectionFactory 122 | EventCEP 123 | 124 | true 125 | false 126 | false 127 | 128 | { 129 | "resourceType": "Encounter", 130 | "id": "EMR56799", 131 | "text": { 132 | "status": "generated", 133 | "div": "Patient admitted with massive headache</div>" 134 | }, 135 | "status": "in-progress", 136 | "class": "outpatient", 137 | "patient": { 138 | "reference": "Patient/99999", 139 | "display": "Eldon Tyrell" 140 | } 141 | } 142 | org.apache.activemq.jndi.ActiveMQInitialContextFactory 143 | tcp://localhost:61616 144 | 145 | 146 | 147 | queue.EventCEP 148 | event.cep 149 | = 150 | 151 | 152 | 153 | 154 | 155 | 156 | mimetype 157 | application/json 158 | java.lang.String 159 | 160 | 161 | 162 | 163 | 164 | 165 | false 166 | 167 | saveConfig 168 | 169 | 170 | true 171 | true 172 | true 173 | 174 | true 175 | true 176 | true 177 | true 178 | false 179 | true 180 | true 181 | false 182 | false 183 | true 184 | false 185 | false 186 | false 187 | false 188 | false 189 | 0 190 | true 191 | true 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /event-ingestion/src/test/jmeter/Mock Camel Publisher.jmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | true 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | false 17 | 1 18 | 19 | 1 20 | 0 21 | 1192735910000 22 | 1192735910000 23 | false 24 | continue 25 | 26 | 27 | 28 | 29 | 30 | Assumes ActiveMQ All JAR in JMeter Lib Directory 31 | ConnectionFactory 32 | EventIngestion 33 | 34 | true 35 | false 36 | false 37 | 38 | { 39 | "resourceType": "Encounter", 40 | "id": "EMR56789", 41 | "text": { 42 | "status": "generated", 43 | "div": "Nose bleeding and headaches</div>" 44 | }, 45 | "status": "in-progress", 46 | "class": "outpatient", 47 | "patient": { 48 | "reference": "Patient/P45678", 49 | "display": "Leon Kowalski" 50 | } 51 | } 52 | org.apache.activemq.jndi.ActiveMQInitialContextFactory 53 | tcp://localhost:61616 54 | 55 | 56 | 57 | queue.EventIngestion 58 | event.ingestion 59 | = 60 | 61 | 62 | 63 | 64 | 65 | 66 | mimetype 67 | application/json 68 | java.lang.String 69 | 70 | 71 | 72 | 73 | 74 | 75 | Assumes ActiveMQ All JAR in JMeter Lib Directory 76 | ConnectionFactory 77 | EventIngestion 78 | 79 | true 80 | false 81 | false 82 | 83 | { 84 | "resourceType": "Encounter", 85 | "id": "EMR56788", 86 | "text": { 87 | "status": "generated", 88 | "div": "Patient admitted with chest pains</div>" 89 | }, 90 | "status": "in-progress", 91 | "class": "inpatient", 92 | "patient": { 93 | "reference": "Patient/P12345", 94 | "display": "Roy Batty" 95 | } 96 | } 97 | org.apache.activemq.jndi.ActiveMQInitialContextFactory 98 | tcp://localhost:61616 99 | 100 | 101 | 102 | queue.EventIngestion 103 | event.ingestion 104 | = 105 | 106 | 107 | 108 | 109 | 110 | 111 | mimetype 112 | application/json 113 | java.lang.String 114 | 115 | 116 | 117 | 118 | 119 | 120 | Assumes ActiveMQ All JAR in JMeter Lib Directory 121 | ConnectionFactory 122 | EventIngestion 123 | 124 | true 125 | false 126 | false 127 | 128 | { 129 | "resourceType": "Encounter", 130 | "id": "EMR56799", 131 | "text": { 132 | "status": "generated", 133 | "div": "Patient admitted with massive headache</div>" 134 | }, 135 | "status": "in-progress", 136 | "class": "outpatient", 137 | "patient": { 138 | "reference": "Patient/99999", 139 | "display": "Eldon Tyrell" 140 | } 141 | } 142 | org.apache.activemq.jndi.ActiveMQInitialContextFactory 143 | tcp://localhost:61616 144 | 145 | 146 | 147 | queue.EventIngestion 148 | event.ingestion 149 | = 150 | 151 | 152 | 153 | 154 | 155 | 156 | mimetype 157 | application/json 158 | java.lang.String 159 | 160 | 161 | 162 | 163 | 164 | 165 | false 166 | 167 | saveConfig 168 | 169 | 170 | true 171 | true 172 | true 173 | 174 | true 175 | true 176 | true 177 | true 178 | false 179 | true 180 | true 181 | false 182 | false 183 | true 184 | false 185 | false 186 | false 187 | false 188 | false 189 | 0 190 | true 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | --------------------------------------------------------------------------------