You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Michael Justin <mi...@gmx.net> on 2011/11/19 16:40:18 UTC

Stomp 1.1 - first message sent to broker after heart-beat time-out is "lost"

Hello,

For the current 5.6 snapshot, I wrote a test which sends a frame after 
the time-out of the heart-beat elapsed.

Expected behaviour is that the broker does not accept any more data from 
the socket connection.

However the client can successfully send one message to the broker.

Because the client does not see an error, he assumes that the message is 
transmitted successfully.

The next (second) message sent will be rejected by the broker.

Maybe this test case could be added to the Stomp11Tests code?


send:
CONNECT
accept-version:1.1
server:localhost
heart-beat:1000,0



received:
CONNECTED
heart-beat:0,2000
session:ID:mj-PC-49595-1314256305896-2:24
server:ActiveMQ/5.6-SNAPSHOT
version:1.1


-- wait for five seconds --

send:
SEND
destination:/queue/TOOL.DEFAULT



send:
DISCONNECT

Thanks and regards
-- 
Michael Justin
habarisoft - Enterprise Messaging Software for Delphi
http://www.habarisoft.com/

Re: Stomp 1.1 - first message sent to broker after heart-beat time-out is "lost"

Posted by Michael Justin <mi...@gmx.net>.
Am 21.11.2011 08:56, Michael Justin wrote:
> Am 19.11.2011 18:21, Timothy Bish wrote:
>
>> If you want to be sure that the message is processed, then you need to
>> add a receipt request, otherwise the delivery is not guaranteed. You
>> await the receipt an once received you know the broker had a chance to
>> process the message before the connection was closed as inactive.
>
> Thank you for your answer, I will use receipt headers in my tests now as
> you suggested.
>
> With my current tests (which do not use a receipt header in the Stomp
> SEND frame), I see the following output repeatedly in the broker log.
>
> These messages start to appear a few moments after the client waited too
> long:
>
> WARN | Transport failed:
> org.apache.activemq.transport.InactivityIOException: C
> hannel was inactive for too (>2000) long: tcp://127.0.0.1:49459
> WARN | Failed to browse Topic: TEST.DEFAULT
> java.lang.NullPointerException
> at org.apache.activemq.broker.region.policy.LastImageSubscriptionRecover
> yPolicy.browse(LastImageSubscriptionRecoveryPolicy.java:63)
> at org.apache.activemq.broker.region.Topic.doBrowse(Topic.java:572)
> at org.apache.activemq.broker.region.Topic.access$100(Topic.java:63)
> at org.apache.activemq.broker.region.Topic$6.run(Topic.java:667)
> at org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.
> java:33)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
>
>
> Regards

These error message are not related to the heartbeat feature, I deleted 
a queue in the ActiveMQ console and they disappeared.

-- 
Michael Justin
habarisoft - Enterprise Messaging Software for Delphi
http://www.habarisoft.com/

Re: Stomp 1.1 - first message sent to broker after heart-beat time-out is "lost"

Posted by Michael Justin <mi...@gmx.net>.
Am 19.11.2011 18:21, Timothy Bish wrote:

> If you want to be sure that the message is processed, then you need to
> add a receipt request, otherwise the delivery is not guaranteed.   You
> await the receipt an once received you know the broker had a chance to
> process the message before the connection was closed as inactive.

Thank you for your answer, I will use receipt headers in my tests now as 
you suggested.

With my current tests (which do not use a receipt header in the Stomp 
SEND frame), I see the following output repeatedly in the broker log.

These messages start to appear a few moments after the client waited too 
long:

  WARN | Transport failed: 
org.apache.activemq.transport.InactivityIOException: C
hannel was inactive for too (>2000) long: tcp://127.0.0.1:49459
  WARN | Failed to browse Topic: TEST.DEFAULT
java.lang.NullPointerException
         at 
org.apache.activemq.broker.region.policy.LastImageSubscriptionRecover
yPolicy.browse(LastImageSubscriptionRecoveryPolicy.java:63)
         at org.apache.activemq.broker.region.Topic.doBrowse(Topic.java:572)
         at 
org.apache.activemq.broker.region.Topic.access$100(Topic.java:63)
         at org.apache.activemq.broker.region.Topic$6.run(Topic.java:667)
         at 
org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.
java:33)
         at java.util.TimerThread.mainLoop(Timer.java:512)
         at java.util.TimerThread.run(Timer.java:462)


Regards
-- 
Michael Justin

Re: Stomp 1.1 - first message sent to broker after heart-beat time-out is "lost"

Posted by Timothy Bish <ta...@gmail.com>.
On Sat, 2011-11-19 at 16:40 +0100, Michael Justin wrote:
> Hello,
> 
> For the current 5.6 snapshot, I wrote a test which sends a frame after 
> the time-out of the heart-beat elapsed.
> 
> Expected behaviour is that the broker does not accept any more data from 
> the socket connection.
> 
> However the client can successfully send one message to the broker.
> 
> Because the client does not see an error, he assumes that the message is 
> transmitted successfully.
> 
> The next (second) message sent will be rejected by the broker.
> 
> Maybe this test case could be added to the Stomp11Tests code?
> 
> 
> send:
> CONNECT
> accept-version:1.1
> server:localhost
> heart-beat:1000,0
> 
> 
> 
> received:
> CONNECTED
> heart-beat:0,2000
> session:ID:mj-PC-49595-1314256305896-2:24
> server:ActiveMQ/5.6-SNAPSHOT
> version:1.1
> 
> 
> -- wait for five seconds --
> 
> send:
> SEND
> destination:/queue/TOOL.DEFAULT

If you want to be sure that the message is processed, then you need to
add a receipt request, otherwise the delivery is not guaranteed.   You
await the receipt an once received you know the broker had a chance to
process the message before the connection was closed as inactive.



> 
> 
> 
> send:
> DISCONNECT
> 
> Thanks and regards