Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.31 KB

README.md

File metadata and controls

40 lines (28 loc) · 1.31 KB

💬 Message Broker 💬

📚 Description 📚

This is a message broker that allows you to send messages to a queue and receive them from the queue. It is a simple implementation of a message broker that uses a queue to store messages. The queue is implemented using a linked list. The message broker is implemented using a server and a client. The server is multithreaded and can handle multiple clients at the same time. The client can send messages to the queue and receive messages from the queue. The client can also send a message to the server to stop the server. The server can also be stopped by pressing Ctrl+C.

Alt text

type MessageBroker interface {
	SendMessage(ctx context.Context, message Message, topic string) error
	ReceiveMessages(ctx context.Context, topic string) (*Message, error)
	Ack(ctx context.Context) error
}

📝 Instructions 📝

📥 Installation 📥

go get github.com/fabiohvieira/broker

Providers Available

AWS - SQS

func main() {
    sqsClient := sqs.NewSQSClient("us-east-1", "http://localhost:4100", "http://localhost:4100", "http://localhost:4100", "http://localhost:4100")
  
    broker := sqs.New(sqsClient)

    broker.SendMessage("test", "test")
}

RabbitMQ

  • Send Message

Kafka