Skip to content

Commit 7f3c73a

Browse files
author
Dushyant Bhalgami
authored
Revert "aggregate topic"
1 parent 1723d85 commit 7f3c73a

File tree

11 files changed

+91
-518
lines changed

11 files changed

+91
-518
lines changed

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@ You can update the configuration file or set values to the corresponding environ
2121
- `KAFKA_UPDATE_SUBMISSION_TOPIC` The update submission topic from which the app consumes events
2222
- `SUBMISSION_API_URL` The Submission API URL
2323
- `SUBMISSION_TIMEOUT` The Submission API timeout
24-
- `DB_POOL_SIZE` Pool size of database server, default to be 10
25-
- `DB_SERVER` legacy database server, e.g 'informixoltp_tcp'
26-
- `DB_NAME` legacy database name, e.g 'tcs_catalog'
27-
- `DB_ID_NAME` legacy CommonOLTP database name, e.g 'common_oltp'
28-
- `DB_HOST` legacy database host, e.g 'informix'
29-
- `DB_SERVICE` legacy database service, e.g 'sqlexec'
24+
- `DB_NAME` legacy database name 'dbname@db_server_name'
3025
- `DB_USERNAME` database username
3126
- `DB_PASSWORD` database password
3227
- `ID_SEQ_UPLOAD` upload database sequence

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ echo "================================"
4646
echo "env set"
4747
echo "initiating test"
4848
echo "================================"
49-
#docker-compose -f ecs-docker-compose.yml up --build lsp-app-test
49+
docker-compose -f ecs-docker-compose.yml up --build lsp-app-test
5050
echo "================================"
5151
echo "test completed"
5252
echo "================================"

