本文整理匯總了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");
}
示例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"作為前綴;
}
示例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");
}
示例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");
}