algoan / pubsub Goto Github PK
View Code? Open in Web Editor NEWA simple PubSub factory method exposing a listen-emit pattern
A simple PubSub factory method exposing a listen-emit pattern
Hello,
I noticed that the following method uses the same event string to get or create both the topic and the subscription. For this is impossible to create a topic with a different name than the subscription. Does it really make sense to use the same string for both? Shouldnt we be able to have different names for subscription and topic?
pubsub/src/GoogleCloudPubSub/GoogleCloudPubSub.ts
Lines 116 to 126 in eabb325
Hi, we found out a small bug. We have a NestJs micro-services with a couple of @EventPattern('my_event').
Until now it was working perfectly, we do a data.ack() at the end of the function. We also setup the dealLetter queue that after 5 not ack we send it to the deadLetter.
The thing is that it was working until we had 19 @EventPattern('my_event').
When we included more (20 and beyond), it seems like google pub/sub doesn't even acknowledge that the events have been received (all the events were affected).
We tried to console log the getOriginalMessage().deliveryAttempt and it doesn't increase even though event id is the same.
We still get the event, we still can ack it, there is no error... but pub/sub still resend the event again and again on the server restart.
And if we keep the number of @EventPattern('my_event') below 20 then it works fine again.
Do you know why? if there is a solution to be able to go over this limit ?
Thanks
Hello,
thank you for this library, it's amazing, is possible to configure subscription character separator, instead using % as fixed char?
Thank you in advance.
Hi,
thanks for this awesome package!
I want to set autoAck to false to ensure successful processing but then I cannot ack the message anymore since the EmittedMessages does not holds the original .ack() method anymore.
Best
Philipp
master
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project ✨
Your semantic-release bot 📦🚀
npm test
As you can see, 3 tests failed and I had to kill the process after about two minutes.
Tests are working in the CI environment, but it does not work locally...
Originally posted by @g-ongenae in #133 (comment)
Hi guys,
I am using pubsub.client.close()
method to close the connection to the pubsub but the subscription(created using pubsub.listen
) is not closed and the messages are received even after closing it.
What is the proper way to close the listening on subsription?
Greetings!
I've been playing around with your NestJS implementation with pubsub and it works really well. I'm looking for a way to set subscription options, such as ackDeadlineSeconds
and deadLetterPolicy
. Is there a way to do it with the current implementation? I'm having some trouble finding how to achieve this.
edit: I just digged through the code and it seems the subscriptions are made with autoCreate
, I believe you can't pass these options in this case :( anyway I'd like to ask if you have any idea how I can make a workaround, appreciate it!
I want to receive message from subscription one at a time (example: next msg should come only after previous one is acked/expired for same orderKey ) based on same orderingKeys and concurrently with different.
Hi @ccoeurderoy
Is there any option to prevent auto creation of topic and subscription if the new name is given?
There is a possible fix for this error (see here):
2023-04-24 07:04:25 | Node.js v19.8.1
2023-04-24 07:04:25 | }
2023-04-24 07:04:25 | errorCode: 'INVALID'
2023-04-24 07:04:25 | at async ModAckQueue.flush (/usr/src/app/silver/node_modules/@google-cloud/pubsub/build/src/message-queues.js:195:29) {
2023-04-24 07:04:25 | at async ModAckQueue._sendBatch (/usr/src/app/silver/node_modules/@google-cloud/pubsub/build/src/message-queues.js:476:31)
2023-04-24 07:04:25 | at async Promise.all (index 0)
2023-04-24 07:04:25 | at /usr/src/app/silver/node_modules/@google-cloud/pubsub/build/src/message-queues.js:470:43
2023-04-24 07:04:25 | at ModAckQueue.handleAckFailures (/usr/src/app/silver/node_modules/@google-cloud/pubsub/build/src/message-queues.js:328:18)
2023-04-24 07:04:25 | at Array.forEach (<anonymous>)
2023-04-24 07:04:25 | at /usr/src/app/silver/node_modules/@google-cloud/pubsub/build/src/message-queues.js:330:29
2023-04-24 07:04:25 | AckError: INVALID : 3 INVALID_ARGUMENT: Some acknowledgement ids in the request were invalid. This could be because the acknowledgement ids have expired or the acknowledgement ids were malformed.
2023-04-24 07:04:25 |
2023-04-24 07:04:25 | ^
2023-04-24 07:04:25 | const exc = new subscriber_1.AckError(e[0], rpcError.message);
2023-04-24 07:04:25 | /usr/src/app/silver/node_modules/@google-cloud/pubsub/build/src/message-queues.js:330
I am using Google Pubsub in NestJs and when the data is recieved by the handler, the event loop gets blocked and I am unable to make any HTTP request to the API.
I am using Blocked At plugin to get the following stacktrace.
Blocked for 20320.787875ms, operation started here: [
' at AsyncHook.init (/Users/username/myproject/node_modules/.pnpm/[email protected]/node_modules/blocked-at/index.js:31:11)',
' at emitInitNative (node:internal/async_hooks:202:43)',
' at emitInitScript (node:internal/async_hooks:505:3)',
' at promiseInitHook (node:internal/async_hooks:324:3)',
' at promiseInitHookWithDestroyTracking (node:internal/async_hooks:328:3)',
' at /Users/username/myproject/node_modules/.pnpm/@[email protected]_3xexfhuxzzpm44flufjnppzrlu/node_modules/@nestjs/microservices/context/rpc-context-creator.js:43:23',
' at InterceptorsConsumer.intercept (/Users/username/myproject/node_modules/.pnpm/@[email protected]_kj7rymkcr5lkprk6tswpsa5dxa/node_modules/@nestjs/core/interceptors/interceptors-consumer.js:11:20)',
' at /Users/username/myproject/node_modules/.pnpm/@[email protected]_3xexfhuxzzpm44flufjnppzrlu/node_modules/@nestjs/microservices/context/rpc-context-creator.js:51:46',
' at /Users/username/myproject/node_modules/.pnpm/@[email protected]_3xexfhuxzzpm44flufjnppzrlu/node_modules/@nestjs/microservices/context/rpc-proxy.js:11:38',
' at eventHandler (/Users/username/myproject/node_modules/.pnpm/@[email protected]_3xexfhuxzzpm44flufjnppzrlu/node_modules/@nestjs/microservices/listeners-controller.js:55:53)',
' at Object.onMessage (/Users/username/myproject/node_modules/.pnpm/@[email protected]_o2upt3vfiv5amp3ncoauuaj7la/node_modules/@algoan/nestjs-google-pubsub-microservice/src/GooglePubSubServer.ts:110:13)',
' at Subscription.<anonymous> (/Users/username/myproject/node_modules/.pnpm/@[email protected]/node_modules/@algoan/pubsub/dist/src/GoogleCloudPubSub/GoogleCloudPubSub.js:33:22)',
' at Subscription.emit (node:events:513:28)',
' at Subscriber.<anonymous> (/Users/username/myproject/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/pubsub/src/subscription.ts:329:38)',
' at Subscriber.emit (node:events:513:28)',
' at /Users/username/myproject/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/pubsub/src/lease-manager.ts:243:47',
' at processTicksAndRejections (node:internal/process/task_queues:77:11)'
]
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.