Skip to content

Commit cf74252

Browse files
author
Vikas Agarwal
committed
added back rabbitmq
fixed error in accessing kafka bus api
1 parent 853e378 commit cf74252

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/routes/projects/create.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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 });

src/services/busApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function getClient() {
4242
function 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
})

src/services/index.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff 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
};

0 commit comments

Comments
 (0)