Questions tagged [moleculer]

Moleculer is a progressive microservices framework for Node.js

Moleculer is a progressive microservices framework for Node.js. It helps you to build efficient, reliable & scalable services. Moleculer provides many features for building and managing your microservices.

84 questions
1
vote
1 answer

What is the best approach to stream JSON from a REST API to an Express app?

I have a moleculer-based microservice that has an endpoint which outputs a large JSON object (around tens of thousands of objects) This is a structured JSON object and I know beforehand what it is going to look like. [ // ... tens of thousands of…
frishi
  • 862
  • 1
  • 10
  • 27
1
vote
1 answer

Constructing Context Object in MoleculerJS

I'm having trouble understanding the basic concept of MoleculerJS. I have a method called when a SQS message received. const msg = await receiveOneMessageFromSQS(); /* example structure of msg { userId: 1 } */ Now I need to call another service…
Eray
  • 7,038
  • 16
  • 70
  • 120
1
vote
2 answers

How to running independently docker images with moleculer instead using "compose up"?

I have got this docker-compose.yaml. It defines 1 service with the public API and 4 services (replicated) with another two microservices each one (one receives events and another one saves info to mongo). This works perfectly when i do…
dlopezgonzalez
  • 4,217
  • 5
  • 31
  • 42
1
vote
0 answers

Not getting data in react app after successful socket connection

I am trying to return some data to my react frontend from my moleculer backend upon connection over sockets. I am running into challenges in getting the data, and what's particularly confusing to me is, when I have an error on the backend, that full…
Muirik
  • 6,049
  • 7
  • 58
  • 116
1
vote
0 answers

NodeJS and mongoose CastError: Cast to [ObjectId] failed for value

I am using molecularjs actions to enter data into my database. Primarily I am using NodeJS with mongoose to define models. So far I am able to create a model but when I try to create an one-to-many relation it gives me this error errors: {…
Ehsan Nissar
  • 643
  • 2
  • 13
  • 35
1
vote
2 answers

Moleculer and micro front-end services

Is there a way to make micro frontends in the molecules framework? So one api/angular address would be angular and a drugin, e.g. api/react would be react
taaniel
  • 53
  • 5
1
vote
0 answers

Mongo - Bulk Insert Error on Duplicate ID

I am trying to insert multiple records in MongoDB, for a small number of records (less than 1000) it works fine. But with a huge data set it throws an error if there are any duplicate values. Is there a way to continue without an error if there are…
1
vote
2 answers

moleculer-web API gateway. onError never hit

We used the example from the moleculer website as the basis for our API gateway, and are a having issues when routes throw errors - the onError handler is never hit, the exception is unhandled and node crashes the app. Not the idea! I realise this…
kpollock
  • 3,899
  • 9
  • 42
  • 61
1
vote
2 answers

How do I get request body in Moleculer

According to the API documentation, to receive json as formData from a POST request, one must use body-parser. I have declared it in the gateway service but I can still not receive the formData in my action. api.service.js module.exports = { name:…
fabrigeas
  • 11
  • 1
  • 1
1
vote
1 answer

Moleculer js is not working on local server using Nodejs

I am using Node.js. When I try to install Moleculer framework for Node.js Iget this error: connect to server: Error:connect Econnrefused xxx.0.0.1:xxxx This are the commands I'm running: npm install moleculer npm install moleculer-cli -g moleculer…
amit
  • 1
  • 1
  • 18
  • 28
1
vote
1 answer

Node.js child_process.exec "/bin/sh: 1: docker: not found" error

I created a micro-service using the "Moleculer" framework. I used child_process.exec for running docker commands in a shell. I get "/bin/sh: 1: docker: not found" error. const { exec } = require("child_process"); . . . exec("docker --version",…
1
vote
1 answer

How to use Sequelize ORM Raw queries (Inline or already prepared SQL queries) in Moleculer.js

I am using sequelize ORM for Mysql Database. Now if I want to use Raw queries(Inline or already prepared SQL queries) in moleculer then how I can use it. e.g, SELECT user_name as UserName FROM users OR SELECT column-names FROM table-name1 LEFT JOIN…
Nimesh
  • 3,342
  • 1
  • 28
  • 35
1
vote
1 answer

How to reload/deploy moleculer services in production?

How should i deploy new versions of molecular services? The documentation explains well how to start them with moleculer-runner, but i can't find what is the proper way reload them without downtime.
azazdeaz
  • 113
  • 1
  • 6
1
vote
1 answer

Moleculer - how to mockup method inside jest?

To mockup using Jest, we usually use jest.spyOn. But how to mockup method inside Moleculer service?
Pewh Gosh
  • 1,031
  • 1
  • 11
  • 29
1
vote
2 answers

Get body POST request in Moleculer

I use Fetch in ReactJs to send a request to api Moleculer like this : var data ={ 'ordername' : 'PUG', 'receivername' : 'AnSama' } fetch(url,{ method: 'POST', header: { …
M.Quynh
  • 13
  • 1
  • 5