Catalyst::Engine::Stomp and ErrorCatcher

Jason Tang jason at dragor.net
Fri Feb 5 12:17:21 GMT 2010


Hi all

Here at work we've got a Catalyst::Engine::Stomp based consumer talking to
ActiveMQ and there's has been some issues of instability. So have been
looking into how we can at least catch some of the obvious ones and
hopefully provide some way of logging what's going on.

Anyway I've been looking at C::E::Stomp and tried to add a try/catch
block to capture that something has gone wrong and email it off to
someone with the error using ErrorCatcher.

Here's what I'm trying in C::E::Stomp in the run method..

        # enter loop...
        while (1) {
                try {
                        my $frame = $self->connection->receive_frame();
                        $self->handle_stomp_frame($app, $frame);
                } catch ($e) {
                        $app->error("we are in trouble: $e");
                }

                last if $ENV{ENGINE_ONESHOT};
        }

..I'm abit puzzled as to why this isn't being passed over to ErrorCatcher.
It is dumping something in the logs..

010/02/05 06:42:42 we are in trouble: Error reading command:  at /opt/xt/xt-perl/lib/site_perl/5.8.8/Catalyst.pm line 497
	Catalyst::error('XT::ActiveMQ::DC', 'FSSB: Error reading command:  at /opt/xt/xt-perl/lib/site_per...') called at /opt/xt/xt-perl/lib/site_perl/5.8.8/Catalyst/Engine/Stomp.pm line 111
	Catalyst::Engine::Stomp::run('Catalyst::Engine::Stomp=HASH(0x1dc34d80)', 'XT::ActiveMQ::DC', 'i dont matter', 'neither do i', 'HASH(0x1d8de350)') called at /opt/xt/xt-perl/lib/site_perl/5.8.8/Catalyst.pm line 2163
	Catalyst::run('XT::ActiveMQ::DC', 'i dont matter', 'neither do i', 'HASH(0x1d8de350)') called at /opt/xt/deploy/xtracker/script/xt_activemq_dc_daemon.pl line 101

I don't really know how the internals of Catalyst works so would appreciate
any helpful suggestions.

TIA
Jason
-- 
Jason Tang  - email: jason at dragor.net - msn: jason-msn at dragor.net


More information about the london.pm mailing list