Skip to content

Commit

Permalink
OZ-348: Align eip-demo service with the upgraded eip-client. (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliouzbett authored Jan 30, 2024
1 parent 6bfc2bf commit 52fbbde
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 174 deletions.
11 changes: 5 additions & 6 deletions demo/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ services:
env_file: ../eip.env
environment:
- NUMBER_OF_DEMO_PATIENTS=${NUMBER_OF_DEMO_PATIENTS}
- EIP_DB_NAME=${EIP_DB_NAME_DEMO}
- EIP_DB_USER=${EIP_DB_USER_DEMO}
- EIP_DB_PASSWORD=${EIP_DB_PASSWORD_DEMO}
- EIP_PROFILE=prod
- OPENMRS_URL=http://openmrs:8080/openmrs
volumes:
- "./eip/config:/config"
- "./eip/routes:/routes"
- "./eip/config:/eip-client/config"
- "./eip/routes:/eip-client/routes"
networks:
ozone:

networks:
ozone:
web:
external: true
external: true
153 changes: 3 additions & 150 deletions demo/eip/config/application.properties
Original file line number Diff line number Diff line change
@@ -1,159 +1,12 @@
# Number of demo patients used to generate demo data, defaults to 0
number.of.demo.patients=${NUMBER_OF_DEMO_PATIENTS}

camel.springboot.xml-routes=classpath*:camel/*.xml,file:routes/*.xml,file:routes/*/*.xml,file:routes/*/*/*.xml

openmrs.db.host=${OPENMRS_DB_HOST}

# The OpenMRS MySQL database port
openmrs.db.port=${OPENMRS_DB_PORT}

# The OpenMRS MySQL database name
openmrs.db.name=${OPENMRS_DB_NAME}
# *********************** General EIP sender properties ****************************************************************
#

# Maximum size of each batch of source records to be read by debezium from the binlog files, maps to the
## debezium MySQL connector property named max.batch.size
#https://debezium.io/documentation/reference/1.6/connectors/mysql.html#mysql-property-max-batch-size
debezium.reader.maxBatchSize=2048

#Enabled Oauth when set to true
oauth.enabled=${OAUTH_ENABLED}

#The client Id of the account
oauth.access.token.uri=${OAUTH_ACCESS_TOKEN_URI}

#The client Id of the account to use to authenticate
oauth.client.id=${OAUTH_CLIENT_ID}

#The client secret of the account to use to authenticate
oauth.client.secret=${OAUTH_CLIENT_SECRET}
#Authentication scope, can be multiple values separated by commas
oauth.client.scope=email

eip.home=/eip-home

# A comma separated list of database tables names to watch for changes
eip.watchedTables=

db-event.destinations=no-destination-routes

# ----------------------------------------------------------------------------------------------------------------------


# *********************** Logging Configuration ************************************************************************
#
# Uncomment this to use console logging otherwise defaults to the logback.xml file located on the classpath which is
# configured to log to ${eip.home}/logs/openmrs-eip.log
logging.config=classpath:logback-console.xml

# Logging level for the application loggers (all built-in routes and classes)
openmrs.eip.log.level=INFO

# Logging level for ONLY application class loggers
logging.level.org.openmrs.eip=${openmrs.eip.log.level}
# ----------------------------------------------------------------------------------------------------------------------


# *********************** Tomcat Configuration *************************************************************************
#
# Server HTTP port.
server.port=8083
# ----------------------------------------------------------------------------------------------------------------------


# *********************** H2 configuration *****************************************************************************
#
# Whether to enable the console
#spring.h2.console.enabled=false

# Path at which the console is available, defaults to /h2-console
# spring.h2.console.path=
# ----------------------------------------------------------------------------------------------------------------------


# *********************** Configuration of the OpenMRS Web App *********************************************************
#
# OpenMRS user credentials
openmrs.username=${OPENMRS_USER}
openmrs.password=${OPENMRS_PASSWORD}

# OpenMRS base url
openmrs.baseUrl=${OPENMRS_URL}/openmrs

# *********************** OpenMRS Datasource config ********************************************************************
#
# Driver class of the openMRS datasource (should not be changed in a usual use)
spring.openmrs-datasource.driverClassName=com.mysql.jdbc.Driver
#
# Dialect of the openMRS datasource (should not be changed in a usual use)
spring.openmrs-datasource.dialect=org.hibernate.dialect.MySQLDialect

# Url of the openMRS datasource, you don't have to change this value as long you've set the placeholder property values
spring.openmrs-datasource.jdbcUrl=jdbc:mysql://${openmrs.db.host}:${openmrs.db.port}/${openmrs.db.name}

# User name of the openMRS datasource
spring.openmrs-datasource.username=${OPENMRS_DB_USER}

# Password of the openMRS datasource
spring.openmrs-datasource.password=${OPENMRS_DB_PASSWORD}
# ----------------------------------------------------------------------------------------------------------------------


# *********************** Configuration of the Management database *****************************************************
#
# Driver class of the management datasource (should not be changed in a usual use)
spring.mngt-datasource.driverClassName=org.h2.Driver

# Dialect of the management datasource (should not be changed in a usual use)
spring.mngt-datasource.dialect=org.hibernate.dialect.H2Dialect
openmrs.baseUrl=${OPENMRS_URL}

# Url of the management datasource
spring.mngt-datasource.jdbcUrl=jdbc:h2:mem:${EIP_DB_NAME};DB_CLOSE_DELAY=30;LOCK_TIMEOUT=10000

# User name of the management datasource
spring.mngt-datasource.username=${EIP_DB_USER}

# Password of the management datasource
spring.mngt-datasource.password=${EIP_DB_PASSWORD}
# ----------------------------------------------------------------------------------------------------------------------


# *********************** Debezium Config ******************************************************************************
#
# For details explanations of this properties, please refer to
# https://debezium.io/documentation/reference/connectors/mysql.html#mysql-connector-properties
# Maps to the connect property named database.server.id, MUST match the server-id value in your my.cnf file when you
# enabled mysql binlog, DO NOT change after setting it
debezium.db.serverId=3

# Unique logical name of the MySQL database server, maps to the debezium MySQL connector property named
# database.server.name, DO NOT change after setting it
debezium.db.serverName=${openmrs.db.name}

# Database username for debezium user account you created to access the MySQL binlog, maps to the debezium MySQL
# connector property named database.user, it's highly recommended to create separate user account as described at
# https://debezium.io/documentation/reference/connectors/mysql.html#setting-up-mysql
debezium.db.user=${MYSQL_ADMIN_USER}

# Database password for debezium user account you created to access the MySQL binlog, maps to the debezium MySQL
# connector property named database.password
debezium.db.password=${MYSQL_ADMIN_USER_PASSWORD}

# Specifies the criteria for running a snapshot when the connector starts, DO NOT change after setting it, maps to the
# debezium MySQL connector property named snapshot.mode
debezium.snapshotMode=schema_only

# The 2 properties below are debezium engine specific and are documented at
# https://debezium.io/documentation/reference/development/engine.html#engine-properties
#
# Path to file where offsets are to be stored, maps to property named offset.storage.file.filename, DO NOT change after
# setting it
debezium.offsetFilename=offsets.txt

# Path to file where offsets are to be stored, maps to property named database.history.file.filename, DO NOT change
# after setting it
debezium.historyFilename=dbhistory.txt
# Number of demo patients used to generate demo data, defaults to 0
number.of.demo.patients=${NUMBER_OF_DEMO_PATIENTS}
# ----------------------------------------------------------------------------------------------------------------------
debezium.snapshotLockingMode=extended
17 changes: 0 additions & 17 deletions demo/eip/routes/authenticate-to-openmrs-route.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,5 @@
<simple>${exchangeProperty.basic-openmrs-authentication}</simple>
</setHeader>

<!-- If SSO is enabled then override basic authentication in favor of Oauth -->
<setBody>
<simple></simple>
</setBody>
<process ref="oauthProcessor" />
<choice>
<when>
<simple>${body} != null &amp;&amp; ${body} != ""</simple>
<setHeader name="Authorization">
<simple>${body}</simple>
</setHeader>
</when>
</choice>

<setBody>
<simple>${exchangeProperty.body}</simple>
</setBody>
</route>
</routes>
2 changes: 1 addition & 1 deletion demo/eip/routes/generate-demo-data-route.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Triggering generation of demo data on OpenMRS EMR after 10 minutes -->
<from uri="scheduler:generateDemoData?initialDelay=600000&amp;repeatCount=1" />

<log message="Sheduled demo data generation." />
<log message="Scheduled demo data generation." />

<to uri="direct:authenticate-to-openmrs"/>

Expand Down

0 comments on commit 52fbbde

Please sign in to comment.