當前位置: 首頁>>代碼示例>>Java>>正文


Java MessageBrokerRegistry類代碼示例

本文整理匯總了Java中org.springframework.messaging.simp.config.MessageBrokerRegistry的典型用法代碼示例。如果您正苦於以下問題:Java MessageBrokerRegistry類的具體用法?Java MessageBrokerRegistry怎麽用?Java MessageBrokerRegistry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MessageBrokerRegistry類屬於org.springframework.messaging.simp.config包,在下文中一共展示了MessageBrokerRegistry類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
    public void configureMessageBroker(MessageBrokerRegistry registry) {
//        registry.enableSimpleBroker("/topic", "/queue");
        registry.enableStompBrokerRelay("/topic", "/queue")
                .setRelayPort(61613)
                .setClientLogin("guest")
                .setClientPasscode("password")
                .setSystemLogin("guest")
                .setSystemPasscode("password");
        registry.setApplicationDestinationPrefixes("/app");

    }
 
開發者ID:borysfan,項目名稱:websocket-poc,代碼行數:13,代碼來源:WebSocketConfiguration.java

示例2: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
public void configureMessageBroker(final MessageBrokerRegistry config)
{
	// use the /topic prefix for outgoing WebSocket communication
	config.enableSimpleBroker(
			TOPIC_UserSession,
			TOPIC_Notifications,
			TOPIC_View,
			TOPIC_Document,
			TOPIC_Board,
			TOPIC_Dashboard,
			TOPIC_Devices);

	// use the /app prefix for others
	config.setApplicationDestinationPrefixes("/app");
}
 
開發者ID:metasfresh,項目名稱:metasfresh-webui-api,代碼行數:17,代碼來源:WebSocketConfig.java

示例3: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
public void configureMessageBroker ( MessageBrokerRegistry config ) {
    config.enableSimpleBroker("/topic");

    /**
     * The given channel-prefixes are used to filter out incoming
     * SEND commands. Only those matching this filter will be handed over to the
     * Controllers for further processing.
     *
     * A client should therefore send a message to a destination channel like:
     *
     * channel: /app/echo
     *
     * Where '/echo' is the actual mapping in the controllers.
     *
     * */
    config.setApplicationDestinationPrefixes("/app"); // The client has
}
 
開發者ID:zhaar,項目名稱:Neuralnet-IoT-Car,代碼行數:19,代碼來源:StompWebSocketConfig.java

示例4: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
    if (configurationMediator.isClusterMode()) {
        List<NodeEntry> nodeEntries = nodeRepository.findByMaster(true);
        String masterId;
        if (nodeEntries.isEmpty()) {
            masterId = SystemUtils.getInstanceId();
        } else {
            masterId = nodeEntries.get(0).getNodeId();
        }
        config.enableStompBrokerRelay(ERROR_DESTINATION, TASK_PROGRESS_DESTINATION, LOGS_DESTINATION)
                .setRelayHost(awsCommunicationService.getDNSName(masterId)).setRelayPort(brokerPort);
    } else {
        config.enableSimpleBroker(ERROR_DESTINATION, TASK_PROGRESS_DESTINATION, LOGS_DESTINATION);
    }
}
 
開發者ID:SungardAS,項目名稱:enhanced-snapshots,代碼行數:17,代碼來源:WebSocketConfig.java

示例5: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
public void configureMessageBroker(final MessageBrokerRegistry config) {
  // to support stomp over websockets natively...
  logger.warn(" ~~> issue #24 - not using the spring stomp broker relay until it supports reactor 3");
  config.enableSimpleBroker("/topic");

  // to use the stomp support built into RabbitMQ...
  // NOTE: not using this due to https://github.com/the-james-burton/the-turbine/issues/24
  // config.enableStompBrokerRelay("/topic", "/queue")
  //     .setRelayHost("localhost")
  //     .setRelayPort(61613)
  //     .setSystemLogin("guest")
  //     .setSystemPasscode("guest");
  // // .setVirtualHost("/");

  config.setApplicationDestinationPrefixes("/app");
  config.setPathMatcher(new AntPathMatcher("."));
}
 
開發者ID:the-james-burton,項目名稱:the-turbine,代碼行數:19,代碼來源:WebSocketConfig.java

示例6: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
    public void configureMessageBroker(MessageBrokerRegistry config) {
        config.setApplicationDestinationPrefixes("/app");
        config.enableSimpleBroker("/queue/", "/topic/");

        // This uses too much data for CF AMPQ service
//        StompBrokerRelayRegistration stompBrokerRelayRegistration = config.enableStompBrokerRelay("/queue/", "/topic/");
//
//        stompBrokerRelayRegistration.setRelayHost(environment.getProperty("rabbitmq.host"));
//        stompBrokerRelayRegistration.setVirtualHost(environment.getProperty("rabbitmq.virtualhost"));
//        stompBrokerRelayRegistration.setClientLogin(environment.getProperty("rabbitmq.username"));
//        stompBrokerRelayRegistration.setSystemLogin(environment.getProperty("rabbitmq.username"));
//        stompBrokerRelayRegistration.setClientPasscode(environment.getProperty("rabbitmq.password"));
//        stompBrokerRelayRegistration.setSystemPasscode(environment.getProperty("rabbitmq.password"));

        // only if we want to use . instead of / for path separator e.g. /app/user.chat
//        config.setPathMatcher(new AntPathMatcher("."));
    }
 
