The Integration Framework ia an initiative to implement a modular framework of integration patterns, as proposed by Gregor Hohpe and Bobby Woolf in the Enterprise Integration Patterns book.
The concern of this project is to maintain a collaborative development of a complete framework that abstracts and simplifies the concrete concepts of key application integration technologies through the definitions and the vocabulary of the Enterprise Integration Patterns book.
In an microservice architeture, we need to integrate service communication with one or more integration buses. These buses can be deployed in a variety of different technologies, as well as services. We are working on the challenge of developing a framework that does not limit the use of the target technologies. We uses only the available features in the target technology, avoiding hacks that can result in a coupled component. That way, we can work on a side-by-side architeture with no side effects. For example, in RabbitMQ modules, we don't limit the messaging topology.
The quickest way to get the latest release of the Integration Framework is to add it to your project using NuGet:
Module | Package name | Latest version |
---|---|---|
RabbitMQ Publish/Subscribe | Speller.IntegrationFramework.RabbitMQ | |
RabbitMQ Request/Reply | Speller.IntegrationFramework.RabbitMQ.RequestReply |
In the sender application, resolve the channel and publish message to hello-queue
:
public static async Task SayHelloWorld()
{
services.GetService<IRabbitMQChannel>();
var message = "Hello World!";
await channel.Publish("hello-queue", message);
}
In the receiver application, declare a message handler to subscribe the message queue hello-queue
:
[Subscribe("hello-queue")]
[AcknowledgeMode(AcknowledgeMode.Automatic)]
public class Receiver : IMessageHandler<RabbitMQDelivery>
{
public Task Handle(RabbitMQDelivery message)
{
var content = message.AsString();
Console.WriteLine($"Received: {content}");
return Task.CompletedTask;
}
}
To see a complete Sender/Receiver sample, go to the "Hello World" RabbitMQ sample code.
Follows the samples list to the RabbitMQ and RabbitMQ.RequestReply packages usage.
Sample | Description | Patterns |
---|---|---|
Hello World | Sending and receiving text messages through a queue. | Point-to-Point Channel, Document Message |
Work queues | Distributing tasks to workers. | Competing Consumers, Command Message |
Publish/Subscribe | Sending messages to many consumers at once. | Publish-Subscribe Channel, Event Message |
Routing | Receiving messages selectively. | Selective Consumer, Message Router, Event Message |
Topics | Receiving messages based on a pattern (topics). | Selective Consumer, Message Router, Event Message |
Request/Reply | RPC/RPI communication. | Remote Procedure Invocation, Request-Reply, Command Message, Document Message, Correlation Identifier, Return Address |
If you found any bug, please report them using the GitHub issue tracker.
This software is licensed under the Apache License, Version 2.0 (see LICENSE).
Copyright (c) Rodrigo Speller. All rights reserved.