config/default.js

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
module.exports = {
55
LOG_LEVEL: process.env.LOG_LEVEL || 'debug',
66

7-
KAFKA_CONCURRENCY: process.env.KAFKA_CONCURRENCY ? Number(process.env.KAFKA_CONCURRENCY) : 1,
8-
97
// The client group ID for committing and fetching offsets.
108
// All clients sharing the same group ID belong to the same group.
119
KAFKA_GROUP_ID: process.env.KAFKA_GROUP_ID || 'tc-submission-legacy-processor',
@@ -19,8 +17,6 @@ module.exports = {
1917
// The client cert key, can be (1) the path to the cert key file, or (2) the cert key content
2018
KAFKA_CLIENT_CERT_KEY: process.env.KAFKA_CLIENT_CERT_KEY || './docker/kafka/kafka-ssl/client.key',
2119

22-
KAFKA_AGGREGATE_SUBMISSION_TOPIC: process.env.KAFKA_AGGREGATE_SUBMISSION_TOPIC || 'submission.notification.aggregate',
23-
2420
// The topic from which the app consumes events
2521
KAFKA_NEW_SUBMISSION_TOPIC: process.env.KAFKA_NEW_SUBMISSION_TOPIC || 'submission.notification.create',
2622

@@ -39,29 +35,8 @@ module.exports = {
3935
// payload.types
4036
PAYLOAD_TYPES: process.env.PAYLOAD_TYPES || 'bcf2b43b-20df-44d1-afd3-7fc9798dfcae',
4137

42-
// The Informix db pool size
43-
DB_POOL_SIZE: process.env.DB_POOL_SIZE ? Number(process.env.DB_POOL_SIZE) : 10,
44-
45-
// The Informix Server Name
46-
DB_SERVER: process.env.DB_SERVER || 'informixoltp_tcp',
47-
48-
DB_PORT: process.env.DB_PORT || '2020',
49-
50-
DB_PROTOCOL: process.env.DB_PROTOCOL || 'onsoctcp',
51-
52-
DB_LOCALE: process.env.DB_LOCALE || 'en_US.57372',
53-
5438
// The Informix Database Name
55-
DB_NAME: process.env.DB_NAME || 'tcs_catalog',
56-
57-
// The CommonOLTP Database Name
58-
DB_ID_NAME: process.env.DB_ID_NAME || 'common_oltp',
59-
60-
// The Informix Host
61-
DB_HOST: process.env.DB_HOST || 'informix',
62-
63-
// The Informix Service
64-
DB_SERVICE: process.env.DB_SERVICE || 'sqlexec',
39+
DB_NAME: process.env.DB_NAME || 'tcs_catalog@informixoltp_tcp',
6540

6641
// The Informix Database Username
6742
DB_USERNAME: process.env.DB_USERNAME || 'informix',
@@ -90,4 +65,4 @@ module.exports = {
9065
CHALLENGE_INFO_API: process.env.CHALLENGE_INFO_API || 'http://mock-api-host:3000/challenges?filter=id={cid}', // {cid} gets replaced with challenge id
9166

9267
MM_CHALLENGE_SUBTRACK: process.env.MM_CHALLENGE_SUBTRACK || 'MARATHON_MATCH, DEVELOP_MARATHON_MATCH'
93-
};
68+
}

config/production.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = {
3636
PAYLOAD_TYPES: process.env.PAYLOAD_TYPES || 'bcf2b43b-20df-44d1-afd3-7fc9798dfcae',
3737

3838
// The Informix Database Name
39-
DB_NAME: process.env.DB_NAME || 'tcs_catalog',
39+
DB_NAME: process.env.DB_NAME || 'tcs_catalog@informixoltp_tcp',
4040

4141
// The Informix Database Username
4242
DB_USERNAME: process.env.DB_USERNAME || 'informix',

config/staging.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = {
3636
PAYLOAD_TYPES: process.env.PAYLOAD_TYPES || 'bcf2b43b-20df-44d1-afd3-7fc9798dfcae',
3737

3838
// The Informix Database Name
39-
DB_NAME: process.env.DB_NAME || 'tcs_catalog',
39+
DB_NAME: process.env.DB_NAME || 'tcs_catalog@informixoltp_tcp',
4040

4141
// The Informix Database Username
4242
DB_USERNAME: process.env.DB_USERNAME || 'informix',

config/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = {
3838
PAYLOAD_TYPES: process.env.PAYLOAD_TYPES || 'bcf2b43b-20df-44d1-afd3-7fc9798dfcae',
3939

4040
// The Informix Database Name
41-
DB_NAME: 'tcs_catalog',
41+
DB_NAME: 'tcs_catalog@informixoltp_tcp',
4242

4343
// The Informix Database Username
4444
DB_USERNAME: 'informix',

docker/legacy-submission-processor/lspDockerfile

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM appiriodevops/tc-database-scripts:base
1+
FROM ibmcom/informix-innovator-c:12.10.FC11IE
22

33
ARG servername=informix
44
ARG port=2021
@@ -7,38 +7,37 @@ USER root
77
RUN mkdir /app
88
WORKDIR /home/informix
99

10-
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
11-
RUN apt-get -qq update && apt-get -qq install -y \
12-
wget gcc g++ make xz-utils python2.7 git
10+
RUN apt-get update -qq && apt-get -qq install -y \
11+
wget gcc g++ make xz-utils python2.7 git curl
1312

1413
RUN wget -q -O node8.tar.xz https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x64.tar.xz \
1514
&& tar xfJ node8.tar.xz && rm -rf node8.tar.xz
1615

17-
1816
ENV SERVERNAME=$servername
1917
ENV SERVERPORT=$port
2018

21-
ENV INFORMIXDIR /opt/IBM/informix
19+
COPY docker/legacy-submission-processor/esql /opt/ibm/informix/bin/
20+
RUN chmod +x /opt/ibm/informix/bin/esql
21+
RUN echo "informixoltp_tcp onsoctcp $SERVERNAME sqlexec" \
22+
> /opt/ibm/informix/etc/sqlhosts.informixoltp_tcp
23+
24+
ENV INFORMIXDIR /opt/ibm/informix
2225
ENV INFORMIX_HOME /home/informix
2326
ENV INFORMIXSERVER informixoltp_tcp
2427
ENV INFORMIXTERM terminfo
2528
ENV CLIENT_LOCALE=en_US.utf8
2629
ENV DB_LOCALE=en_US.utf8
2730
ENV DBDATE Y4MD-
2831
ENV DBDELIMITER "|"
29-
30-
COPY docker/legacy-submission-processor/esql ${INFORMIXDIR}/bin/
31-
RUN chmod +x ${INFORMIXDIR}/bin/esql
32-
RUN echo "informixoltp_tcp onsoctcp ${SERVERNAME:-informix} sqlexec" \
33-
> ${INFORMIXDIR}/etc/sqlhosts.informixoltp_tcp
34-
RUN echo "sqlexec 2021/tcp" >> /etc/services
35-
RUN rm /usr/bin/python && ln -s /usr/bin/python2.7 /usr/bin/python
3632
ENV PATH /home/informix/node-v8.11.3-linux-x64/bin:${INFORMIXDIR}/bin:${INFORMIXDIR}/lib:${INFORMIXDIR}/lib/esql:${PATH}
37-
ENV LD_LIBRARY_PATH ${INFORMIXDIR}/lib:$INFORMIXDIR/lib/esql:$INFORMIXDIR/lib/tools:${INFORMIXDIR}/lib/cli
38-
ENV INFORMIXSQLHOSTS ${INFORMIXDIR}/etc/sqlhosts.informixoltp_tcp
33+
ENV LD_LIBRARY_PATH ${INFORMIXDIR}/lib:$INFORMIXDIR/lib/esql:$INFORMIXDIR/lib/tools
34+
ENV INFORMIXSQLHOSTS /opt/ibm/informix/etc/sqlhosts.informixoltp_tcp
3935
ENV USER root
4036
ENV LICENSE accept
4137

38+
RUN ln -s /usr/bin/python2.7 /usr/bin/python
39+
RUN echo "sqlexec $SERVERPORT/tcp" >> /etc/services
40+
4241
WORKDIR /app
4342
COPY . .
4443
RUN npm --unsafe-perm install

index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/**
22
* The main entry of the application.
33
*/
4-
require('legacy-processor-module/bootstrap');
4+
require('legacy-processor-module/bootstrap')
55

6-
const config = require('config');
7-
const KafkaConsumer = require('legacy-processor-module/KafkaConsumer');
6+
const config = require('config')
7+
const KafkaConsumer = require('legacy-processor-module/KafkaConsumer')
88

9-
const SubmissionService = require('./src/services/SubmissionService');
9+
const SubmissionService = require('./src/services/SubmissionService')
1010

11-
const consumer = KafkaConsumer.startConsumer(SubmissionService, [config.KAFKA_AGGREGATE_SUBMISSION_TOPIC]);
11+
const consumer = KafkaConsumer.startConsumer(SubmissionService, [config.KAFKA_NEW_SUBMISSION_TOPIC, config.KAFKA_UPDATE_SUBMISSION_TOPIC])
1212

1313
if (process.env.NODE_ENV === 'test') {
14-
module.exports = consumer;
14+
module.exports = consumer
1515
}

0 commit comments

Comments
 (0)