Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[S3 realibility] Redeliver event dead letters to the queue #1253

Open
hungphan227 opened this issue Oct 18, 2024 · 5 comments
Open

[S3 realibility] Redeliver event dead letters to the queue #1253

hungphan227 opened this issue Oct 18, 2024 · 5 comments
Assignees

Comments

@hungphan227
Copy link
Contributor

hungphan227 commented Oct 18, 2024

Why

When one of S3 is down for a long time, blob events would be stored in event dead letters table. James already has a task to redeliver dead letters back to the queue.

Unfortunately, EventDeadLettersRedeliverService (single instance) only has one EventDeadLetters instance -> only one EventSerializer instance (currently it is MailboxEventSerializer). Therefore, it does not work with blob event dead letters.

Refactoring code is needed to apply EventDeadLettersRedeliverService for blob event dead letters

How

  • Move EventSerializer from CassandraEventDeadLettersDAO to CassandraEventDeadLetters
  • Update retrieveFailedEvent method in CassandraEventDeadLettersDAO to return String instead of Event
  • Create method getEventSerializer in EventBus interface
  • Remove EventDeadLetters attribute in EventDeadLettersRedeliverService
  • Create new interface EventDeadLettersService which contains two methods:
Mono<Event> failedEvent(Group registeredGroup, InsertionId failDeliveredInsertionId, EventSerializer serializer);
Mono<Void> remove(Group registeredGroup, InsertionId failDeliveredInsertionId, EventSerializer serializer);
  • In EventDeadLettersRedeliverService, get events by using EventDeadLettersService

DoD

Integration tests

@hungphan227 hungphan227 changed the title [S3 realibility] Rederliver event dead letters to the queue [S3 realibility] Redeliver event dead letters to the queue Oct 18, 2024
@hungphan227 hungphan227 self-assigned this Oct 18, 2024
@hungphan227
Copy link
Contributor Author

welcome any thoughts on this

@hungphan227
Copy link
Contributor Author

hungphan227 commented Oct 18, 2024

@chibenwa if you have other thoughts please comment

@quantranhong1999
Copy link
Member

Sounds ok to me

@quantranhong1999
Copy link
Member

Maybe make this a James ticket as it would benefit EventDeadLetters to reprocess JMAP events with JmapEventSerializer too (rather than only MailboxEventSerializer)?

@chibenwa
Copy link
Member

I think this would be the simplest indeed:

  • Create method eventSerializer in EventBus interface
  • Add a multibinder with all EventBusses
  • EventDeadLetter reprocess service would take that set of eventbus. When reprocessing:
    • List all event bus, foreach
    • Try to deserialize the event
    • if deserialize then reprocess the event
    • if not deserialized then try next event bus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants