Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 59282 invoked from network); 8 Sep 2009 13:55:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Sep 2009 13:55:06 -0000 Received: (qmail 12851 invoked by uid 500); 8 Sep 2009 13:55:06 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 12820 invoked by uid 500); 8 Sep 2009 13:55:06 -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 12805 invoked by uid 99); 8 Sep 2009 13:55:06 -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 13:55:06 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chubrilo@gmail.com designates 74.125.78.144 as permitted sender) Received: from [74.125.78.144] (HELO ey-out-1920.google.com) (74.125.78.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2009 13:54:55 +0000 Received: by ey-out-1920.google.com with SMTP id 5so1122376eyb.0 for ; Tue, 08 Sep 2009 06:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=IL6BLIbSOrhnB+okvhW0VFJdgbk9nZByhsHdWe281Ds=; b=bBn7SDLqde05fRjBHV6YHZk+LnqOs3/mFNIJACg5Lg9jDRlJqPRJK0Y4ZP3eXfWij/ kQ+c0whwUCc9FPjJNI/UfyTy4EBGp2CB2ejXyoSpmm1c0UcN/9cjnZVyCw5GXYiSkojN mjKgUtso01e/2O4aWVfRRw4REPHJ4ITwXn3u0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Elo3FJikUb6/YQa8mqHHszKLSxOoLa7REsL+5pM4RAn4V5DqkG/iTFzadCQ7W3LC62 RXyjkK0DLpJTQbQzdDXhYFlPnkkxf0nigYZw12Btj4kqJFjGXF5bD+5xH4NqwZpd/lJ9 +SRWbYJB7mYhKkZPkVf6QmVh282R0bV+Ea9wk= MIME-Version: 1.0 Sender: chubrilo@gmail.com Received: by 10.216.90.76 with SMTP id d54mr1985959wef.55.1252418073774; Tue, 08 Sep 2009 06:54:33 -0700 (PDT) In-Reply-To: <25339442.post@talk.nabble.com> References: <25323954.post@talk.nabble.com> <36e91d9d0909070842i4f0bc5f9ge94d3bd77058714@mail.gmail.com> <25339442.post@talk.nabble.com> Date: Tue, 8 Sep 2009 15:54:33 +0200 X-Google-Sender-Auth: 8a630ab24abc1626 Message-ID: <36e91d9d0909080654n3af19420mfe6495de034751c0@mail.gmail.com> Subject: Re: PERL/STOMP: How to Request Response From: Dejan Bosanac To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=0016e6d778dd65ca960473114e3a X-Virus-Checked: Checked by ClamAV on apache.org --0016e6d778dd65ca960473114e3a Content-Type: text/plain; charset=ISO-8859-1 Hi Nishant, just committed a test case that shows that stomp works nice with temp destinations here it is public void testTempDestination() throws Exception { String frame = "CONNECT\n" + "login: system\n" + "passcode: manager\n\n" + Stomp.NULL; stompConnection.sendFrame(frame); frame = stompConnection.receiveFrame(); assertTrue(frame.startsWith("CONNECTED")); frame = "SUBSCRIBE\n" + "destination:/temp-queue/" + getQueueName() + "\n" + "ack:auto\n\n" + Stomp.NULL; stompConnection.sendFrame(frame); frame = "SEND\n" + "destination:/temp-queue/" + getQueueName() + "\n\n" + "Hello World" + Stomp.NULL; stompConnection.sendFrame(frame); StompFrame message = stompConnection.receive(1000); assertEquals("Hello World", message.getBody()); } Can you try using one connection in your client code for starters and see if it works. If you cannot make your stomp implementation to work with temp destinations, you can use regular queues and selectors as described in this thread http://www.nabble.com/Implement-request-response-with-JMS-over-Stomp-td24914033.html Cheers -- Dejan Bosanac Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Tue, Sep 8, 2009 at 5:22 AM, nmittal wrote: > > 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. > > --0016e6d778dd65ca960473114e3a--