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


Java MessageBrokerRegistry.setUserDestinationPrefix方法代碼示例

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


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

示例1: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入方法依賴的package包/類
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
    // prefixes for all subscriptions
    config.enableSimpleBroker("/queue", "/topic");
    config.setUserDestinationPrefix("/user");

    // /app for normal calls, /topic for subscription events
    config.setApplicationDestinationPrefixes("/app", "/topic");
}
 
開發者ID:luxons,項目名稱:seven-wonders,代碼行數:10,代碼來源:WebSocketConfig.java

示例2: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入方法依賴的package包/類
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
    registry.enableSimpleBroker("/topic","/user");//可以在topic,user域向客戶端發送消息
    registry.setUserDestinationPrefix("/user/");//指定用戶發送(一對一)的主題前綴是“/user/”
    registry.setApplicationDestinationPrefixes("/app");//客戶端向服務端發送時的主題上麵需要加"/app"作為前綴;
}
 
開發者ID:ChinaLHR,項目名稱:JavaQuarkBBS,代碼行數:7,代碼來源:WebSocketConfig.java

示例3: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入方法依賴的package包/類
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
    registry.setApplicationDestinationPrefixes("/app", "/user");
    registry.setUserDestinationPrefix("/user");
    registry.enableSimpleBroker("/queue", "/topic");
}
 
開發者ID:scionaltera,項目名稱:emergentmud,代碼行數:7,代碼來源:WebSocketConfiguration.java

示例4: configureMessageBroker

import org.springframework.messaging.simp.config.MessageBrokerRegistry; //導入方法依賴的package包/類
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
    registry.enableSimpleBroker("/queue/", "/topic/");
    registry.setApplicationDestinationPrefixes("/app", "/user");
    registry.setUserDestinationPrefix("/user");
}
 
開發者ID:kTT,項目名稱:adjule,代碼行數:7,代碼來源:WebSocketConfig.java


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