alexy4744 / packages Goto Github PK
View Code? Open in Web Editor NEW๐ฆ A collection of loosely related packages that you might find useful
๐ฆ A collection of loosely related packages that you might find useful
In this commit, a68da98, it appears that the streams
key was removed from the transport config. However the documentation hasn't been updated.
What is the expected config at this point?
Thanks!
While attempting to use the NATS JetStream Transporter, the NatsClient
send method does not return/receive a response from a value returned from @MessagePattern()
.
I would love to use this package as it would help us a ton, the consumer/event side works great! but we're stuck with the Message pattern...
The service will print the following output and no more when accessed via http://localhost:3000
:
[Nest] ...
>> jetstream functionality in nats.js is preview functionality
[Nest] 25247 - 08/03/2021, 4:53:52 PM [NatsServer] Subscribed to hello.> events
[Nest] 25247 - 08/03/2021, 4:53:52 PM [NatsServer] Subscribed to {"cmd":"sayHi"} messages
[Nest] 25247 - 08/03/2021, 4:53:52 PM [NatsServer] Connected to 127.0.0.1:4222
[Nest] 25247 - 08/03/2021, 4:53:52 PM [RoutesResolver] AppController {}: +5ms
[Nest] 25247 - 08/03/2021, 4:53:52 PM [RouterExplorer] Mapped {, GET} route +3ms
[Nest] 25247 - 08/03/2021, 4:53:52 PM [NestApplication] Nest application successfully started +2ms
[Nest] 25247 - 08/03/2021, 4:53:52 PM Listening +4ms
getHello
[Nest] 25247 - 08/03/2021, 4:55:04 PM [NatsClient] Connected to 127.0.0.1:4222
sayHi Leo
TAPPED undefined
The expectation is that it would also print Hi Leo
- am I missing something?
import { Controller, Get } from '@nestjs/common'
import { AppService } from './app.service'
import { EventPattern, Payload, Ctx, MessagePattern } from '@nestjs/microservices'
import { NatsContext, NatsClient } from '@alexy4744/nestjs-nats-jetstream-transporter'
import { Observable } from 'rxjs'
import { tap } from 'rxjs/operators'
import { StringCodec } from 'nats'
@Controller()
export class AppController {
private readonly client = new NatsClient({ codec: StringCodec() })
constructor(private readonly appService: AppService) {}
@Get()
getHello(): Observable<string> {
console.log('getHello')
const value = this.client.send<string>({ cmd: 'sayHi' }, 'Leo').pipe(
tap((obj) => {
console.log('TAPPED', obj)
}),
)
return value
}
@EventPattern('hello.>')
handleHello(@Payload() data: string, @Ctx() context: NatsContext): void {
console.log(data)
console.log(context)
}
@MessagePattern({ cmd: 'sayHi' })
sayHi(@Payload() data: string): string {
console.log('sayHi ', data)
return `Hi ${data}`
}
}
Is it possible to register a queue group by EventPattern instead of globally? I have a use case where i want certain messages to be Load balanced across multiple instances and another event be fan-out.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.