当前位置: 首页>>代码示例>>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;未经允许,请勿转载。