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 = [
149149 // add an empty attachments array
150150 newProject . attachments = [ ] ;
151151 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+ ) ;
156156 req . log . debug ( 'Sending event to Kafka bus for project %d' , newProject . id ) ;
157157 // emit event
158158 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() {
4242function createEvent ( type , message , logger ) {
4343 const body = JSON . stringify ( message ) ;
4444 logger . debug ( `Sending message: ${ JSON . stringify ( message ) } ` ) ;
45- return getClient ( ) . post ( '/v5/ bus/events' , {
45+ return getClient ( ) . post ( '/bus/events' , {
4646 type,
4747 message : body ,
4848 } )
Original file line number Diff line number Diff line change @@ -20,20 +20,20 @@ module.exports = (fapp, logger) => {
2020 } else {
2121 logger . info ( 'initializing RabbitMQ service' ) ;
2222 // RabbitMQ Initialization
23- // app.services.pubsub = new RabbitMQService(logger);
23+ app . services . pubsub = new RabbitMQService ( logger ) ;
2424
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+ } ) ;
3838 }
3939} ;
You can’t perform that action at this time.
0 commit comments