Questions tagged [moleculer]
Moleculer is a progressive microservices framework for Node.js
81
questions
0
votes
0
answers
50
views
Refactor and upgrade old typescript code - moleculer service - property does not exist on type
We have a 5 years old nodejs source code which must be upgraded to the latest nodejs technology, packages, typescript compiler. We found a piece of code which uses the moleculer nodejs package, and a ...
0
votes
0
answers
18
views
How can I build a composite structure(minerals) in the materials studio?
I wanna make a composite structure including two oxide minerals, in common surface in materials studio software.
I can't build a comosite structure of two or multi minerals with a common surface. The ...
1
vote
0
answers
22
views
Moleculer Framework- Download a file from MongoDB where the data is in binary format
I need to develop an API which when gets a GET response with an ID it should download a file where it is stored in MongoDB as a Binary buffer.
If I try to print the binary buffer to console.log it ...
0
votes
1
answer
94
views
Moleculer Framework API code is not able to use the file from request body (form-data). returns undefined
I am new to the Moleculer framework and need to upload a file from an API request body to MongoDB using an action handler. I have been able to upload files using Multer with Express, but I need to use ...
0
votes
2
answers
30
views
Selectively filter debug logs for Moleculer
I have healthcheck actions within my services that are called to determine whether the service is up. Due to the frequent calls from automated systems, there are a lot of noise in the debug logs. Is ...
0
votes
0
answers
41
views
When I test socketio in moleculer get `404 Not Found` error
I created a socketio demo as below:
services/socketiodemo.service.js
"use strict";
const ApiGateway = require("moleculer-web");
// require Socket.IO and Moleculer's Socket.IO ...
0
votes
1
answer
67
views
`this.adapter` is `undefined`. when execute the action in moleculer action
I have created a moleculer project as below:
https://codesandbox.io/s/8d5xy3
now I changed default database to mongodb/mongoose:
but when I run products.service.js's action: createProduct, I get 500 ...
2
votes
1
answer
151
views
I cannot run up the docker compose of moleculer demo with error `Service name can't be empty!`
I follow this moleculer tutorial:
When I execute the 7th step:
7. We create docker-compose.yml and define our services in it:
and run it up.
I get issue, I cannot start up the other three containers:...
1
vote
1
answer
40
views
How to resolve populate with different field instead of _id in MoleculerJS
I am creating a service to query Tasks collection from the MongoDB. It have a custom id field called uId, and a task store other uId of other taks in its field named subtask. I want to populate the ...
0
votes
1
answer
33
views
MolecularJS :: Correlation details :: how to pass logged in user to action method
I am new to molecular Js, can someone please help me in understanding ,how to pass the context of current request in action handlers?
to be more specific, In authenticate method of API gateway I am ...
0
votes
1
answer
304
views
Moleculer JS "Redis-pub client is disconnected" every 10 minutes
my application (Node.js) is using moleculer for microservices and redis as transporter. However, I find that the application will have this log Redis-pub client is disconnected every 10 minutes, then ...
0
votes
0
answers
43
views
Is it possible to use the node library @ibm-cloud/cloudant as a mixin in Moleculer framework?
I'm using moleculer microservices framework and IBM Cloudant database. Is it possible to use the node library @ibm-cloud/cloudant as a mixin so that I can inherit all the methods in the services? ...
0
votes
1
answer
528
views
How to invoke an action of its own service as soon as the service is up in moleculer js?
I am working in moleculer js, in which there is a requirement to call action/handler function of its own service to prepopulate the values from the DB and ecternal API call. If I do using started() ...
0
votes
1
answer
569
views
Nestjs as API gateway + Moleculer as microservice
I'm very new in microservices, I was a wonder to know that is there any way to call a moleculer action from nestjs gateway?
0
votes
3
answers
330
views
How to deploy molecular project without docker in production?
How should I deploy a molecular microservice project on the server without using docker and Kubernetes?
I pull my updated code into a server and run the npm run dev command project run as per aspected....
1
vote
1
answer
256
views
How are Moleculer transporters are different from http request calls?
I am implementing microservices architecture, there I learned a new topic "Transporter" which is used for the communication between different services.
But the same thing we can also build ...
1
vote
0
answers
96
views
Data are wiped at least once a day (docker instance)
My data is deleted every day. The mongo server run under docker, and i never encounter this issue on my local computer.
On the docker side:
The mongo setup is set to persistant data
volumes: - ...
1
vote
1
answer
271
views
Using moleculer for microservices in monolith
I am in the process of implementing the backend for a business idea in moleculer microservice framework. It works quite well for now using the NATS transporter.
In the near future the number of ...
0
votes
1
answer
168
views
Molecular Gateway white list ~node service
I need to white list all request from ~node service which are help to draw Molecular service UI How can i do this
whitelist: ['**'],
0
votes
1
answer
640
views
Getting SyntaxError: Unexpected token ... on Windows WSL2.0
$ npm run dev
> [email protected] dev /mnt/c/Users/pete/WebstormProjects/moleculer-examples/conduit
> moleculer-runner --repl services
/mnt/c/Users/pete/WebstormProjects/...
2
votes
0
answers
411
views
How to mock MongoDB client event listeners?
I am confused when trying to mock event listeners using jest. Any suggestions are welcome.
MongoDB Node.js Driver version 4.1.2
index.js
const { MongoClient } = require('mongodb');
const service = {
...
0
votes
1
answer
278
views
connect moleculer sevice to nestjs gateway through NATS server
I am trying to create my first microservice server-side application. I created a gateway via Nestjs (a simple CRUD APIs) and then created a new service with this command:
moleculer init nano my-...
0
votes
2
answers
240
views
Using file log with moleculer + docker does not write any file in the file system
I got this docker-compose file:
version: "3.3"
services:
api:
restart: always
build:
context: .
image: foo-platform:1.0.0.0
env_file: docker-compose-test.env
...
1
vote
1
answer
51
views
how to change the result of a map by another format React
I would like to explain my problem of the day.
I am currently making a request on postman (which works correctly)
My back
getPackIntegrations: {
rest: "GET /:id/integrations",
resource:...
1
vote
1
answer
147
views
How to use MongoDB aggregate in Moleculer
I am new to moleculer framework. I want to use MongoDB's aggregate with moleculer framework it is possible ?
Can anybody tell me how to write MongoDb's aggregate query in moleculer framework.
Thanks ...
0
votes
1
answer
369
views
Moleculer sequlize get tables data by joins
I am using moleculer micro services and postgres database with modules moleculer-db-adapter-sequelize and Sequelize. Every service have one table model. For e.g. user.service.js has user table model, ...
0
votes
1
answer
136
views
Stop executing sequelize default Delete on moleculer service restart
I am using moleculer micro services and postgres database with modules 'moleculer-db-adapter-sequelize' and 'Sequelize'. Every time i save any code moleculer service gets restarted at that time ...
1
vote
1
answer
794
views
MoleculerJs with Jaeger tracing: how to trace follow up action calls (new spans) in one trace
I would like to display all my traces like in the examples from the moleculer-jaeger package:
But what i get is something like this:
All spans you can see in this picture should be within the main ...
0
votes
1
answer
299
views
How to set MongoDB with moleculer framework
I am new in moleculer framework.
I want to store the data in mongoDB which received from moleculer framework.
In sort i want to MongoDB instead of moleculer-db it is possible ?
Please help me.
Thanks.
1
vote
1
answer
3k
views
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 ...
0
votes
1
answer
330
views
Node JS Microservice with Moleculer
I am using Node JS and trying to understand the Microservice structure.
As a result of my research, I found a framework named "Moleculer". I started using this and it works fine on my ...
2
votes
0
answers
114
views
Moleculer custom metrics not exported when running inside container
I'm using moleculer with prometheus reporter and I have a strange situation.
I created a simple service that export a custom metric like so:
created() {
this.broker.metrics.register({
type:...
1
vote
1
answer
403
views
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
{
...
0
votes
2
answers
290
views
Moleculer metrics port not exposed in docker container
I'm using molecule for microservices.
Actually I don't know how to expose the metrics port (3030) in the docker container to be able to read metrics from http://host:3030/metrics
when the app is ...
1
vote
2
answers
216
views
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 ...
0
votes
1
answer
398
views
Setting up infraestructure using moleculer and kubernetes (doubts)
I am testing moleculer microservices framework to setting up an infraestructure. I will to use typescript (https://github.com/moleculerjs/moleculer-template-project-typescript). My idea is according ...
1
vote
0
answers
62
views
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 ...
0
votes
2
answers
516
views
Getting `undefined` value even after attaching socket to `ctx` in `beforeCall()` hook in moleculer.io
I am using moleculerjs to handle microservices on the backend, and with one of the front-end applications I am handling the communication over sockets. To do that I am using moleculer.io. The problem ...
1
vote
0
answers
187
views
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 ...
1
vote
2
answers
279
views
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
3
votes
1
answer
3k
views
NATS with moleculer. How can I change NATS max_payload value?
My problem is that I need to increase max_payload value that NATS receive but I have no idea where I can do it.
The project is using Moleculer and NATS is created as a container with docker.
When I ...
0
votes
1
answer
332
views
How to run Vault from my app instead of CLI?
I'm trying to start a Vault service in my NodeJS app.
Using CLI to use Vault is ok,
but i need it to work automatically when the app is started.
I try this
async started(ctx) {
var ...
0
votes
1
answer
482
views
How can I connect molecular gateway with express-nodejs app?
I am learning the microservice architecture and trying to use molecular. It seems like it can control many aspects of my 'express-nodejs' apps. Before, I migrate each nodejs apps to molecular, is it ...
-2
votes
3
answers
2k
views
Nodejs with molecular micro services application, how to keep running server
I am using NodeJS with Molecular, using "npm run dev" to run the application. When the console closes the application is getting down, how to run the application as background service, while ...
0
votes
1
answer
185
views
List moleculer http entry points
I'm using moleculer-web, how can I get a list of API URLs available.
http://0.0.0.0:4000/~node/actions shows 404.
0
votes
2
answers
924
views
run moleculer microservice via nats message
I'm beginner at moleculer and microservices . I created an api gateway via nestjs framework and now I want to call microservice in moleculer via nats messaging from nestjs. so my question is : How can ...
1
vote
0
answers
408
views
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 ...
1
vote
2
answers
894
views
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 ...
0
votes
2
answers
1k
views
Examples of integrating moleculer-io with moleculer-web using moleculer-runner instead of ServiceBroker?
I am having fun with using moleculer-runner instead of creating a ServiceBroker instance in a moleculer-web project I am working on. The Runner simplifies setting up services for moleculer-web, and ...
0
votes
1
answer
353
views
Moleculer pub/sub good practice
I protype with moleculer and just wondering on an architecural issue. My app is build with many pieces: moleculer services, redis, nats, C language app,... and it's deployed on ks8 cluster. I have to ...