# moleculer-go
**Repository Path**: anystreaming/moleculer-go
## Basic Information
- **Project Name**: moleculer-go
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2024-01-29
- **Last Updated**: 2025-09-12
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Moleculer Go
🚀 Progressive microservices framework for Go
Inspired and compatible with [Moleculer JS](https://github.com/moleculerjs/moleculer)
Simple, fast, light and fun to develop with. Also easy, very easy to test ;)
[](https://gitter.im/moleculer-go/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[](https://cloud.drone.io/moleculer-go/moleculer)
[](https://goreportcard.com/report/gitee.com/anystreaming/moleculer-go)
[](https://coveralls.io/github/moleculer-go/moleculer?branch=master)
[](https://codecov.io/gh/moleculer-go/moleculer)
# Get Started
- [http://gomicro.services (Official site and Documentation)](http://gomicro.services)
- [Database examples](https://moleculer-go-site.herokuapp.com/docs/0.1/store.html)
## Example
```go
package main
import (
"fmt"
"gitee.com/anystreaming/moleculer-go"
"gitee.com/anystreaming/moleculer-go/broker"
)
type MathService struct {
}
func (s MathService) Name() string {
return "math"
}
func (s *MathService) Add(params moleculer.Payload) int {
return params.Get("a").Int() + params.Get("b").Int()
}
func (s *MathService) Sub(a int, b int) int {
return a - b
}
func main() {
var bkr = broker.New(&moleculer.Config{LogLevel: "error"})
bkr.Publish(&MathService{})
bkr.Start()
result := <-bkr.Call("math.add", map[string]int{
"a": 10,
"b": 130,
})
fmt.Println("result: ", result.Int())
//$ result: 140
bkr.Stop()
}
```
# Roadmap
## v0.1.0 (MVP)
**Contents:**
- Service Broker
- Transit and Transport
- Actions (request-reply)
- Events
- Mixins
- Load balancing for actions and events (random round-robin)
- Service registry & dynamic service discovery
- Versioned services
- Middlewares
- NATS Streaming Transporter
- JSON Serializer
- Examples :)
## v0.2.0 (Beta RC1)
- Action validators
- Support for streams
- More Load balancing implementations (cpu-usage, latency)
- Fault tolerance features (Circuit Breaker, Bulkhead, Retry, Timeout, Fallback)
- Built-in caching solution (memory, Redis)
- More transporters (gRPC, TCP, Redis, Kafka)
- More serializers (Avro, MsgPack, Protocol Buffer, Thrift)
## v0.3.0 (Beta)
- Performance and Optimization
- More DB Adaptors (Firebase, MySQL)
- CLI for Project Seed Generation
## v0.4.0 (Alpha)
- Event Sourcing Mixins
## v0.5.0 (Release)
# Installation
```bash
$ go get gitee.com/anystreaming/moleculer-go
```
# Running examples
```bash
# simple moleculer db example with memory adaptor
$ go run github.com/moleculer-go/store/examples/users
# simple moleculer db example with Mongo adaptor
$ go run github.com/moleculer-go/store/examples/usersMongo
# simple moleculer db example with SQLite adaptor
$ go run github.com/moleculer-go/store/examples/usersSQLite
# complex moleculer db example with population of fields by other services
$ go run github.com/moleculer-go/store/examples/populates
```
# Running tests
```
# integration tests require mongo, nats streaming and rabbitmq
# run mongo
docker run -d -p 27017:27017 mongo
# run nats-streaming
docker run -d -p 4222:4222 nats-streaming -mc 0
# run rabbitmq
docker run -d -p 5672:5672 rabbitmq
# running all tests
go test ./...
# or
ginkgo -r
```