Skip to content

Commit

Permalink
Cleanup messages that are logged
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Jul 4, 2023
1 parent 58d16c9 commit db55bdc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-message-bus",
"version": "3.1.0",
"version": "3.1.1",
"description": "Minimalistic and complete AMQP message bus implementation",
"main": "lib/index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ const channelPromise = getConnection()
json: true,
setup: async (channel: ConfirmChannel) => {
log(
`Waiting for RabbitMQ to be initialized by invoking initMessageBus() from 'node-message-bus'.`
`Waiting for AMQP to be initialized by invoking initMessageBus() from 'node-message-bus'.`
);
const config = await _initPromise;

await configureMessageBus(config, channel);

log(
`RabbitMQ initialization is complete with the following config: ${JSON.stringify(
`AMQP initialization is complete with the following config: ${JSON.stringify(
config
)}`
);
Expand Down
12 changes: 5 additions & 7 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ export const initConnection = async () => {

const connection = amqp.connect([connectionUrl], amqpConfig || undefined);
connection.on('connect', () => {
log(
`Connected to RabbitMQ: ${getPrintableConnectionString(connectionUrl)}`
);
log(`Connected to AMQP: ${getPrintableConnectionString(connectionUrl)}`);
});
connection.on('disconnect', ({ err }) => {
log(
`Disconnected from RabbitMQ: ${getPrintableConnectionString(
`Disconnected from AMQP: ${getPrintableConnectionString(
connectionUrl
)}, ${err}`
);
Expand All @@ -77,7 +75,7 @@ export const initConnection = async () => {
`Connection failed, likely because CloudAMQP instance is not yet up. Waiting... [${err}]`
);
} else {
log(`Failed to connect to RabbitMQ: ${err}; Retrying...`);
log(`Failed to connect to AMQP: ${err}; Retrying...`);
}
});

Expand All @@ -88,12 +86,12 @@ export const initConnection = async () => {
export const getConnection = () => initPromise;
export const closeMessageBusConnection = async () => {
log(
`Closing the connection to RabbitMQ: ${getPrintableConnectionString(
`Closing the connection to AMQP: ${getPrintableConnectionString(
connectionUrl
)}`
);
await (await getConnection()).close();
log(`RabbitMQ connection closed.`);
log(`AMQP connection closed.`);

if (isUsingCloudAmqp() && cloudAmqpInstanceId) {
await deleteCloudAmqpInstance({ id: cloudAmqpInstanceId });
Expand Down

0 comments on commit db55bdc

Please sign in to comment.