1
- import { Replies , Message } from "amqplib/callback_api" ;
2
-
3
1
import AMQBBase from "./amqpBase" ;
4
2
import logger from "../../logger/logger" ;
5
3
6
-
7
4
class Producer extends AMQBBase {
8
-
9
- private static LOG_TAG = "Producer"
5
+ private static LOG_TAG = "Producer" ;
10
6
11
7
public static create ( url : string ) : Producer {
12
8
return new Producer ( url ) ;
@@ -29,12 +25,12 @@ class Producer extends AMQBBase {
29
25
30
26
return new Promise ( ( resolve , reject ) => {
31
27
this . assertExchange ( INTERMEDIATE_EXCHANGE , INTERMEDIATE_EXCHANGE_TYPE )
32
- . then ( _ => this . assertExchange ( FINAL_EXCHANGE , FINAL_EXCHANGE_TYPE ) )
33
- . then ( _ => this . assertQueue ( INTERMEDIATE_QUEUE , { deadLetterExchange : FINAL_EXCHANGE , } ) )
34
- . then ( _ => this . assertQueue ( FINAL_QUEUE , { } ) )
35
- . then ( _ => this . bindQueue ( INTERMEDIATE_QUEUE , INTERMEDIATE_EXCHANGE , "" ) )
36
- . then ( _ => this . bindQueue ( FINAL_QUEUE , FINAL_EXCHANGE , "" ) )
37
- . then ( _ => {
28
+ . then ( ( _ ) => this . assertExchange ( FINAL_EXCHANGE , FINAL_EXCHANGE_TYPE ) )
29
+ . then ( ( _ ) => this . assertQueue ( INTERMEDIATE_QUEUE , { deadLetterExchange : FINAL_EXCHANGE } ) )
30
+ . then ( ( _ ) => this . assertQueue ( FINAL_QUEUE , { } ) )
31
+ . then ( ( _ ) => this . bindQueue ( INTERMEDIATE_QUEUE , INTERMEDIATE_EXCHANGE , "" ) )
32
+ . then ( ( _ ) => this . bindQueue ( FINAL_QUEUE , FINAL_EXCHANGE , "" ) )
33
+ . then ( ( _ ) => {
38
34
this . channel ?. sendToQueue ( INTERMEDIATE_QUEUE , Buffer . from ( data ) , {
39
35
expiration : delayInMills ,
40
36
} ) ;
0 commit comments