Giter Site home page Giter Site logo

krylixza / gorabbitmqbroker Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 50 KB

A library of code which abstracts and encapsulates the details of connection and configuration an AMQP connection a RabbitMQ Broker while still providing the majority of the flexibility gained by referring to the Go AMQP library directly.

License: MIT License

Go 100.00%
amqp-connection encapsulates go golang message-broker message-queue rabbitmq rabbitmq-broker

gorabbitmqbroker's Introduction

Howzit, I'm Simon

Linkedin: Simon GitHub Simon An image of @krylixza's Holopin badges, which is a link to view their full Holopin profile

I am a software developer by trade but am a technologist by passion. I love reading books, hanging out with close friends and family, and spending time outdoors. Working in technology has made me appreciate those days where I am disconnected completely.

  • 🔭  I specialise in migrating legacy products to the cloud while revamping them with cloud-native technologies.
  • 📘  I’ve recently learnt Dapr, Azure Functions and Azure Container Apps
  • 📖  I’m currently learning performance optimisations and (re-learning) Go.
  • 💬  Read my blog posts at Medium.com.

gorabbitmqbroker's People

Contributors

krylixza avatar

Watchers

 avatar  avatar

gorabbitmqbroker's Issues

Cannot use one broker to connect to multiple brokers or virtual hosts

Due to the implementation of the implementation of NewMessagePublisherSubscriber taking in only a single configuration, the broker will only ever be able to connect to a single RabbitMQ broker or Virtual Host as the shared configuration is the details of the RMQ amqp connection properties.

If a user wishes to write a service that behaves like a Shovel, this is not possible with this configuration unless they specifically create a separate publisher and subscriber. This deducts from the UX.

A possibly implementation would be to allow the NewMessagePublisherSubscriber to take in a publisher and subscriber config, or for a switch property to exist in the shared config telling the broker to look in the subscriber config for it's RabbitMQ broker config, and look in the publisher config for it's RabbitMQ broker config.

Queue TTL declaration

As per the SubscriberConfig, there is no configurable option to declare a message expiry time-to-live on a queue level.

More documentation on queue config with regards to message expiry time-to-live can be found here

Dead Letter Exchange Declaration

As per this document, it is possible to define a Dead Letter Exchange to handle expired messages or any messages that are nacked or rejected with requeue = false.

The current implementation of the config does not allow for Dead Letter Exchange declaration. The implementation of the QueueBind() would need to cater for this new configuration.

Stability issues when using the same channel

When there is a large volume of messages to be consumed, using the same channel to subscribe and publish, the behaviour of the system can become unstable.

A suggestion, as per research on RabbitMQ channels in Go suggests that separate channels should be used to subscribe and publish.

A simple suggestion would be to take the newMessageSubscriber function and remove the channel pointer from the signature, and instead provide a pointer to the connection. Then use a read/write locking mutex to ensure no dirty reads occur, and create the channel there.
Similarly, change the newMessagePublisher to behave the same way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.