From 79127ae4409c5137ceb3b037751800917d59b4ea Mon Sep 17 00:00:00 2001 From: "Timothy A. Bish" Date: Tue, 23 Oct 2012 14:14:39 +0000 Subject: [PATCH] Add a method for manually send a keep alive value to the broker. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1401300 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/transport/stomp/StompConnection.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompConnection.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompConnection.java index 767527e257..a21d0fde9b 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompConnection.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompConnection.java @@ -241,6 +241,12 @@ public class StompConnection { sendFrame(frame.format()); } + public void keepAlive() throws Exception { + OutputStream outputStream = stompSocket.getOutputStream(); + outputStream.write('\n'); + outputStream.flush(); + } + protected String appendHeaders(HashMap headers) { StringBuilder result = new StringBuilder(); for (String key : headers.keySet()) {