ActiveMQ
  1. ActiveMQ
  2. AMQ-3484

Stomp 1.1 - add a testcase for sending messages after expired heartbeat

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.x
    • Fix Version/s: 5.6.0
    • Component/s: Connector
    • Labels:

      Description

      The testcase below waits for five seconds after connecting and then tries to write a SEND frame. The test fails if a frame can be sent to the broker after missing heartbeat signals.

      public void testSendAfterMissingHeartbeat() throws Exception {

      String connectFrame = "STOMP\n" +
      "login: system\n" +
      "passcode: manager\n" +
      "accept-version:1.1\n" +
      "heart-beat:1000,0\n" +
      "host:localhost\n" +
      "\n" + Stomp.NULL;

      stompConnection.sendFrame(connectFrame);
      String f = stompConnection.receiveFrame();
      assertTrue(f.startsWith("CONNECTED"));
      assertTrue(f.indexOf("version:1.1") >= 0);
      assertTrue(f.indexOf("heart-beat:") >= 0);
      assertTrue(f.indexOf("session:") >= 0);
      LOG.debug("Broker sent: " + f);

      Thread.sleep(5000);

      try

      { String message = "SEND\n" + "destination:/queue/" + getQueueName() + "\n\n" + "Hello World" + Stomp.NULL; stompConnection.sendFrame(message); fail("SEND frame has been accepted after missing heart beat"); }

      catch (Exception ex)

      { System.out.println(ex.getMessage()); }

      }

        Activity

        Michael Justin created issue -
        Timothy Bish made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.6.0 [ 12316331 ]
        Resolution Fixed [ 1 ]
        Gary Tully made changes -
        Fix Version/s 5.6.0 [ 12317974 ]
        Fix Version/s 5.x [ 12316331 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Michael Justin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development