Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 06 20:07
    AndreMaz assigned #713
  • Apr 06 19:46
    jalerg commented #713
  • Apr 06 19:45
    coveralls commented #713
  • Apr 06 19:44
    coveralls commented #713
  • Apr 06 19:43
    jalerg synchronize #713
  • Apr 06 19:39
    AndreMaz commented #713
  • Apr 06 19:38
    jalerg synchronize #713
  • Apr 06 19:30
    jalerg opened #713
  • Apr 06 17:09
    Nathan-Schwartz commented #707
  • Apr 06 17:06
    Nathan-Schwartz commented #707
  • Apr 05 13:21
    coveralls commented #712
  • Apr 05 13:20
    coveralls commented #712
  • Apr 05 13:16
    artur-krueger commented #711
  • Apr 05 13:14
    artur-krueger opened #712
  • Apr 05 13:05
    elixiao commented #710
  • Apr 05 08:29
    icebob commented #710
  • Apr 05 05:12
    elixiao commented #710
  • Apr 05 05:07
    elixiao commented #710
  • Apr 04 16:08
    shawnmcknight commented #709
  • Apr 04 08:14
    icebob commented #710
Alvaro Cantador
@alvarocantador
Thank you guys!
Duong Tuan Luc
@lucduong
Is there anybody using moleculer with NATS cluster?
@icebob Could you give me some advises?
Neer
@neer14
Hi @icebob , is there any setting to display html content?
i tried this but not working
res.setHeader("Content-Type", "text/html; charset=utf-8");
return this.sendResponse(ctx, '', req, res, htmlContent);
Sandeep Gupta
@iamsandeepgupta
@neer14 i am also trying on this... not able to resolve this
@icebob can u tell us something
Neer
@neer14
@iamsandeepgupta
this worked for me
  return res.end(htmlContent);
Bartha Bela Tibor
@belabartha
Is there a way to start services in given order? or delay a service start until a dependency has started?
Neer
@neer14
@belabartha
yes you can add service in dependencies array
check this : https://moleculer.services/docs/0.13/services.html#Dependencies
Bartha Bela Tibor
@belabartha
@neer14 yeah, but that's not only for create?
what I want to do is to have a service start after a given event
Neer
@neer14
@belabartha
okay. sorry i don't know about that
Bartha Bela Tibor
@belabartha
thanks anyways @neer14
Anh Nguyen
@anhreg
Anybody knows how to implement server-sent-events ?
Icebob
@icebob

:tada: Moleculer v0.14 RC1 has just been released!
This version will be released as stable at the next weekend if we don't receive any issues about this version during next week.
So if you are using 0.14 beta in your project, please upgrade to this new RC1 version & try it.
Changelog:: https://github.com/moleculerjs/moleculer/releases/tag/v0.14.0-rc1

If you want to check it within a new project, use the updated template with: moleculer init project#next my-project
It contains a new & shiny rewritten welcome page. Start the generated project with npm run dev & open the http://localhost:3000 in your browser.

Safwan Hijazi
@shijazi88
@icebob Many thanks for this nice framework.
Icebob
@icebob
:+1:
Feugang Kemegni Fabrice
@fabrigeas

Hi all,

I would like to know what configurations are required to make may services run each on separate nodes.
My app is a RESTful webservice with gateway.service.js as well as 6 other services which each serve an API endpoint.
How can I canfigure moleculer such that each of my services runs on a different node.

M other question is how to condigure my Dockerfile such that each of my services run on a separate container.
Is this possible?,
is this a good idea?

Emmanuel SELLIER
@esellier
Hi all,
In Web gateway, can I have multiple aliases (on a same route, same path, same params) for different mime-types?
I tried type "type" property (using "text/plain") for instance... but the gateway will route requests to the last alias' action. That's quite obvious since the aliases object is an object and not an array... so I nearly have the answer to my question. But maybe there is a trick...?
thanks
Wajih
@sudogroot
Hi all,
i am trying to add $$strict =true in params validation in action it is not working ,
``
am i messing somthing ?
actions : { getOne: { params: { $$strict: true, id: { type: "string", optional: true }, name: { type: "string", optional: true }, }, handler: this.getOne } }
Emmanuel SELLIER
@esellier
Not sure you need $$strict
that works for me:
const payload = {
"body" : bodyStruct,
"query": { type:"any", optional:true },
"params": { type: "object", strict:true, props: {token:{type:"string",optional:false}}}
}
BTW, does someone know if there is a Slack community with devs using moleculer?
André Mazayev
@AndreMaz
@esellier we're moving away from Slack and slowly moving to Discord. Here is the link https://discord.gg/TSEcDRP
We're much more active over there
Emmanuel SELLIER
@esellier
@AndreMaz Thanks, I'm in
ilakshmikanthp
@ilakshmikanthp
@icebob Hi, I have two different nodes 'node1', 'node2'. both the nodes are running in two different instances with port 3000, 3001.
Each individual working as expected. Now i want to have a common end point like a api-gateway with port 3002 which can call both apis in port 3000 and 3001.
Do i need to create aliases and methods with ct.call('<Service name>') or is there a way i can redirect based on the path and expose both instances end points to single end point
Puria Kordrostami
@kordeviant
does anybody know , where i can find changelog or new features of 0.14 rc?
Hesusmordino
@Hesusmordino
hello, im using AMQP transport in my project, how i can find exchange name and queue name?
i want to recieve messages from internal server, outside of moleculer framework
Neer
@neer14

