mercredi 1 juillet 2020

Message pattern in Java

I'm writing an app that generates events. I want to queue all these events so that another component can consume and process these events in parallel (to avoid sequential delays, I/O, http delays etc.) and also to add retry mechanism if message processing fails.

Task scheduler --> produce events --> MOM(ActiveMQ) --> Consumer --> message processor

events are like: Jira comment event: Adds a comment to a Jira issue Jira transition event: Change the status of a Jira issue Email event: Sends email Some other event: Does something entirely different (long running task for example).

I'm looking for a generic object (command) to be sent to the messaging system. The consumer gets the message interprets the type and perform appropriate action.

What is the best Java technique to achieve this?

Aucun commentaire:

Enregistrer un commentaire