@mojaloop/platform-shared-lib-nodejs-kafka-client-lib
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,1 +0,31 @@ | ||
declare const message: string; | ||
/***** | ||
License | ||
-------------- | ||
Copyright © 2017 Bill & Melinda Gates Foundation | ||
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
Contributors | ||
-------------- | ||
This is the official list (alphabetical ordering) of the Mojaloop project contributors for this file. | ||
Names of the original copyright holders (individuals or organizations) | ||
should be listed with a '*' in the first column. People who have | ||
contributed from an organization can be listed under the organization | ||
that actually holds the copyright for their contributions (see the | ||
Gates Foundation organization for an example). Those individuals should have | ||
their names indented and be marked with a '-'. Email address can be added | ||
optionally within square brackets <email>. | ||
* Gates Foundation | ||
- Name Surname <name.surname@gatesfoundation.com> | ||
* Crosslake | ||
- Pedro Sousa Barreto <pedrob@crosslaketech.com> | ||
-------------- | ||
******/ | ||
export * from './rdkafka_consumer'; | ||
export * from './rdkafka_producer'; |
@@ -0,4 +1,35 @@ | ||
/***** | ||
License | ||
-------------- | ||
Copyright © 2017 Bill & Melinda Gates Foundation | ||
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
Contributors | ||
-------------- | ||
This is the official list (alphabetical ordering) of the Mojaloop project contributors for this file. | ||
Names of the original copyright holders (individuals or organizations) | ||
should be listed with a '*' in the first column. People who have | ||
contributed from an organization can be listed under the organization | ||
that actually holds the copyright for their contributions (see the | ||
Gates Foundation organization for an example). Those individuals should have | ||
their names indented and be marked with a '-'. Email address can be added | ||
optionally within square brackets <email>. | ||
* Gates Foundation | ||
- Name Surname <name.surname@gatesfoundation.com> | ||
* Crosslake | ||
- Pedro Sousa Barreto <pedrob@crosslaketech.com> | ||
-------------- | ||
******/ | ||
'use strict'; | ||
const message = 'Hello, World!'; | ||
console.log(message); // eslint-disable-line no-console | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
(0, tslib_1.__exportStar)(require("./rdkafka_consumer"), exports); | ||
(0, tslib_1.__exportStar)(require("./rdkafka_producer"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,30 @@ | ||
/***** | ||
License | ||
-------------- | ||
Copyright © 2017 Bill & Melinda Gates Foundation | ||
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
Contributors | ||
-------------- | ||
This is the official list (alphabetical ordering) of the Mojaloop project contributors for this file. | ||
Names of the original copyright holders (individuals or organizations) | ||
should be listed with a '*' in the first column. People who have | ||
contributed from an organization can be listed under the organization | ||
that actually holds the copyright for their contributions (see the | ||
Gates Foundation organization for an example). Those individuals should have | ||
their names indented and be marked with a '-'. Email address can be added | ||
optionally within square brackets <email>. | ||
* Gates Foundation | ||
- Name Surname <name.surname@gatesfoundation.com> | ||
* Crosslake | ||
- Pedro Sousa Barreto <pedrob@crosslaketech.com> | ||
-------------- | ||
******/ | ||
import { ILogger } from '@mojaloop/logging-bc-logging-client-lib'; | ||
@@ -2,0 +31,0 @@ import { IMessageConsumer, IMessage } from '@mojaloop/platform-shared-lib-messaging-types-lib'; |
@@ -28,6 +28,2 @@ /***** | ||
* ModusBox | ||
- Miguel de Barros <miguel.debarros@modusbox.com> | ||
- Roman Pietrzak <roman.pietrzak@modusbox.com> | ||
-------------- | ||
@@ -68,3 +64,3 @@ ******/ | ||
this._logger?.isInfoEnabled() && this._logger.info('MLKafkaConsumer - instance created'); | ||
this._logger?.isInfoEnabled() && this._logger.info(`MLKafkaConsumer - features: ${RDKafka.features}`); | ||
this._logger?.isInfoEnabled() && this._logger.info(`MLKafkaConsumer - features: ${RDKafka.features.toString()}`); | ||
} | ||
@@ -118,3 +114,3 @@ _parseOptionsAndApplyDefault() { | ||
this._logger?.isDebugEnabled() && this._logger.debug('MLKafkaConsumer - ignoring message filtered out by filterFunction'); | ||
if (this._globalConfig['enable.auto.commit'] != true) { | ||
if (this._globalConfig['enable.auto.commit'] !== true) { | ||
// We are ignoring this message, but if we don't commit it and there will be no more messages that we can commit, | ||
@@ -135,3 +131,3 @@ // then all the ignored messages will appear "stuck". Everything reports lag. | ||
value: null, | ||
timestamp: kafkaMsg.timestamp || null, | ||
timestamp: kafkaMsg.timestamp ?? null, | ||
headers: null | ||
@@ -186,3 +182,3 @@ }; | ||
_commitMsg(kafkaMessage) { | ||
if (this._globalConfig['enable.auto.commit'] != true) { | ||
if (this._globalConfig['enable.auto.commit'] !== true) { | ||
if (this._options.useSyncCommit) { | ||
@@ -225,2 +221,6 @@ this._client.commitMessageSync(kafkaMessage); | ||
this._logger?.isInfoEnabled() && this._logger.info('MLKafkaConsumer - disconnect called...'); | ||
if (!this._client.isConnected()) { | ||
this._logger?.isWarnEnabled() && this._logger.warn('MLKafkaConsumer - disconnect called but consumer is not connected'); | ||
return resolve(); | ||
} | ||
this._client.disconnect((err, _data) => { | ||
@@ -227,0 +227,0 @@ if (err) { |
@@ -0,1 +1,30 @@ | ||
/***** | ||
License | ||
-------------- | ||
Copyright © 2017 Bill & Melinda Gates Foundation | ||
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
Contributors | ||
-------------- | ||
This is the official list (alphabetical ordering) of the Mojaloop project contributors for this file. | ||
Names of the original copyright holders (individuals or organizations) | ||
should be listed with a '*' in the first column. People who have | ||
contributed from an organization can be listed under the organization | ||
that actually holds the copyright for their contributions (see the | ||
Gates Foundation organization for an example). Those individuals should have | ||
their names indented and be marked with a '-'. Email address can be added | ||
optionally within square brackets <email>. | ||
* Gates Foundation | ||
- Name Surname <name.surname@gatesfoundation.com> | ||
* Crosslake | ||
- Pedro Sousa Barreto <pedrob@crosslaketech.com> | ||
-------------- | ||
******/ | ||
/// <reference types="node" /> | ||
@@ -2,0 +31,0 @@ import { EventEmitter } from 'events'; |
@@ -28,6 +28,2 @@ /***** | ||
* ModusBox | ||
- Miguel de Barros <miguel.debarros@modusbox.com> | ||
- Roman Pietrzak <roman.pietrzak@modusbox.com> | ||
-------------- | ||
@@ -51,5 +47,5 @@ ******/ | ||
this._parseOptionsAndApplyDefault(); | ||
this._topicConfig.partitioner_cb = () => { | ||
console.log(arguments); | ||
}; | ||
// this._topicConfig.partitioner_cb = () => { | ||
// console.log(arguments) | ||
// } | ||
this._client = new RDKafka.HighLevelProducer(this._globalConfig, this._topicConfig); | ||
@@ -197,2 +193,6 @@ this._client.on('ready', this._onReady.bind(this)); | ||
this._logger?.isInfoEnabled() && this._logger.info('MLKafkaProducer - disconnect called...'); | ||
if (!this._client.isConnected()) { | ||
this._logger?.isWarnEnabled() && this._logger.warn('MLKafkaProducer - disconnect called but producer is not connected'); | ||
return resolve(); | ||
} | ||
this._client.disconnect((err, _data) => { | ||
@@ -199,0 +199,0 @@ if (err) { |
{ | ||
"name": "@mojaloop/platform-shared-lib-nodejs-kafka-client-lib", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "mojaloop platform shared libraries", | ||
@@ -11,3 +11,3 @@ "license": "Apache-2.0", | ||
"contributors": [ | ||
"Miguel de Barros <miguel.debarros@modusbox.com>" | ||
"Pedro Sousa Barreto <pedrosousabarreto@gmail.com>" | ||
], | ||
@@ -36,2 +36,3 @@ "main": "./dist/index.js", | ||
"test:unit": "jest --passWithNoTests --testMatch '**/test/unit/**/*.test.ts'", | ||
"test:integration": "jest --passWithNoTests --testMatch '**/test/integration/**/*.test.ts'", | ||
"test:coverage": "jest --passWithNoTests --coverage --coverageThreshold='{}' --testMatch '**/test/unit/**/*.test.ts'", | ||
@@ -42,4 +43,3 @@ "test:coverage-check": "jest --coverage --testMatch '**/test/unit/**/*.test.ts'", | ||
"dep:check": "yarn run ncu -e 2", | ||
"dep:update": "yarn run ncu -u", | ||
"publish": "yarn npm publish --access public" | ||
"dep:update": "yarn run ncu -u" | ||
}, | ||
@@ -54,4 +54,4 @@ "dependencies": { | ||
"devDependencies": { | ||
"@mojaloop/messaging-types-lib": "^0.0.1", | ||
"@mojaloop/logging-bc-logging-client-lib": "^0.0.1", | ||
"@mojaloop/platform-shared-lib-messaging-types-lib": "^0.0.1", | ||
"@types/jest": "^27.0.3", | ||
@@ -80,2 +80,2 @@ "@typescript-eslint/eslint-plugin": "^5.4.0", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
64349
24
812
1