#!/home/mqm/perl5/bin/perl use strict; use warnings; use File::stat; use Net::STOMP::Client; my $mypath = "/home/mqm/perl2amq"; my $myfile = "pauls_what.bin"; my $stomp = Net::STOMP::Client->new( host => 'artemis', port => '61613' ); my $peer = $stomp->peer(); printf("connected to broker %s (IP %s), port %d\n", $peer->host(), $peer->addr(), $peer->port()); $stomp->connect( login => 'jboss', passcode => 'notyourstoknow' ); printf("speaking STOMP %s with server %s\n", $stomp->version(), $stomp->server() || "UNKNOWN"); my $content; open(my $fh, '<', $myfile) or die "cannot open file $myfile"; { local $/; $content = <$fh>; } close($fh); my $stat = stat($myfile); my $mylength = $stat->size; # content-length => $mylength, my $dashhost = "amqclient-source-com"; my $five = "12345"; my $stime = time(); my $my_id = "ID-$dashhost-$five-$stime-2-3"; $stomp->send( destination => "testqueue", CamelFileAbsolutePath => "$mypath/$myfile", CamelFileName => $myfile, CamelFileNameConsumed => $myfile, CamelFileNameOnly => $myfile, CamelFileParent => $mypath, CamelFilePath => "$mypath/$myfile", CamelFileRelativePath => $myfile, breadcrumbId => $my_id, "content-type" => "application/octet-stream", body => $content, ); $stomp->disconnect;