Hi, i need to populate field
i used like this

settings: {
    populates:{ 
      "categories": "categories.get"
    }
}

this.adapter.find({
        query : {
          status: 2,
          _id: project_id
        },
        populate : ['categories']
      });

but it doesne't work

i need data like this
[
        {
            "status": 2,
            "name": "Test Name"
            "categories": [
                {
                    "_id": 1,
                    "name": "Collectibles"
                },
                {
                    "_id": 34,
                    "name": "watch"
                }
            ]
        }
]
instead it returns like this
[
        {
            "status": 2,
            "name": "Test Name"
            "categories": [1,34]
        }
]
Feugang Kemegni Fabrice
@fabrigeas
@neer14 use 'fields' not 'populate'

Hi guys,

I am trying to authenticate some routes and not others.
anyone has an idea?

/api/users
/api/posts

Neer
@neer14
@fabrigeas
documentation says fields are for filter
@fabrigeas
auth:false ?
*authorization: false
Feugang Kemegni Fabrice
@fabrigeas
You can use youse dependencies to make a service depend on another.
you can also register an event and wait for service A to be created, then run a given funtion in your service B
Feugang Kemegni Fabrice
@fabrigeas
Hi guys,
how can I set the cookies in the request header from the service.action?
I am implementing a signin action from my users service and I would like to return an access-token in the header from the action.
Anyone has an idea?
Ingwie Phoenix
@IngwiePhoenix
Hello there! I am coming here off the back of a StackOverflow question I asked in regards to microservice architecture. Basically, while I was planning my application, I had initially planned it to spawn multiple processes, each holding a service. Each service would need to communicate with one another either by calling methods directly or sending events to a queue so that other services pick them up and process accordingly. Now, all the Moleculer examples I have come across so far have either shown various services in Docker-Compose being networked through NATS or a single broker hosting multiple services. Now, how would I go about having Moleculer spawn, for instance three, processes? Since each service represents one service, let's just call them chat, notifications and users. Any idea? Thanks!
Wesley-Alves
@Wesley-Alves
Hello, how to disable the default route in moleculer-web? (https://github.com/moleculerjs/moleculer-web/blob/master/src/index.js#L64)
Bartha Bela Tibor
@belabartha
@icebob I want to use the Datadog tracer, but I'm just getting individual service calls, but I'm interested in the whole flow (from input event to output). Is there a straightforward setup for this? Or should I create child/sub-child spans for every action called through the flow?
I see, that you have something similar in Moleculer documentation (https://moleculer.services/docs/0.14/tracing.html#Datadog)
Jarod Reid
@fugufish
@icebob working on error handling in the moleculer-ruby library, what is the appropriate error to pass back to the caller when the endpoint throws a non-moleculer exception?
Puria Kordrostami
@kordeviant
Hello, how to handle multipart formdata without any file?
MOULALI M
@Moulali1995
Hey @icebob
How can i use the socket instance inside other services? I can see that this.io is available in started() life cycle method.
How to obtain that instance in other services? I'm using the below example
https://github.com/moleculerjs/moleculer-web/blob/master/examples/socket.io/index.js
Shubham Jain
@shubh-07
Hi. Can someone guide me through moleculer communication protocol.
I am facing Protocol Version Mismatch error.
I am not able to find the cause for this error.
The packet version is coming to be 4
and service broker version is coming 3.
André Mazayev
@AndreMaz
The protocol mismatch means that some of your nodes use moleculer v0.13 and others v0.14. v0.13 uses protocol version v3 while v0.14 uses protocol version v4.
They are incompatible (https://github.com/moleculerjs/moleculer/blob/master/CHANGELOG.md#communication-protocol-has-been-changed)
IMPORTANT: We are moving to Discord (link: https://discord.gg/TSEcDRP)! Support @Gitter is no longer guaranteed
Shubham Jain
@shubh-07
Thanks.