Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2002-2013 the original author or authors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.springframework.messaging.simp.config;
 
Registration class for configuring a org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler.

Author(s):
Rossen Stoyanchev
Since:
4.0
 
 
 	private String relayHost = "127.0.0.1";
 
 	private int relayPort = 61613;
 
 	private String clientLogin = "guest";
 
 	private String clientPasscode = "guest";
 
 	private String systemLogin = "guest";
 
 	private String systemPasscode = "guest";
 
 
 
 	private String virtualHost;
 
 	private boolean autoStartup = true;
 
 
 	public StompBrokerRelayRegistration(SubscribableChannel clientInboundChannel,
 			MessageChannel clientOutboundChannelString[] destinationPrefixes) {
 
 		super(clientInboundChannelclientOutboundChanneldestinationPrefixes);
 	}


Set the STOMP message broker host.
 
 		Assert.hasText(relayHost"relayHost must not be empty");
 		this. = relayHost;
 		return this;
 	}

Set the STOMP message broker port.
 
 	public StompBrokerRelayRegistration setRelayPort(int relayPort) {
 		this. = relayPort;
 		return this;
 	}

Set the login to use when creating connections to the STOMP broker on behalf of connected clients.

By default this is set to "guest".

 
 		Assert.hasText(login"clientLogin must not be empty");
 		this. = login;
 		return this;
 	}

Set the passcode to use when creating connections to the STOMP broker on behalf of connected clients.

By default this is set to "guest".

 
 		Assert.hasText(passcode"clientPasscode must not be empty");
 		this. = passcode;
 		return this;
 	}

Set the login for the shared "system" connection used to send messages to the STOMP broker from within the application, i.e. messages not associated with a specific client session (e.g. REST/HTTP request handling method).

By default this is set to "guest".

		Assert.hasText(login"systemLogin must not be empty");
		this. = login;
		return this;
	}

Set the passcode for the shared "system" connection used to send messages to the STOMP broker from within the application, i.e. messages not associated with a specific client session (e.g. REST/HTTP request handling method).

By default this is set to "guest".

		Assert.hasText(passcode"systemPasscode must not be empty");
		this. = passcode;
		return this;
	}

Set the interval, in milliseconds, at which the "system" relay session will, in the absence of any other data being sent, send a heartbeat to the STOMP broker. A value of zero will prevent heartbeats from being sent to the broker.

The default value is 10000.

	public StompBrokerRelayRegistration setSystemHeartbeatSendInterval(long systemHeartbeatSendInterval) {
		this. = systemHeartbeatSendInterval;
		return this;
	}

Set the maximum interval, in milliseconds, at which the "system" relay session expects, in the absence of any other data, to receive a heartbeat from the STOMP broker. A value of zero will configure the relay session to expect not to receive heartbeats from the broker.

The default value is 10000.

	public StompBrokerRelayRegistration setSystemHeartbeatReceiveInterval(long heartbeatReceiveInterval) {
		this. = heartbeatReceiveInterval;
		return this;
	}

Set the value of the "host" header to use in STOMP CONNECT frames. When this property is configured, a "host" header will be added to every STOMP frame sent to the STOMP broker. This may be useful for example in a cloud environment where the actual host to which the TCP connection is established is different from the host providing the cloud-based STOMP service.

By default this property is not set.

		this. = virtualHost;
		return this;
	}

Configure whether the org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler should start automatically when the Spring ApplicationContext is refreshed.

The default setting is true.

	public StompBrokerRelayRegistration setAutoStartup(boolean autoStartup) {
		this. = autoStartup;
		return this;
	}
		handler.setRelayHost(this.);
		handler.setRelayPort(this.);
		if (this. != null) {
		}
		if (this. != null) {
		}
		if (this. != null) {
		}
		return handler;
	}
New to GrepCode? Check out our FAQ X