Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 96252 invoked from network); 8 Sep 2009 03:22:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Sep 2009 03:22:51 -0000 Received: (qmail 91187 invoked by uid 500); 8 Sep 2009 03:22:51 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 91108 invoked by uid 500); 8 Sep 2009 03:22:51 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 91097 invoked by uid 99); 8 Sep 2009 03:22:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2009 03:22:50 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2009 03:22:40 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MkrHf-0006bp-Fi for users@activemq.apache.org; Mon, 07 Sep 2009 20:22:19 -0700 Message-ID: <25339442.post@talk.nabble.com> Date: Mon, 7 Sep 2009 20:22:19 -0700 (PDT) From: nmittal To: users@activemq.apache.org Subject: Re: PERL/STOMP: How to Request Response In-Reply-To: <36e91d9d0909070842i4f0bc5f9ge94d3bd77058714@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: nmittal@rblt.com References: <25323954.post@talk.nabble.com> <36e91d9d0909070842i4f0bc5f9ge94d3bd77058714@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Dejan, Thanks for your reply. I have been trying that... I am trying with 2 stomp connections, one that subscribes to '/temp-queue/tq' and one that sends a message to /queue/Queue.Data with reply to as the above temp-queue. my client code is below.. my $stomp = Net::Stomp->new( { hostname => "192.168.42.30", port => '61613' } ); $stomp->connect(); my $stomp1 = Net::Stomp->new( { hostname => "192.168.42.30", port => '61613' } ); $stomp1->connect(); $stomp1->subscribe( { destination => '/temp-queue/tq', 'ack' => 'auto', 'activemq.prefetchSize' => 1, } ); my %head; $head{destination} = '/queue/Queue.Data'; $head{"reply-to"} = '/temp-queue/tq'; my $frame = Net::Stomp::Frame->new( { command => "SEND", headers => \%head, body => to_json(\%request) } ); $stomp->send_frame($frame); while (1) { my $frame1 = $stomp1->receive_frame; my $json1 = $frame1->body; print "$json1\n"; } -------- on the server, I subscribe to /queue/Queue.Data and send the reply back on the destination that is in the reply-to header. please see server code below... my $stomp = Net::Stomp->new( { hostname => $broker, port => '61613' } ); $stomp->connect(); $stomp->subscribe( { destination => '/queue/Queue.Data', 'ack' => 'client', 'activemq.prefetchSize' => 1, } ); while (1) { my $frame = $stomp->receive_frame; if (defined($frame->headers->{"reply-to"})) { my %head; $head{destination} = $frame->headers->{"reply-to"}; my $frame1= Net::Stomp::Frame->new( { command => "SEND", headers => \%head, body => "This is the response from server" } ); $stomp->send_frame($frame1); } $stomp->ack( { frame => $frame } ); } $stomp->disconnect; -- I see that the request is being sent and received but the reply never makes it to the client. What am I doing wrong? thanks Nishant Dejan Bosanac wrote: > > Hi, > > use /temp-topic/ or /temp-queue/ prefixes (instead of /topic/ and /queue/) > for destination names and ActiveMQ will create temporary destinations. > > Cheers > -- > Dejan Bosanac > > Open Source Integration - http://fusesource.com/ > ActiveMQ in Action - http://www.manning.com/snyder/ > Blog - http://www.nighttale.net > > > On Mon, Sep 7, 2009 at 3:45 AM, nmittal wrote: > >> >> Hi, I am trying to implement request response with a Perl Client using >> stomp. >> the documentation on the ActiveMQ website has sample code in JAVA that >> created a temporary destination and then sets the replyto header to this >> temp destination. >> How can I create a temporary destination in Perl STOMP client. I am using >> Net::Stomp. >> >> thanks for the help. >> >> Nishant >> -- >> View this message in context: >> http://www.nabble.com/PERL-STOMP%3A-How-to-Request-Response-tp25323954p25323954.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> > > > ----- > Dejan Bosanac > > Open Source Integration - http://fusesource.com/ > ActiveMQ in Action - http://www.manning.com/snyder/ > Blog - http://www.nighttale.net > -- View this message in context: http://www.nabble.com/PERL-STOMP%3A-How-to-Request-Response-tp25323954p25339442.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.