Example usage for org.springframework.messaging.simp.stomp StompHeaders setHeartbeat

List of usage examples for org.springframework.messaging.simp.stomp StompHeaders setHeartbeat

Introduction

In this page you can find the example usage for org.springframework.messaging.simp.stomp StompHeaders setHeartbeat.

Prototype

public void setHeartbeat(@Nullable long[] heartbeat) 

Source Link

Document

Set the heartbeat header.

Usage

From source file:org.springframework.messaging.simp.stomp.StompClientSupport.java

/**
 * Further initialize the StompHeaders, for example setting the heart-beat
 * header if necessary./*from   w w w.  ja  v a2s .  c  o  m*/
 * @param connectHeaders the headers to modify
 * @return the modified headers
 */
protected StompHeaders processConnectHeaders(StompHeaders connectHeaders) {
    connectHeaders = (connectHeaders != null ? connectHeaders : new StompHeaders());
    if (connectHeaders.getHeartbeat() == null) {
        connectHeaders.setHeartbeat(getDefaultHeartbeat());
    }
    return connectHeaders;
}