Showing
8 changed files
with
18 additions
and
18 deletions
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | # limitations under the License. | 14 | # limitations under the License. |
15 | # | 15 | # |
16 | 16 | ||
17 | -service-type: "TB_SERVICE_TYPE" #kafka (Apache Kafka) or aws-sqs (AWS SQS) or pubsub (PubSub) or service-bus (Azure Service Bus) or rabbitmq (RabbitMQ) | 17 | +queue_type: "TB_QUEUE_TYPE" #kafka (Apache Kafka) or aws-sqs (AWS SQS) or pubsub (PubSub) or service-bus (Azure Service Bus) or rabbitmq (RabbitMQ) |
18 | request_topic: "REMOTE_JS_EVAL_REQUEST_TOPIC" | 18 | request_topic: "REMOTE_JS_EVAL_REQUEST_TOPIC" |
19 | 19 | ||
20 | js: | 20 | js: |
@@ -25,18 +25,18 @@ kafka: | @@ -25,18 +25,18 @@ kafka: | ||
25 | # Kafka Bootstrap Servers | 25 | # Kafka Bootstrap Servers |
26 | servers: "TB_KAFKA_SERVERS" | 26 | servers: "TB_KAFKA_SERVERS" |
27 | replication_factor: "TB_QUEUE_KAFKA_REPLICATION_FACTOR" | 27 | replication_factor: "TB_QUEUE_KAFKA_REPLICATION_FACTOR" |
28 | - topic-properties: "TB_QUEUE_KAFKA_JE_TOPIC_PROPERTIES" | 28 | + topic_properties: "TB_QUEUE_KAFKA_JE_TOPIC_PROPERTIES" |
29 | 29 | ||
30 | pubsub: | 30 | pubsub: |
31 | project_id: "TB_QUEUE_PUBSUB_PROJECT_ID" | 31 | project_id: "TB_QUEUE_PUBSUB_PROJECT_ID" |
32 | service_account: "TB_QUEUE_PUBSUB_SERVICE_ACCOUNT" | 32 | service_account: "TB_QUEUE_PUBSUB_SERVICE_ACCOUNT" |
33 | - queue-properties: "TB_QUEUE_PUBSUB_JE_QUEUE_PROPERTIES" | 33 | + queue_properties: "TB_QUEUE_PUBSUB_JE_QUEUE_PROPERTIES" |
34 | 34 | ||
35 | aws_sqs: | 35 | aws_sqs: |
36 | access_key_id: "TB_QUEUE_AWS_SQS_ACCESS_KEY_ID" | 36 | access_key_id: "TB_QUEUE_AWS_SQS_ACCESS_KEY_ID" |
37 | secret_access_key: "TB_QUEUE_AWS_SQS_SECRET_ACCESS_KEY" | 37 | secret_access_key: "TB_QUEUE_AWS_SQS_SECRET_ACCESS_KEY" |
38 | region: "TB_QUEUE_AWS_SQS_REGION" | 38 | region: "TB_QUEUE_AWS_SQS_REGION" |
39 | - queue-properties: "TB_QUEUE_AWS_SQS_JE_QUEUE_PROPERTIES" | 39 | + queue_properties: "TB_QUEUE_AWS_SQS_JE_QUEUE_PROPERTIES" |
40 | 40 | ||
41 | rabbitmq: | 41 | rabbitmq: |
42 | host: "TB_QUEUE_RABBIT_MQ_HOST" | 42 | host: "TB_QUEUE_RABBIT_MQ_HOST" |
@@ -44,14 +44,14 @@ rabbitmq: | @@ -44,14 +44,14 @@ rabbitmq: | ||
44 | virtual_host: "TB_QUEUE_RABBIT_MQ_VIRTUAL_HOST" | 44 | virtual_host: "TB_QUEUE_RABBIT_MQ_VIRTUAL_HOST" |
45 | username: "TB_QUEUE_RABBIT_MQ_USERNAME" | 45 | username: "TB_QUEUE_RABBIT_MQ_USERNAME" |
46 | password: "TB_QUEUE_RABBIT_MQ_PASSWORD" | 46 | password: "TB_QUEUE_RABBIT_MQ_PASSWORD" |
47 | - queue-properties: "TB_QUEUE_RABBIT_MQ_JE_QUEUE_PROPERTIES" | 47 | + queue_properties: "TB_QUEUE_RABBIT_MQ_JE_QUEUE_PROPERTIES" |
48 | 48 | ||
49 | service_bus: | 49 | service_bus: |
50 | namespace_name: "TB_QUEUE_SERVICE_BUS_NAMESPACE_NAME" | 50 | namespace_name: "TB_QUEUE_SERVICE_BUS_NAMESPACE_NAME" |
51 | sas_key_name: "TB_QUEUE_SERVICE_BUS_SAS_KEY_NAME" | 51 | sas_key_name: "TB_QUEUE_SERVICE_BUS_SAS_KEY_NAME" |
52 | sas_key: "TB_QUEUE_SERVICE_BUS_SAS_KEY" | 52 | sas_key: "TB_QUEUE_SERVICE_BUS_SAS_KEY" |
53 | max_messages: "TB_QUEUE_SERVICE_BUS_MAX_MESSAGES" | 53 | max_messages: "TB_QUEUE_SERVICE_BUS_MAX_MESSAGES" |
54 | - queue-properties: "TB_QUEUE_SERVICE_BUS_JE_QUEUE_PROPERTIES" | 54 | + queue_properties: "TB_QUEUE_SERVICE_BUS_JE_QUEUE_PROPERTIES" |
55 | 55 | ||
56 | logger: | 56 | logger: |
57 | level: "LOGGER_LEVEL" | 57 | level: "LOGGER_LEVEL" |
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | # limitations under the License. | 14 | # limitations under the License. |
15 | # | 15 | # |
16 | 16 | ||
17 | -service-type: "kafka" | 17 | +queue_type: "kafka" |
18 | request_topic: "js_eval.requests" | 18 | request_topic: "js_eval.requests" |
19 | 19 | ||
20 | js: | 20 | js: |
@@ -25,13 +25,13 @@ kafka: | @@ -25,13 +25,13 @@ kafka: | ||
25 | # Kafka Bootstrap Servers | 25 | # Kafka Bootstrap Servers |
26 | servers: "localhost:9092" | 26 | servers: "localhost:9092" |
27 | replication_factor: "1" | 27 | replication_factor: "1" |
28 | - topic-properties: "retention.ms:604800000;segment.bytes:26214400;retention.bytes:104857600" | 28 | + topic_properties: "retention.ms:604800000;segment.bytes:26214400;retention.bytes:104857600" |
29 | 29 | ||
30 | pubsub: | 30 | pubsub: |
31 | - queue-properties: "ackDeadlineInSec:30;messageRetentionInSec:604800" | 31 | + queue_properties: "ackDeadlineInSec:30;messageRetentionInSec:604800" |
32 | 32 | ||
33 | aws_sqs: | 33 | aws_sqs: |
34 | - queue-properties: "VisibilityTimeout:30;MaximumMessageSize:262144;MessageRetentionPeriod:604800" | 34 | + queue_properties: "VisibilityTimeout:30;MaximumMessageSize:262144;MessageRetentionPeriod:604800" |
35 | 35 | ||
36 | rabbitmq: | 36 | rabbitmq: |
37 | host: "localhost" | 37 | host: "localhost" |
@@ -39,10 +39,10 @@ rabbitmq: | @@ -39,10 +39,10 @@ rabbitmq: | ||
39 | virtual_host: "/" | 39 | virtual_host: "/" |
40 | username: "admin" | 40 | username: "admin" |
41 | password: "password" | 41 | password: "password" |
42 | - queue-properties: "x-max-length-bytes:1048576000;x-message-ttl:604800000" | 42 | + queue_properties: "x-max-length-bytes:1048576000;x-message-ttl:604800000" |
43 | 43 | ||
44 | service_bus: | 44 | service_bus: |
45 | - queue-properties: "lockDurationInSec:30;maxSizeInMb:1024;messageTimeToLiveInSec:604800" | 45 | + queue_properties: "lockDurationInSec:30;maxSizeInMb:1024;messageTimeToLiveInSec:604800" |
46 | 46 | ||
47 | logger: | 47 | logger: |
48 | level: "info" | 48 | level: "info" |
@@ -26,7 +26,7 @@ const accessKeyId = config.get('aws_sqs.access_key_id'); | @@ -26,7 +26,7 @@ const accessKeyId = config.get('aws_sqs.access_key_id'); | ||
26 | const secretAccessKey = config.get('aws_sqs.secret_access_key'); | 26 | const secretAccessKey = config.get('aws_sqs.secret_access_key'); |
27 | const region = config.get('aws_sqs.region'); | 27 | const region = config.get('aws_sqs.region'); |
28 | const AWS = require('aws-sdk'); | 28 | const AWS = require('aws-sdk'); |
29 | -const queueProperties = config.get('aws_sqs.queue-properties'); | 29 | +const queueProperties = config.get('aws_sqs.queue_properties'); |
30 | const poolInterval = config.get('js.response_poll_interval'); | 30 | const poolInterval = config.get('js.response_poll_interval'); |
31 | 31 | ||
32 | let queueAttributes = {FifoQueue: 'true', ContentBasedDeduplication: 'true'}; | 32 | let queueAttributes = {FifoQueue: 'true', ContentBasedDeduplication: 'true'}; |
@@ -20,7 +20,7 @@ const config = require('config'), | @@ -20,7 +20,7 @@ const config = require('config'), | ||
20 | logger = require('../config/logger')._logger('kafkaTemplate'), | 20 | logger = require('../config/logger')._logger('kafkaTemplate'), |
21 | KafkaJsWinstonLogCreator = require('../config/logger').KafkaJsWinstonLogCreator; | 21 | KafkaJsWinstonLogCreator = require('../config/logger').KafkaJsWinstonLogCreator; |
22 | const replicationFactor = config.get('kafka.replication_factor'); | 22 | const replicationFactor = config.get('kafka.replication_factor'); |
23 | -const topicProperties = config.get('kafka.topic-properties'); | 23 | +const topicProperties = config.get('kafka.topic_properties'); |
24 | 24 | ||
25 | let kafkaClient; | 25 | let kafkaClient; |
26 | let kafkaAdmin; | 26 | let kafkaAdmin; |
@@ -24,7 +24,7 @@ const {PubSub} = require('@google-cloud/pubsub'); | @@ -24,7 +24,7 @@ const {PubSub} = require('@google-cloud/pubsub'); | ||
24 | const projectId = config.get('pubsub.project_id'); | 24 | const projectId = config.get('pubsub.project_id'); |
25 | const credentials = JSON.parse(config.get('pubsub.service_account')); | 25 | const credentials = JSON.parse(config.get('pubsub.service_account')); |
26 | const requestTopic = config.get('request_topic'); | 26 | const requestTopic = config.get('request_topic'); |
27 | -const queueProperties = config.get('pubsub.queue-properties'); | 27 | +const queueProperties = config.get('pubsub.queue_properties'); |
28 | 28 | ||
29 | let pubSubClient; | 29 | let pubSubClient; |
30 | 30 |
@@ -26,7 +26,7 @@ const port = config.get('rabbitmq.port'); | @@ -26,7 +26,7 @@ const port = config.get('rabbitmq.port'); | ||
26 | const vhost = config.get('rabbitmq.virtual_host'); | 26 | const vhost = config.get('rabbitmq.virtual_host'); |
27 | const username = config.get('rabbitmq.username'); | 27 | const username = config.get('rabbitmq.username'); |
28 | const password = config.get('rabbitmq.password'); | 28 | const password = config.get('rabbitmq.password'); |
29 | -const queueProperties = config.get('rabbitmq.queue-properties'); | 29 | +const queueProperties = config.get('rabbitmq.queue_properties'); |
30 | const poolInterval = config.get('js.response_poll_interval'); | 30 | const poolInterval = config.get('js.response_poll_interval'); |
31 | 31 | ||
32 | const amqp = require('amqplib/callback_api'); | 32 | const amqp = require('amqplib/callback_api'); |
@@ -26,7 +26,7 @@ const requestTopic = config.get('request_topic'); | @@ -26,7 +26,7 @@ const requestTopic = config.get('request_topic'); | ||
26 | const namespaceName = config.get('service_bus.namespace_name'); | 26 | const namespaceName = config.get('service_bus.namespace_name'); |
27 | const sasKeyName = config.get('service_bus.sas_key_name'); | 27 | const sasKeyName = config.get('service_bus.sas_key_name'); |
28 | const sasKey = config.get('service_bus.sas_key'); | 28 | const sasKey = config.get('service_bus.sas_key'); |
29 | -const queueProperties = config.get('service_bus.queue-properties'); | 29 | +const queueProperties = config.get('service_bus.queue_properties'); |
30 | 30 | ||
31 | let sbClient; | 31 | let sbClient; |
32 | let receiverClient; | 32 | let receiverClient; |
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | 16 | ||
17 | const config = require('config'), logger = require('./config/logger')._logger('main'); | 17 | const config = require('config'), logger = require('./config/logger')._logger('main'); |
18 | 18 | ||
19 | -const serviceType = config.get('service-type'); | 19 | +const serviceType = config.get('queue_type'); |
20 | switch (serviceType) { | 20 | switch (serviceType) { |
21 | case 'kafka': | 21 | case 'kafka': |
22 | logger.info('Starting kafka template.'); | 22 | logger.info('Starting kafka template.'); |