diff --git a/.dev/pubsub/samplePubsubPublisher.ts b/.dev/pubsub/samplePubsubPublisher.ts index 3006a484..836aca9c 100644 --- a/.dev/pubsub/samplePubsubPublisher.ts +++ b/.dev/pubsub/samplePubsubPublisher.ts @@ -1,13 +1,13 @@ import { PubSub } from "@google-cloud/pubsub"; -const pubsub = new PubSub({ +const pubSub = new PubSub({ projectId: process.env.PUBSUB_PROJECT_ID, keyFile: process.env.PUBSUB_KEY_FILE }); async function run() { const topicName = process.env.PUBSUB_TOPIC_NAME; - const topic = pubsub.topic(topicName!); + const topic = pubSub.topic(topicName!); const topicExists = (await topic.exists())[0]; if (!topicExists) throw new Error(`Topic ${topicName} does not exist.`); diff --git a/.dev/pubsub/samplePubsubReader.ts b/.dev/pubsub/samplePubsubReader.ts index 5fb4e36b..79d4c2c7 100644 --- a/.dev/pubsub/samplePubsubReader.ts +++ b/.dev/pubsub/samplePubsubReader.ts @@ -1,13 +1,13 @@ import { PubSub } from "@google-cloud/pubsub"; -const pubsub = new PubSub({ +const pubSub = new PubSub({ projectId: process.env.PUBSUB_PROJECT_ID, keyFile: process.env.PUBSUB_KEY_FILE }); async function run() { const topicName = process.env.PUBSUB_TOPIC_NAME; - const topic = pubsub.topic(topicName!); + const topic = pubSub.topic(topicName!); const topicExists = (await topic.exists())[0]; if (!topicExists) throw new Error(`Topic ${topicName} does not exist.`); diff --git a/CHANGELOG.md b/CHANGELOG.md index d932d58b..74a79c4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 3.6.0 -- new module: 'pubsubPublisher' (see https://enmeshed.eu/operate/configuration#pubsubPublisher for more details on how to configure it) +- new module: 'PubSubPublisher' (see https://enmeshed.eu/operate/configuration#PubSubPublisher for more details on how to configure it) - upgrade the runtime version to 2.10.0 ## 3.5.6 diff --git a/config/default.json b/config/default.json index fdc72e12..81219c1f 100644 --- a/config/default.json +++ b/config/default.json @@ -101,10 +101,10 @@ "displayName": "AMQP Publisher", "location": "amqpPublisher/AMQPPublisherModule" }, - "pubsubPublisher": { + "PubSubPublisher": { "enabled": false, "displayName": "PubSub Publisher", - "location": "pubsubPublisher/PubsubPublisherModule", + "location": "pubSubPublisher/PubSubPublisherModule", "projectId": "", "topic": "", "keyFile": "" diff --git a/src/modules/pubsubPublisher/PubsubPublisherModule.ts b/src/modules/pubSubPublisher/PubSubPublisherModule.ts similarity index 81% rename from src/modules/pubsubPublisher/PubsubPublisherModule.ts rename to src/modules/pubSubPublisher/PubSubPublisherModule.ts index 4c46f74f..f28f6114 100644 --- a/src/modules/pubsubPublisher/PubsubPublisherModule.ts +++ b/src/modules/pubSubPublisher/PubSubPublisherModule.ts @@ -3,14 +3,14 @@ import { DataEvent, Event } from "@js-soft/ts-utils"; import { DataEvent as RuntimeDataEvent } from "@nmshd/runtime"; import { ConnectorRuntimeModule, ConnectorRuntimeModuleConfiguration } from "../../ConnectorRuntimeModule"; -export interface PubsubPublisherModuleConfiguration extends ConnectorRuntimeModuleConfiguration { +export interface PubSubPublisherModuleConfiguration extends ConnectorRuntimeModuleConfiguration { projectId: string; topicName: string; keyFile: string; } -export default class PubsubPublisherModule extends ConnectorRuntimeModule { - private pubsub: PubSub; +export default class PubSubPublisherModule extends ConnectorRuntimeModule { + private pubSub: PubSub; private topic: Topic; public async init(): Promise { @@ -18,12 +18,12 @@ export default class PubsubPublisherModule extends ConnectorRuntimeModule { this.unsubscribeFromAllEvents(); - await this.pubsub.close().catch((e) => this.logger.error("Could not close the pubsub", e)); + await this.pubSub.close().catch((e) => this.logger.error("Could not close the PubSub object", e)); } }