当前位置: 首页>>代码示例>>Java>>正文


Java Amqp类代码示例

本文整理汇总了Java中org.springframework.integration.dsl.amqp.Amqp的典型用法代码示例。如果您正苦于以下问题:Java Amqp类的具体用法?Java Amqp怎么用?Java Amqp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Amqp类属于org.springframework.integration.dsl.amqp包,在下文中一共展示了Amqp类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: amqpNewOrderEventInboundFlow

import org.springframework.integration.dsl.amqp.Amqp; //导入依赖的package包/类
@Bean
public IntegrationFlow amqpNewOrderEventInboundFlow() {
    return IntegrationFlows.from(Amqp.inboundAdapter(rabbitMQConnection(), queueNewRealizations))
            .channel(MessageChannels.executor(Executors.newCachedThreadPool()))
            .transform(this::performNewOrderEventUnmarshaling)
            .publishSubscribeChannel(c -> c
                    .subscribe(s -> s
                            .<NewOrderEvent, Boolean>route(NewOrderEvent::isPriorityRealization, mapping -> mapping
                                    .subFlowMapping(false, sf -> sf
                                            .channel(IntegrationFlowKeys.NOT_PRIORITY_ORDER_PROCESSING_QUEUE))
                                    .subFlowMapping(true, sf -> sf
                                            .channel(IntegrationFlowKeys.PRIORITY_ORDER_PROCESSING_QUEUE))))
                    .subscribe(s -> s
                            .transform(orderReadyMapper::toOrderReady)
                            .channel(IntegrationFlowKeys.NEW_ORDER_OUT_CHANNEL)))
            .get();
}
 
开发者ID:MarcinStachowiak,项目名称:spring-integration-dsl-samle,代码行数:18,代码来源:NewOrderIncommingFlowConfiguration.java

示例2: provisionFtpRequestsFlow

import org.springframework.integration.dsl.amqp.Amqp; //导入依赖的package包/类
@Bean
IntegrationFlow provisionFtpRequestsFlow(AmqpTemplate amqpTemplate) {
    return IntegrationFlows.from(PROVISION_REQUESTS_CHANNEL_NAME)
            .transform(FtpServerProvisionerRequest.class,
                    new GenericTransformer<FtpServerProvisionerRequest, String>() {
                        @Override
                        public String transform(FtpServerProvisionerRequest source) {
                            try {
                                ObjectMapper om = new ObjectMapper();
                                return om.writer().writeValueAsString(source);
                            } catch (JsonProcessingException e) {
                                throw new RuntimeException(e);
                            }
                        }
                    })
            .handle(Amqp.outboundGateway(amqpTemplate).routingKey(this.ftpRequests))
            .get();
}
 
开发者ID:joshlong,项目名称:cloudfoundry-ftp-service-broker,代码行数:19,代码来源:FtpServerProvisionerClientAutoConfiguration.java

示例3: amqpReplyFlow

import org.springframework.integration.dsl.amqp.Amqp; //导入依赖的package包/类
@Bean
IntegrationFlow amqpReplyFlow(ConnectionFactory rabbitConnectionFactory,
                              UserManager ftpUserManager) {
    return IntegrationFlows.from(Amqp.inboundGateway(rabbitConnectionFactory, this.ftpRequests)
            .messageConverter(new Jackson2JsonMessageConverter()))
            .transform(String.class, new GenericTransformer<String, String>() {
                @Override
                public String transform(String source) {
                    try {
                        Map<String, String> map = toMap(source);
                        String ws = map.get("workspace");
                        String usr = map.get("user");
                        String password = UUID.randomUUID().toString();
                        FtpUser user = new FtpUser(ws, usr, password, true);
                        ftpUserManager.save(user);
                        String ftpUri = buildFtpConnectionString(host, port, user);
                        log.info("registering: workspace: " + ws + ", " + "user: " + usr + ", ftp URI: " + ftpUri);
                        return ftpUri;
                    } catch (FtpException e) {
                        throw new RuntimeException(e);
                    }
                }
            }).get();
}
 
开发者ID:joshlong,项目名称:cloudfoundry-ftp-service-broker,代码行数:25,代码来源:Application.java

示例4: amqpNewOrderEventInboundFlow

import org.springframework.integration.dsl.amqp.Amqp; //导入依赖的package包/类
@Bean
public IntegrationFlow amqpNewOrderEventInboundFlow() {
    return IntegrationFlows.from(Amqp.inboundAdapter(rabbitMQConnection(), queueOrderReady))
            .channel(MessageChannels.executor(Executors.newCachedThreadPool()))
            .transform(this::performOrderReadyUnmarshaling)
            .handle(m -> sentNotifiation((OrderReady) m.getPayload()))
            .get();
}
 
开发者ID:MarcinStachowiak,项目名称:spring-integration-dsl-samle,代码行数:9,代码来源:OrderReadyIncommingFlowConfiguration.java

示例5: amqpOutboundFlow

import org.springframework.integration.dsl.amqp.Amqp; //导入依赖的package包/类
@Bean
public IntegrationFlow amqpOutboundFlow() {
    return IntegrationFlows.from(newOrderOutChannel())
            .transform(this::performMarshaling)
            .handle(Amqp.outboundAdapter(amqpTemplate())
                    .exchangeName(newOrderEventOutAmqpExchange)
                    .routingKey(newOrderEventOutAmqpRoutingKey))
            .get();
}
 
开发者ID:MarcinStachowiak,项目名称:spring-integration-dsl-samle,代码行数:10,代码来源:OrderOutgoingFlowConfiguration.java

示例6: amqpOutboundFlow

import org.springframework.integration.dsl.amqp.Amqp; //导入依赖的package包/类
@Bean
public IntegrationFlow amqpOutboundFlow() {
    return IntegrationFlows.from(newOrderOutChannel())
            .transform(this::performMarshalingOrderReady)
            .handle(Amqp.outboundAdapter(amqpTemplate())
                    .exchangeName(readyOrdersEventOutAmqpExchange)
                    .routingKey(readyOrdersEventOutAmqpRoutingKey))
            .get();
}
 
开发者ID:MarcinStachowiak,项目名称:spring-integration-dsl-samle,代码行数:10,代码来源:OrderReadyOutgoingFlowConfiguration.java

示例7: amqpReplyFlow

import org.springframework.integration.dsl.amqp.Amqp; //导入依赖的package包/类
@Bean
public IntegrationFlow amqpReplyFlow(ConnectionFactory rabbitConnectionFactory,
		EchoService echoService) {
	return IntegrationFlows
			.from(Amqp.inboundGateway(rabbitConnectionFactory,
					this.echoQueueAndExchangeName))
			.transform(String.class, echoService::echo).get();
}
 
开发者ID:livelessons-spring,项目名称:building-microservices,代码行数:9,代码来源:AmqpIntegration.java


注:本文中的org.springframework.integration.dsl.amqp.Amqp类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。