moleculer-go / moleculer

🚀 Progressive microservices framework for Go - based and compatible with https://github.com/moleculerjs/moleculer
MIT License
144 stars 27 forks source link

fix key in actions map #77

Closed vpashka closed 4 years ago

vpashka commented 4 years ago

Hello.

We tested the work with moleculer-nodejs(0.13.12) services and found a problem in the message format mismatch (INFO).

The nodejs services have format (for actions list)

actions: {
  'v1.config.getConfigs': {
    params: { env: [Object] },
    rawName: 'getConfigs',
    name: 'v1.config.getConfigs',
    cache: false,
    metrics: { params: false, meta: true }
  },
  'v1.config.getSharedAdapters': {
    params: { env: [Object] },
    rawName: 'getSharedAdapters',
    name: 'v1.config.getSharedAdapters',
    cache: false,
    metrics: { params: false, meta: true }
  }
}

The key in the actions list matches the full name of the service

But go services have a different format:

actions: { 
    'get': { 
      name: 'testservice.get', 
      params: {}, 
      rawName: 'get' 
    } 
}

key='get' but name='testservice.get',

This leads to incorrect processing of the actions list in the nodejs and setting the flag available=false for moleculer-go service.

This patch fixes this problem.

vpashka commented 4 years ago

@pentateu What do you think about this?

pentateu commented 4 years ago

Will be fixed as part of: https://github.com/moleculer-go/moleculer/pull/83