![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@algoan/nestjs-google-pubsub-microservice
Advanced tools
A GooglePubSub transport strategy with NestJS Microservice
A Nest Google PubSub Microservice.
A custom NestJS Microservice transport strategy using Google Cloud PubSub.
npm install --save @algoan/pubsub @algoan/nestjs-google-pubsub-microservice
To start a new Google Cloud PubSub server:
Server setup:
// main.ts
import { GooglePubSubOptions } from '@algoan/pubsub';
import { INestMicroservice } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { GCPubSubServer } from '@algoan/nestjs-google-pubsub-microservice';
import { AppModule } from './app.module';
async function bootstrap() {
const options: GooglePubSubOptions = {
projectId: 'test',
subscriptionsPrefix: 'test-app',
}
const app: INestMicroservice = await NestFactory.createMicroservice(AppModule, {
strategy: new GCPubSubServer(options)
})
await app.listen();
console.log('Server running!')
}
bootstrap()
Controller:
import { EmittedMessage } from '@algoan/pubsub';
import { Controller } from '@nestjs/common';
import { EventPattern, Payload } from '@nestjs/microservices';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
/**
* Handle the test event
* @param data Payload sent
*/
@EventPattern('test_event')
public async handleTestEvent(@Payload() data: EmittedMessage<{ hello: string }>): Promise<void> {
/**
* Handle data emitted by Google PubSub
*/
this.appService.handleTestEvent(data);
}
}
This module uses @algoan/pubsub library which by default automatically acknowledges emitted messages.
GCPubSubServer(options)
Create a new Server instance of Google PubSub. It retrieves all message handlers patterns and creates subscriptions.
options
: Algoan PubSub options. More information here.options.listenOptions
: Global options which will be applied to all subscriptions.options.topicsNames
: Only subscribe to topics included in this whitelist.Other modules implementing Google Cloud PubSub with NestJS microservices:
FAQs
A GooglePubSub transport strategy with NestJS Microservice
The npm package @algoan/nestjs-google-pubsub-microservice receives a total of 1,169 weekly downloads. As such, @algoan/nestjs-google-pubsub-microservice popularity was classified as popular.
We found that @algoan/nestjs-google-pubsub-microservice demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.