Subject: | Regarding use of receipts for sending messages |
Date: | Tue, 16 May 2017 15:26:46 +0530 |
To: | bug-Net-STOMP-Client [...] rt.cpan.org |
From: | Abhishek Choudhary <abhishek.iit001 [...] gmail.com> |
Hi,
I am sending messages to ActiveMQ server and using receipts. I observed an
issue where if my ActiveMQ server restarts and my sender application
retries to send the same message using the same receipt id, it dies with
following erorr:
'(error: duplicate receipt: 365e7b8-591ac453-e8f0-de56-11);'
This is coming from following function in Client/Receipt.pm:
sub _client_hook ($$) {
my($self, $frame) = @_;
my($value);
$value = $frame->header("receipt");
return unless defined($value);
dief("duplicate receipt: %s", $value) if $self->{"receipts"}{$value}++;
}
As I understand this hook is connected to all client FRAMES including
'SEND' and this error is happening because I retry to send the same
messages with same receipt id.
Do you think this is the correct behavior as my send call was never
successful and hence the server couldn't have acknowledged with a RECEIPT
frame so it isn't really a duplicate receipt id case? How do you think i
should handle this case?
Thanks,
Abhishek