N
Novu•7mo ago
PidginEnemy

Error after trying to send message in a topic with big amount of subscribers

Hello, i use this method to trigger message in a topic - https://docs.novu.co/subscribers/topics#trigger-workflow-to-a-topic I got error in my production app, while i send message to topic and after my subscribers in topic became to big (more than 2 million subscribers in a topic). Error: RangeError: Invalid string length at JSON.stringify (<anonymous>) at TopicSubscribersRepository.mapEntities (/usr/src/app/libs/dal/dist/repositories/base-repository.js:199:86) at TopicSubscribersRepository.<anonymous> (/usr/src/app/libs/dal/dist/repositories/base-repository.js:93:25) at Generator.next (<anonymous>) at fulfilled (/usr/src/app/libs/dal/dist/repositories/base-repository.js:5:58) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) I have a few questions. - Do you have any restrictions, for example, max count of subscribers in a topic ? - Maybe you know different ways to send a message to topic, that have a lot of subscribers ?
4 Replies
Zac Clifton
Zac Clifton•7mo ago
No we do not have any restrictions and do not want to have any. Since you have brought this issue up we are going to look at making this possible starting next week. @George or I will give you an update if we find anything
PidginEnemy
PidginEnemy•7mo ago
i have tested again on new version 0.21, now method done with success code, in response i see transactionId and other. But nothing happens in activity feed 😦 how i can see active jobs in background ?
Zac Clifton
Zac Clifton•7mo ago
@George thoughts?
george.d
george.d•7mo ago
The reason behind this is that we've recently refactored the system. As a result, the API no longer handles the retrieval of topic subscribers, this responsibility now lies with the Worker instance. Therefore, you still haven't reached a point where any active jobs are present. We need to develop a more effective method for logging errors before any active jobs are introduced into the system. I've already created a ticket addressing this issue nv-2874. It's important to note that the system currently does not support having 2 million subscribers. As a temporary solution, consider exploring alternatives such as splitting the topic.