Muon Core

Muon is a toolkit for building highly portable, polyglot, reactive microservices. Muon Core is the central foundation library for Muon on the JVM.

License

License

GroupId

GroupId

io.muoncore
ArtifactId

ArtifactId

muon-core
Last Version

Last Version

7.4.1
Release Date

Release Date

Type

Type

jar
Description

Description

Muon Core
Muon is a toolkit for building highly portable, polyglot, reactive microservices. Muon Core is the central foundation library for Muon on the JVM.
Project URL

Project URL

http://muoncore.io
Source Code Management

Source Code Management

https://github.com/muoncore/muon-java

Download muon-core

How to add to project

<!-- https://jarcasting.com/artifacts/io.muoncore/muon-core/ -->
<dependency>
    <groupId>io.muoncore</groupId>
    <artifactId>muon-core</artifactId>
    <version>7.4.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.muoncore/muon-core/
implementation 'io.muoncore:muon-core:7.4.1'
// https://jarcasting.com/artifacts/io.muoncore/muon-core/
implementation ("io.muoncore:muon-core:7.4.1")
'io.muoncore:muon-core:jar:7.4.1'
<dependency org="io.muoncore" name="muon-core" rev="7.4.1">
  <artifact name="muon-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.muoncore', module='muon-core', version='7.4.1')
)
libraryDependencies += "io.muoncore" % "muon-core" % "7.4.1"
[io.muoncore/muon-core "7.4.1"]

Dependencies

compile (4)

Group / Artifact Type Version
org.reactivestreams : reactive-streams jar 1.0.0
com.google.code.gson : gson jar 2.3.1
org.apache.avro : avro jar 1.8.1
org.slf4j : slf4j-api jar 1.7.21

Project Modules

There are no modules declared in this project.

Master Build

Stable

Snapshots

Muon Core - Java

This repo contains the JVM implementation of Muon Core.

What is Muon?

Microservices today are optimised for building systems that can continue to change as you need them to. The achieve this, you decompose an application into its component parts, then recompose it back together again using some form of integration technology. The most common form of integration today is RPC based, whether HTTP, gRPC or one of its friends.

RPC is a fairly simplistic model for integration, with well known flaws and foibles. The other options, messaging and event collaboration are much harder to get started with, and so are often avoided until the "v2 rewrite". Muon lets you adopt messaging and events from the start of a project, by making it easy to do the right thing with them.

Muon is fully polyglot, give you very well defined, easy to use apis that take advantage of messaging, and eventing, to recompose your distributed system in highly performant, rich communication styles, beyond RPC.

What is Muon Core?

Muon is a modular system, allowing it to be easily extended to take advantage of the best of breed technologies and leverage what you may call "legacy", giving it a new lease of life and protecting your investment.

Muon Core is the library that defines the central programming model of the system. It creates channel based communicaiton between microservices, enabling message based communication to happen. Each runtime we support has its own implementation of Muon Core. This repository is for the JVM.

It can be extended by adding one of more of:-

  • Protocol Stacks - The most important extension. This defines a messaging interaction between systems, and gives it an easy to use, language idiomatic API for you to use.

  • Transports - Take advantage of different integration technologies, service meshes, brokers. These are all enabled by a network transport.

  • Discovery - Enable a Muon system to integrate with your existing infrastructure and locate other systems across your deployment.

  • Codec - Convert objects for transport and enable defining of Schemas for client side validation. Not often extended, but available. We currently support JSON and Avro.

Using Muon Java

To use Muon, you need to use Muon Core, a transport, a discovery and one or more protocol stacks.

A minimal gradle import looks like this.

repositories {
    jcenter()
    maven { url 'https://simplicityitself.artifactoryonline.com/simplicityitself/muon' }
    maven { url 'https://simplicityitself.artifactoryonline.com/simplicityitself/muon-snapshot' }
}

dependencies {
    compile "io.muoncore:muon-core:7.3.0-SNAPSHOT"
    compile "io.muoncore:muon-transport-amqp:0.0.1-SNAPSHOT"
    compile "io.muoncore:muon-discovery-amqp:0.0.1-SNAPSHOT"
    compile "io.muoncore.protocol:stack-rpc:0.0.1-SNAPSHOT"
}

You can then create a new instance of Muon with the Discovery and Transport activated. This will appear on the network

Setting this up is somewhat specific to the transport and discovery in question. Assuming AMQP (as above), the creation looks similar to.

AutoConfiguration config = MuonConfigBuilder.withServiceIdentifier("my-service").withTags("awesome")
                .addWriter(c -> {
                    c.getProperties().setProperty(
                            "muon.transport.factories",
                            "io.muoncore.transport.amqp.AmqpMuonTransportFactory");

                    c.getProperties().put("amqp.transport.url", "amqp://muon:microservices@localhost");

                    c.getProperties().setProperty(
                            "muon.discovery.factories",
                            "io.muoncore.discovery.amqp.AmqpDiscoveryFactory");

                    c.getProperties().put("amqp.discovery.url", "amqp://muon:microservices@localhost");
                }).build();

Muon muon = MuonBuilder
        .withConfig(config).build();

See more stacks you can include

Find out more about about the AMQP support

Contributing to Muon Core

Contributions to Muon are very welcome.

You can contribute by filing bugs on any of the repositories, pull requests for existing issues are also welcome (please note the licensing/ copyright assignment requirements)

Apart from the existing repositories, the most useful areas to extend Muon are :-

  • Add a new stack. Got an idea or requirement for how systems should communicate? In Muon, this is expressed as a stack, with an idiomatic API. Write your own and contribute it to the community!

  • Add a transport. Is your broker not supported? Do you want to go brokerless, use direct TCP? Are you rolling out a service mesh? This is a transport.

  • Add a discovery. Etcd, Eureka, DNS. These are discovery systems, and Muon can be updated to work with any of them, and in fact, all of them at once. Write a Discovery to take advantage of them.

See [documentation](http://muoncore.io)

License

All code is Copyright (c) Muon Core Ltd 2017.

Muon is Free Software, licensed under the terms of the LGPLv3 license as included in LICENSE

Muon has a commercial-friendly license allowing private forks and closed modifications of all projects, alongside enterprise support and extended support for enterprise technologies and patterns.

This will enable you to use Muon in any situation where your legal team will not accept a Free Software license.

Please see http://muoncore.io/pro/ for more detail. You can find the commercial license terms in COMM-LICENSE.

io.muoncore

Muon

Microservices made easy. Adopt best of breed tech, build message and event oriented Microservices, protect your legacy. Get Involved? -> http://bit.ly/2sAySOI

Versions

Version
7.4.1