diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6ace27b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,17 @@ +on: + push: + branches: [main] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: "20" + - run: npm ci + - run: npm test + - uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_TOKEN }} diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 7ae576a..b86e29b 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,8 +2,8 @@ version: "3.5" services: pulsar: - image: apachepulsar/pulsar:3.1.1 - command: ["bin/pulsar", "standalone"] + image: apachepulsar/pulsar:3.0.2 + command: ["bin/pulsar", "standalone", "--no-functions-worker", "--no-stream-storage"] nodered: build: . diff --git a/src/pulsar-config.js b/src/pulsar-config.js index 9e67c05..14005fe 100644 --- a/src/pulsar-config.js +++ b/src/pulsar-config.js @@ -2,8 +2,8 @@ const Pulsar = require('pulsar-client'); module.exports = function(RED) { - function PulsarConfigNode(n) { - RED.nodes.createNode(this,n); + function PulsarConfigNode(parameters) { + RED.nodes.createNode(this, parameters); const node = this; node.on('close', function(removed, done) { if (node.client && removed) { @@ -35,17 +35,17 @@ module.exports = function(RED) { } }); node.client = new Pulsar.Client({ - serviceUrl: n.serviceUrl, - authentication: buildAuthentication(n.authentication), - operationTimeoutSeconds: n.operationTimeoutSeconds, - ioThreads: n.ioThreads, - messageListenerThreads: n.messageListenerThreads, - concurrentLookupRequest: n.concurrentLookupRequest, - useTls: n.useTls, - tlsTrustCertsFilePath: n.tlsTrustCertsFilePath, - tlsValidateHostname: n.tlsValidateHostname, - tlsAllowInsecureConnection: n.tlsAllowInsecureConnection, - statsIntervalSeconds: n.statsIntervalSeconds + serviceUrl: parameters.serviceUrl, + authentication: buildAuthentication(parameters.authentication), + operationTimeoutSeconds: parameters.operationTimeoutSeconds, + ioThreads: parameters.ioThreads, + messageListenerThreads: parameters.messageListenerThreads, + concurrentLookupRequest: parameters.concurrentLookupRequest, + useTls: parameters.useTls, + tlsTrustCertsFilePath: parameters.tlsTrustCertsFilePath, + tlsValidateHostname: parameters.tlsValidateHostname, + tlsAllowInsecureConnection: parameters.tlsAllowInsecureConnection, + statsIntervalSeconds: parameters.statsIntervalSeconds }); } catch (e) { node.error('Error creating pulsar client: ' + e);