Problem/Motivation

Currently, the Brevo module does not provide an asynchronous way to create contacts in Brevo.

We need a queue-based solution to handle contact creation reliably and asynchronously.

Proposed resolution

  • Introduce a QueueWorker (brevo_create_contact) to handle contact creation asynchronously.
  • Push new contacts to the queue instead of calling the API directly.
  • The QueueWorker will consume the queue items and create the contacts using the Brevo API in the background.

Remaining tasks

User interface changes

API changes

  • CreateContactQueue::processItem() now handles the creation of CreateContact items from the queue.

Data model changes

  • No database schema changes.
  • Queue items contain the contact data array, which is processed by the QueueWorker.

Issue fork brevo-3550418

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

antonio.lepore created an issue. See original summary.

antonio.lepore’s picture

Issue summary: View changes

antonio.lepore’s picture

Status: Active » Needs review

I have implemented the QueueWorker and related functionality.

Please note that this work depends on the presence of the BrevoFactory::createContactApiClient() method, which was introduced in issue 3536068 and is currently available on the dev branch.

  • renrhaf committed 2b1808f2 on 1.0.x
    Issue #3550418 by antonio.lepore, renrhaf: Add queue worker for async...
renrhaf’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

antonio.lepore’s picture

Hi @renrhaf,

I apologize for not addressing all your valuable feedback. I completely missed your detailed review comments and only now realized you've already taken care of those improvements in a subsequent commit.

Thank you so much for the thorough code review and for implementing those fixes yourself. Your feedback was extremely helpful and I really appreciate the time you took to provide such detailed suggestions. I'll make sure to be more attentive to review comments in future contributions.

renrhaf’s picture

Hi @antonio.lepore,

No worries, I've done a cleaning of opened issues so took care of the few changes, thanks for your contribution !
Have a nice day !

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.