Skip to content

Native queue support #53

@jhomarolo

Description

@jhomarolo

Is your feature request related to a problem? Please describe.
A message queue is a form of asynchronous communication between services used in serverless and microservices architectures. Messages are stored in the queue until processed and deleted. Each message is processed only once, by a single consumer. Message queues can be used to decouple heavy processing, to store work in buffers or batches, and to evenly process peak workloads.

In the modern cloud architecture, applications are decoupled into independent core components that are easier to develop, deploy and maintain. Message queues provide communication and coordination capabilities for these distributed applications. Message queues can greatly simplify coding decoupled applications and increase performance, reliability, and scalability.

image

Generally, messages are small and can be items such as requests, responses, error messages, or just information. To send a message, a component called a producer adds a message to the queue. The message is stored in the queue until another component called the consumer retrieves the message and does something with it.

Describe the solution you'd like
Considering the need to solve 2 main problems, I suggest we natively implement queue support in herbs.

problem 1
The unreliability of transmitting http requests between endpoints. That is, using the queue as a retry submission functionality (in a similar way to polly https://netflix.github.io/pollyjs/#/) .

problem 2
The big bottleneck that can be generated in massive data writing on the producer or consumer part. With the queuing system, both parties can process the request the way computational power processes requests.

Additional context
I imagine a solution implemented in some layer of buchu where I would mark that a usecase is consumer or producer.

    usecase('Usecase X', **options**, {

        // Input/Request type validation
        request: {  },

        // Output/Response type
        response: {  },

        // Authorization Audit
        authorize: async (user) => {}

        // Dependency Injection control
        setup: (ctx) => {}

       })

Where options could be a group of sets about producer: true, consumer:true, retrys: X

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    More discussion is needed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions