Hacker News new | ask | show | jobs
by exabrial 601 days ago
Well put!

We do a lot of event driven architecture with ActiveMQ. We try to stick messaging-as-signalling rather than messaing-as-data-transfer. These are the terms we came up with, I'm sure Martin Fowler or someone else has described it better!

So we have SystemA that is completing some processing of something. It's going to toss a message onto a queue that SystemB is listening on. We use an XA to make sure the database and broker commit together1. SystemB then receives the event from the queue and can begin it's little tiny bit of business processing.

If one divides their "things" up into logical business units of "things that must all happen, or none happen" you end up with a pretty minimalistic architecture thats easy to understand but also offers retry capabilities if a particular system errors out on a single message.

It also allows you to take SystemB offline and let it's work pile up, then resume it later. Or you can kick of arbitrary events to test parts of the system.

1: although if this didn't happen, say during a database failure at just the right time, the right usage of row locking, transactions, and indexes on the database prevent duplicates. This is so rare in practice but we protect against it anyway.

2 comments

> We try to stick messaging-as-signalling rather than messaing-as-data-transfer.

I was thinking of trigger-messages vs data-messages.

Then again we've just begun dabbling with AMQP as part of transitioning our legacy application to a new platform, so a n00b in the field.

We do have what you might consider hybrid messages, where we store incoming data in an object store and send a trigger-message with the key to process the data. This keeps the queue lean and makes it easy for support to inspect submitted data after it's been processed, to determine if we have a bug or it's garbage in garbage out.

So... you're not using event-driven architecture. That's fine, but I don't know why it supports this article's weird point about event-driven architecture.
> So... you're not using event-driven architecture. That's fine, but I don't know why it supports this article's weird point about event-driven architecture.

I've never used EDA, just read about it, so I'm curious what you disagree with from the article.

It seems that the logic is reasonable, that subscribers have varying needs and publishers would need to account for those needs over time as the functionality (and data) required by subscribers evolves.