Orbital is a tool to quickly help the developer build and test services. When developing for microservices, there are a number of reasons why mocking is important. Perhaps a service has yet to be completed. Perhaps there is no development instance of a service or the development responses are not sufficient for testing. Whatever the reason, Orbital along with the adapters can replace an absentee service, letting a developer quickly mock out a service with expected responses to a variety of requests. The Orbital Agent can also be used to front data persistence or other services. Thanks to its adapter layer, the Agent can simulate work done by other services using its translations without requiring the construction of a whole new service.
Each node used in Orbital is small and lightweight, so it's not a problem to deploy them alongside your services. We use RabbitMQ for communication and Consul to manage service discovery and failure detection. With these tools we’ve put together something that can be deployed on Windows or on Linux.
Understanding the Architecture
So you want to know how Orbital works? Let’s start by taking a look at the high-level components:
- Producer The producer is the message sender. A producer might have endpoints for receiving messages too, but in our architecture the producer is an application that wants to send messages out. That means using the Orbital Connector.
- Orbital Connector There isn’t one Orbital Connector. The Orbital Connector is the term we use to refer to the integration library that allows producers to send messages to Agents. It communicates to Consul to find designated services and operations, and uses RabbitMQ to send the message along. Over time more Orbital Connectors will appear for more languages. Don’t see an Orbital Connector for your programming language of choice? Check out how to get involved. Check out the Orbital Connectors in their own project here: http://connectors.orbital.com/.
- Agent The "heavy lifting" of Orbital is done here, if it can be called heavy. The Agent listens for messages, executes transformations, and sends the data on to the consumer.
Service Definition The service definition delineates the schemas, operations, adapters to use per operation, translation and the Agent manipulates them to create the appropriate requests to send to the consumer and responses received from the consumer.
Adapter Similar to the case with the Orbital Connector, Orbital can implement multiple adapters. The adapters allow the Agent to communicate to consumers over different protocols.
Want to allow for communication over different protocols or to different databases or file systems? Take a look at our section on how to get involved. Check out the Adapters in their own project here: http://adapters.orbital.com/
- Consumer The end of the line for your message, the consumer can be any web service. Consumers don’t have to be coded any differently than normal. The work done by the Agent takes care of that.
Here's a simple description of the way a message flows through Orbital:
- The producer composes a message and uses the Orbital Connector to validate the message and send it to the RabbitMQ queue with the name of the operation where the Agent is listening to.
- The Agent picks the message off the queue and performs any necessary translations and passes the message along with the adapter configuration information to the adapter.
- The adapter calls out from the Agent to the consumer.
- If the message is synchronous, the response is passed long the reverse path all the way to the producer.
To get a better idea of all the components' roles and how they fit together, check out our handshake diagram.
To get working with Orbital, you need to set up the supporting components such as RabbitMQ and Consul.
Orbital has been tested with Consul version 1.0.0. This version can be found at their website here: https://releases.hashicorp.com/consul/1.0.0/.
For information regarding installation and configuration, please refer to our Consul Setup Guide.
You can install RabbitMQ on its own. You can find it here: https://www.rabbitmq.com/download.html. One of the ways to install RabbitMQ is to use Chocolatey on Windows since it manages the process for us and is a great tool for all sorts of packages.
- Install Chocolatey (https://chocolatey.org/install).
- Run Powershell as administrator.
- Run the following command:
choco install rabbitmq
As an alternative, if you are working with docker, we recommend using a docker-compose file to get Consul and RabbitMQ up:
version: '3' services: rabbitmq: image: "rabbitmq:3-management" hostname: "rabbitmq" environment: RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG" RABBITMQ_DEFAULT_USER: "guest" RABBITMQ_DEFAULT_PASS: "guest" RABBITMQ_DEFAULT_VHOST: "/" ports: - "15672:15672" - "5672:5672" labels: NAME: "rabbitmq" consul: image: consul:latest hostname: "consul" ports: - "8400:8400" - "8500:8500" - "8600:8600" labels: NAME: "consul"
After completing the Prerequisites, you can go to How-to Guide and get Orbital running.
Orbital is licensed under the 3-Clause BSD license for open-source software. Please see the LICENSE file for more information.
For inquiries about the project, please e-mail us at email@example.com.