@tiledesk/tiledesk-server 2.4.15 → 2.4.16
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
@@ -15,6 +15,20 @@ var url = process.env.CLOUDAMQP_URL + "?heartbeat=60" || "amqp://localhost";
|
|
15
15
|
// attento devi aggiornare configMap di PRE E PROD
|
16
16
|
// var url = process.env.AMQP_URL + "?heartbeat=60" || "amqp://localhost?heartbeat=60";
|
17
17
|
|
18
|
+
var durable = false;
|
19
|
+
if (process.env.ENABLE_DURABLE_QUEUE == true || process.env.ENABLE_DURABLE_QUEUE == "true") {
|
20
|
+
durable = true;
|
21
|
+
}
|
22
|
+
winston.info("Durable queue: " + durable);
|
23
|
+
|
24
|
+
var persistent = false;
|
25
|
+
if (process.env.ENABLE_PERSISTENT_QUEUE == true || process.env.ENABLE_PERSISTENT_QUEUE == "true") {
|
26
|
+
persistent = true;
|
27
|
+
}
|
28
|
+
winston.info("Persistent queue: " + persistent);
|
29
|
+
|
30
|
+
|
31
|
+
|
18
32
|
var exchange = 'amq.topic';
|
19
33
|
|
20
34
|
function start() {
|
@@ -83,8 +97,8 @@ function startPublisher() {
|
|
83
97
|
// method to publish a message, will queue messages internally if the connection is down and resend later
|
84
98
|
function publish(exchange, routingKey, content) {
|
85
99
|
try {
|
86
|
-
pubChannel.publish(exchange, routingKey, content, {},
|
87
|
-
|
100
|
+
pubChannel.publish(exchange, routingKey, content, { persistent: persistent },
|
101
|
+
// pubChannel.publish(exchange, routingKey, content, { persistent: true },
|
88
102
|
|
89
103
|
function(err, ok) {
|
90
104
|
if (err) {
|
@@ -112,9 +126,12 @@ function startWorker() {
|
|
112
126
|
});
|
113
127
|
ch.prefetch(10);//leggila da env
|
114
128
|
ch.assertExchange(exchange, 'topic', {
|
115
|
-
durable:
|
129
|
+
durable: durable
|
130
|
+
// durable: true
|
116
131
|
});
|
117
|
-
|
132
|
+
|
133
|
+
ch.assertQueue("jobs", { durable: durable }, function(err, _ok) {
|
134
|
+
// ch.assertQueue("jobs", { durable: true }, function(err, _ok) {
|
118
135
|
if (closeOnErr(err)) return;
|
119
136
|
ch.bindQueue(_ok.queue, exchange, "request_create", {}, function(err3, oka) {
|
120
137
|
winston.info("Queue bind: "+_ok.queue+ " err: "+err3+ " key: request_create");
|