Plack-Handler-Stomp
view release on metacpan or search on metacpan
lib/Plack/Handler/Stomp.pm view on Meta::CPAN
CONTENT_LENGTH => length($frame->body),
CONTENT_TYPE => ( $frame->headers->{'content-type'} || 'application/octet-stream' ),
# psgi
'psgi.version' => [1,0],
'psgi.url_scheme' => 'http',
'psgi.multithread' => 0,
'psgi.multiprocess' => 0,
'psgi.run_once' => 0,
'psgi.nonblocking' => 0,
'psgi.streaming' => 1,
'psgi.input' => do {
open my $input, '<', \($frame->body);
$input;
},
'psgi.errors' => Plack::Util::inline_object(
print => sub { $self->logger->error(@_) },
),
};
if ($frame->headers) {
lib/Plack/Handler/Stomp.pm view on Meta::CPAN
CONTENT_LENGTH => length($body),
CONTENT_TYPE => $content-type,
# psgi
'psgi.version' => [1,0],
'psgi.url_scheme' => 'http',
'psgi.multithread' => 0,
'psgi.multiprocess' => 0,
'psgi.run_once' => 0,
'psgi.nonblocking' => 0,
'psgi.streaming' => 1,
In addition, reading from C<psgi.input> will return the message body,
and writing to C<psgi.errors> will log via the L</logger> at level
C<error>.
Finally, every header in the STOMP message will be available in the
"namespace" C<jms.>, so for example the message type is in
C<jms.type>.
The C<$path_info> is obtained from the L</destination_path_map>
t/building_request.t view on Meta::CPAN
CONTENT_LENGTH => 3,
CONTENT_TYPE => 'json',
# psgi
'psgi.version' => [1,0],
'psgi.url_scheme' => 'http',
'psgi.multithread' => 0,
'psgi.multiprocess' => 0,
'psgi.run_once' => 0,
'psgi.nonblocking' => 0,
'psgi.streaming' => 1,
# stomp
'jms.destination' => '/queue/testing',
'jms.message-id' => 123,
'jms.content-type' => 'json',
# application
'testapp.body' => 'foo',
);
( run in 0.413 second using v1.01-cache-2.11-cpan-4d50c553e7e )