File tree Expand file tree Collapse file tree 3 files changed +19
-19
lines changed Expand file tree Collapse file tree 3 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -149,10 +149,10 @@ module.exports = [
149
149
// add an empty attachments array
150
150
newProject . attachments = [ ] ;
151
151
req . log . debug ( 'Sending event to RabbitMQ bus for project %d' , newProject . id ) ;
152
- // req.app.services.pubsub.publish(EVENT.ROUTING_KEY.PROJECT_DRAFT_CREATED,
153
- // newProject,
154
- // { correlationId: req.id },
155
- // );
152
+ req . app . services . pubsub . publish ( EVENT . ROUTING_KEY . PROJECT_DRAFT_CREATED ,
153
+ newProject ,
154
+ { correlationId : req . id } ,
155
+ ) ;
156
156
req . log . debug ( 'Sending event to Kafka bus for project %d' , newProject . id ) ;
157
157
// emit event
158
158
req . app . emit ( EVENT . ROUTING_KEY . PROJECT_DRAFT_CREATED , { req, project : newProject } ) ;
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function getClient() {
42
42
function createEvent ( type , message , logger ) {
43
43
const body = JSON . stringify ( message ) ;
44
44
logger . debug ( `Sending message: ${ JSON . stringify ( message ) } ` ) ;
45
- return getClient ( ) . post ( '/v5/ bus/events' , {
45
+ return getClient ( ) . post ( '/bus/events' , {
46
46
type,
47
47
message : body ,
48
48
} )
Original file line number Diff line number Diff line change @@ -20,20 +20,20 @@ module.exports = (fapp, logger) => {
20
20
} else {
21
21
logger . info ( 'initializing RabbitMQ service' ) ;
22
22
// RabbitMQ Initialization
23
- // app.services.pubsub = new RabbitMQService(logger);
23
+ app . services . pubsub = new RabbitMQService ( logger ) ;
24
24
25
- // // initialize RabbitMQ
26
- // app.services.pubsub.init(
27
- // config.get('rabbitmqURL'),
28
- // config.get('pubsubExchangeName'),
29
- // config.get('pubsubQueueName'),
30
- // )
31
- // .then(() => {
32
- // logger.info('RabbitMQ service initialized');
33
- // })
34
- // .catch((err) => {
35
- // logger.error('Error initializing services', err);
36
- // // gracefulShutdown()
37
- // });
25
+ // initialize RabbitMQ
26
+ app . services . pubsub . init (
27
+ config . get ( 'rabbitmqURL' ) ,
28
+ config . get ( 'pubsubExchangeName' ) ,
29
+ config . get ( 'pubsubQueueName' ) ,
30
+ )
31
+ . then ( ( ) => {
32
+ logger . info ( 'RabbitMQ service initialized' ) ;
33
+ } )
34
+ . catch ( ( err ) => {
35
+ logger . error ( 'Error initializing services' , err ) ;
36
+ // gracefulShutdown()
37
+ } ) ;
38
38
}
39
39
} ;
You can’t perform that action at this time.
0 commit comments