X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FController%2FMessageDriven.pm;h=c101df81046421861d5b21b3ee7897a32bd077ba;hb=939aaa4607adfef8ac543476891d0117c46cdfa9;hp=a259b2f9f0be14a62aee85946cd1b26ceb36a7c4;hpb=6aff22e8535d05f850052a9f856e652088df9fb6;p=catagits%2FCatalyst-Engine-STOMP.git diff --git a/lib/Catalyst/Controller/MessageDriven.pm b/lib/Catalyst/Controller/MessageDriven.pm index a259b2f..c101df8 100644 --- a/lib/Catalyst/Controller/MessageDriven.pm +++ b/lib/Catalyst/Controller/MessageDriven.pm @@ -59,11 +59,17 @@ has serializer => ( default => 'YAML', coerce => 1, ); +has type_key => ( + is => 'ro', required =>1, + default => 'type', +); + + sub begin : Private { my ($self, $c) = @_; # Deserialize the request message - my $message; + my $message; my $s = $self->serializer; eval { my $body = $c->request->body; @@ -121,7 +127,7 @@ sub default : Private { # Forward the request to the appropriate action, based on the # message type. - my $action = $c->stash->{request}->{type}; + my $action = $c->stash->{request}->{ $self->type_key }; if (defined $action) { $c->forward($action, [$c->stash->{request}]); }