[Catalyst] Catalyst::Model::RabbitMQ

jmo mlists jmo.mlists at gmail.com
Sat Aug 18 20:36:30 GMT 2012


On Sat, Aug 18, 2012 at 9:36 PM, Gianni Ceccarelli
<dakkar at thenautilus.net>wrote:

> I'm using a combination of CatalystX::ComponentsFromConfig and
> Net::Stomp::Producer. The first (t0m's code, even if released by me) allo=
ws
> you to avoid writing essentially empty model classes (and to apply roles
> via configuration file). The second is the one that actually deals with
> messaging. As the name implies it's using STOMP, but there's actually
> rather little in the interface that depends on it. It works like this:
>
> - a "send" method takes a destination (queue name, whatever), a hashref of
> headers (including a 'type', that I imagine being similar to RabbitMQ's
> routing key), and a byte string for the message payload
> - if the message payload is a reference, it is passed through a serialiser
> - a "transform_and_send" method allows you to pass some internal
> representation, and having the logic to transform it into a message in a
> specialised class
>
> We've been using something very similar at $work for a coulpe of years
> now, and it seems to be simple and flexible enough.
>

Hmm, sounds like something  which is definitely worth looking into, thanks!

Slightly off topic here:

Is there a sane way to send a message each time I do a DB insert/delete?
>From what I can see do I have to either:
- Wriggle $c in to my Schema module and override the insert/delete methods
- Create some wrapper method inside a Controller and call that, which in
turn calls db insert/delete and then sends the message
- Have the call next to my DB call in each function doing insert/delete

All three feels bad in different ways, is there a fourth (and/or fifth)
alternative I haven't thought of which makes this nicer?

/Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120818/40db8=
2b2/attachment.htm


More information about the Catalyst mailing list