開發者ID:bjornharvold,項目名稱:bearchoke,代碼行數:19,代碼來源:WebSocketConfig.java

示例7: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
public void configureMessageBroker(final MessageBrokerRegistry config) {
    config.enableSimpleBroker("/logs");
    if (StringUtils.isNotBlank(serverProperties.getContextPath())) {
        config.setApplicationDestinationPrefixes(serverProperties.getContextPath());
    }
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:8,代碼來源:CasReportsConfiguration.java

示例8: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
/**
 * 這個方法的作用是定義消息代理,通俗一點講就是設置消息連接請求的各種規範信息。
 *
 * @param messageBrokerRegistry MessageBrokerRegistry
 */
@Override
public void configureMessageBroker(MessageBrokerRegistry messageBrokerRegistry) {
    //表示客戶端訂閱地址的前綴信息,也就是客戶端接收服務端消息的地址的前綴信息
    messageBrokerRegistry.enableSimpleBroker("/topic");
    //指服務端接收地址的前綴,意思就是說客戶端給服務端發消息的地址的前綴
    messageBrokerRegistry.setApplicationDestinationPrefixes("/app");
}
 
開發者ID:tong12580,項目名稱:OutsourcedProject,代碼行數:13,代碼來源:WebSocketConfig.java

示例9: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
    public void configureMessageBroker(MessageBrokerRegistry config) {
        config.setApplicationDestinationPrefixes("/app");
        config.enableSimpleBroker("/queue", "/topic");
//        simple broker is not suitable for production environments.
//        config.enableStompBrokerRelay("/queue", "/topic");
    }
 
開發者ID:nicolasmanic,項目名稱:JRockets,代碼行數:8,代碼來源:WebSocketConfig.java

示例10: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
    // Where messages published from the server side are published to.
    // OR ... the prefix for where consumers subscribe.
    config.enableSimpleBroker("/topic");

    //Controller end point prefixes, where consumers publish messages TO.
    config.setApplicationDestinationPrefixes("/websocket");
}
 
開發者ID:SourceLabOrg,項目名稱:kafka-webview,代碼行數:10,代碼來源:WebSocketConfig.java

示例11: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
    public void configureMessageBroker(MessageBrokerRegistry registry) {
//        //メッセージを処理する Controller の呼び出しパスのプレフィックスを設定します。
//        registry.setApplicationDestinationPrefixes("/front");
        //購読セッションに対して配信するためのブローカーのプレフィックスを設定します。
        registry.enableSimpleBroker("/topic");
    }
 
開發者ID:shout-star,項目名稱:uroborosql-springboot-demo,代碼行數:8,代碼來源:WebSocketConfig.java

示例12: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
public void configureMessageBroker(MessageBrokerRegistry config){
    //表示客戶端訂閱地址的前綴信息,即客戶端接收服務端地址信息的前綴信息
    logger.info("Client receiving address prefix information");
    config.enableSimpleBroker("/wechat");

    //客戶端給服務端地址的前綴信息
    logger.info("Client to server-side address prefix information");
    config.setApplicationDestinationPrefixes("/wechat");
}
 
開發者ID:SnackMen,項目名稱:DanmuChat,代碼行數:11,代碼來源:WebSocketConfig.java

示例13: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
/**
 * 定義消息代理,設置消息連接請求的各種規範信息.
 *
 * @param config 消息代理注冊
 */
@Override
public void configureMessageBroker ( MessageBrokerRegistry config ) {
	// Server前綴,指服務端接收地址的前綴,意思就是說客戶端給服務端發消息的地址的前綴
	config.setApplicationDestinationPrefixes( serverApplicationDestinationPrefixes );
	// Client前綴,表示客戶端訂閱地址的前綴信息,也就是客戶端接收服務端消息的地址的前綴信息
	config.enableSimpleBroker( clientBrokerDestinationPrefixes );
}
 
開發者ID:yujunhao8831,項目名稱:spring-boot-start-current,代碼行數:13,代碼來源:WebSocketConfig.java

示例14: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
    // prefix for subscribe
    for (Map.Entry<String, ZuulWebSocketProperties.WsBrokerage> entry : zuulWebSocketProperties
            .getBrokerages().entrySet()) {
        ZuulWebSocketProperties.WsBrokerage wsBrokerage = entry.getValue();
        if (wsBrokerage.isEnabled()) {
            config.enableSimpleBroker(
                    mergeBrokersWithApplicationDestinationPrefixes(wsBrokerage));
            // prefix for send
            config.setApplicationDestinationPrefixes(
                    wsBrokerage.getDestinationPrefixes());
        }
    }
}
 
開發者ID:mthizo247,項目名稱:spring-cloud-netflix-zuul-websocket,代碼行數:16,代碼來源:ZuulWebSocketConfiguration.java

示例15: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入依賴的package包/類
@Override
public void configureMessageBroker(final MessageBrokerRegistry config) {
    config.enableSimpleBroker(
            "/global",
            "/announce",
            "/config",
            "/torrents"
    );
    config.setApplicationDestinationPrefixes("/joal");
}
 
開發者ID:anthonyraymond,項目名稱:joal,代碼行數:11,代碼來源:WebSocketConfig.java


注:本文中的org.springframework.messaging.simp.config.MessageBrokerRegistry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。