Skip Menu |

This queue is for tickets about the Net-STOMP-Client CPAN distribution.

Report information
The Basics
Id: 99850
Status: rejected
Priority: 0/
Queue: Net-STOMP-Client

People
Owner: Nobody in particular
Requestors: pedrom [...] ccbill.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Net::STOMP::Client::IO::send_data BUG
Date: Tue, 28 Oct 2014 02:42:56 +0000
To: "bug-Net-STOMP-Client [...] rt.cpan.org" <bug-Net-STOMP-Client [...] rt.cpan.org>
From: Pedro Morales <pedrom [...] ccbill.com>
Hey team, We've used this for a long time. No issues works great. However, we recently upgraded to perl 5.10 and we have found an issue. Let me know what you guys think. Distro name and version: Net-STOMP-Client-2.2 Perl: v5.10.1 (*) built for x86_64-linux-thread-multi OS vendor/version: x86_64 GNU/Linux Pseudo code: my $stompFrame = Net::STOMP::Client::Frame->new( command => 'SEND', headers => { destination => '/queue/MYQUEUE', 'content-length' => '', }, body => '<xml><testvalue>1</testvalue></xml>', ); if (!Net::STOMP::Client::send_frame($stompFrame)){ print STDERR "Unable to send stomp packet to /queue/MYQUEUE\n"; return 0; } This is how we have our code implemented. The issue is that it seems that in the new version of PERL Net::STOMP::Client::send_frame doesn't actually return the number of bytes written. I did a little digging and I found the following snippet in there for that method: sub send_frame : method { my($self, $frame, %option); $self = shift(@_); $frame = shift(@_); %option = _hackopt(@_); # queue the frame $self->queue_frame($frame, %option); # send queued data $self->send_data(%option); # make sure we did send _all_ data dief("could not send all data!") if $self->outgoing_buffer_length(); } Do you see how send_frame doesn't have an explicit return value? Normally, this would return the last statement executed ($self->send_data()) however, it seems as of the new version of PERL it's not. I keep getting 0 which im guessing is coming from the last statement's $self->outgoing_buffer_length(). FYI, this doesn't cause any deal breaking issues. The frame still gets sent to the queue its just the way we test the condition for true fails now and we print the "Unable to send stomp packet... "message in our logs repeatedly. Let me know if any of this doesn't make sense. Could it be a bug in PERL? Now that it's behaving differently? Are you able to reproduce this behavior in PERL 5.10? For reference, we have this implementation working on LIVE environment using PERL 5.8.7 Thanks. Pedro M Software Developer II T 480.449.7751 ext. 143 M 602.206.1447 F 480.422.2038 E pedrom@ccbill.com <mailto:pedrom@ccbill.com> http://www.ccbill.com/ [CCBill, LLC]<http://www.ccbill.com/> CCBill, LLC * 2353 W University Dr. * Tempe, AZ 85281 * USA

Message body is not shown because it is too large.

Download image002.png
image/png 156b
image002.png
Download image004.png
image/png 9.9k
image004.png
Download image006.png
image/png 145b
image006.png
Download image007.png
image/png 150b
image007.png
send_frame() indeed does not return a value. This is by design so you should not try to use its return value. If you want to make sure that whatever you sent previously indeed got sent, you should check the length of the outgoing buffer. Something like: if ($broker->outgoing_buffer_length() > 0) { ... send is not complete ... }
CC: Pedro Morales <pedrom [...] ccbill.com>
Subject: Re: [rt.cpan.org #99850] Net::STOMP::Client::IO::send_data BUG
Date: Tue, 28 Oct 2014 12:54:29 +0000
To: "bug-Net-STOMP-Client [...] rt.cpan.org" <bug-Net-STOMP-Client [...] rt.cpan.org>
From: Pedro Morales <pedrom [...] ccbill.com>
Ok understood. Ty for the quick response :) --Pedro Sent from my Samsung Galaxy S® III Lionel Cons via RT <bug-Net-STOMP-Client@rt.cpan.org> wrote: <URL: https://rt.cpan.org/Ticket/Display.html?id=99850 > send_frame() indeed does not return a value. This is by design so you should not try to use its return value. If you want to make sure that whatever you sent previously indeed got sent, you should check the length of the outgoing buffer. Something like: if ($broker->outgoing_buffer_length() > 0) { ... send is not complete ... }