screwdriver-queue-service 2.0.21 → 2.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "screwdriver-queue-service",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"description": "Screwdriver Queue Service API",
|
|
5
5
|
"main": "app.js",
|
|
6
6
|
"directories": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"node-resque": "^5.5.3",
|
|
29
29
|
"npm-auto-version": "^1.0.0",
|
|
30
30
|
"redlock": "^4.2.0",
|
|
31
|
-
"screwdriver-aws-producer-service": "^1.
|
|
31
|
+
"screwdriver-aws-producer-service": "^1.3.0",
|
|
32
32
|
"screwdriver-data-schema": "^21.16.0",
|
|
33
33
|
"screwdriver-executor-docker": "^5.0.2",
|
|
34
34
|
"screwdriver-executor-jenkins": "^5.0.1",
|
|
@@ -136,12 +136,13 @@ async function pushToRabbitMq(message, queue, messageId) {
|
|
|
136
136
|
* Push message to Kafka topic
|
|
137
137
|
* @param {Object} message Job and build config metadata
|
|
138
138
|
* @param {String} topic Topic name
|
|
139
|
+
* @param {String} messageId The message id
|
|
139
140
|
*/
|
|
140
|
-
async function pushToKafka(message, topic) {
|
|
141
|
-
const
|
|
141
|
+
async function pushToKafka(message, topic, messageId) {
|
|
142
|
+
const producer = await AWSProducer.connect();
|
|
142
143
|
|
|
143
|
-
if (
|
|
144
|
-
await AWSProducer.sendMessage(message, topic);
|
|
144
|
+
if (producer) {
|
|
145
|
+
await AWSProducer.sendMessage(producer, message, topic, messageId);
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
148
|
|
|
@@ -181,8 +182,9 @@ async function schedule(job, buildConfig) {
|
|
|
181
182
|
|
|
182
183
|
if (kafkaEnabled && buildConfig.provider) {
|
|
183
184
|
const { accountId, region } = buildConfig.provider;
|
|
185
|
+
const messageId = `${job}-${buildConfig.buildId}`;
|
|
184
186
|
|
|
185
|
-
return pushToKafka(msg, getTopicName(accountId, region));
|
|
187
|
+
return pushToKafka(msg, getTopicName(accountId, region), messageId);
|
|
186
188
|
}
|
|
187
189
|
|
|
188
190
|
if (rabbitmqConf.getConfig().schedulerMode) {
|