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


Java MessageChannels类代码示例

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


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

示例1: amqpNewOrderEventInboundFlow

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的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: newOrderEventProcessingFlow

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
private IntegrationFlowBuilder newOrderEventProcessingFlow(IntegrationFlowBuilder builder, boolean priorityQueue) {
    return builder
            .split(NewOrderEvent.class, NewOrderEvent::getItems)
            .transform(orderItemMapper::toOrderItemDs)
            .channel(MessageChannels.queue(10))
            .publishSubscribeChannel(c2 -> c2
                    .subscribe(s2 -> s2
                            .handle(m -> orderPreparationService.prepare((OrderItemDs) m.getPayload(), false)))
                    .subscribe(s2 -> s2
                            .aggregate(aggregator -> aggregator
                                    .outputProcessor(group -> group
                                            .getMessages()
                                            .stream()
                                            .map(m -> ((OrderItemDs) m.getPayload()).getItemName())
                                            .collect(Collectors.joining(","))))
                            .handle(m -> System.out.println(m.getPayload()))));
}
 
开发者ID:MarcinStachowiak,项目名称:spring-integration-dsl-samle,代码行数:18,代码来源:NewOrderIncommingFlowConfiguration.java

示例3: amqpNewOrderEventInboundFlow

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的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

示例4: flow

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
public IntegrationFlow flow() {
	String to = env.getProperty("queues.portfolio.creation");
	return IntegrationFlows
		.from(MessageChannels.publishSubscribe(Channels.PortfolioInitializationRequest))
		.transform(Transformers.toJson(mapper()))
		.handle(Amqp
			.outboundGateway(amqpTemplate)
			.routingKey(to))
		.transform(Transformers.fromJson(ContractPortfolioRelation.class, mapper()))
		.channel(MessageChannels.direct(Channels.PortfolioInitializationResponse))
		.get();
}
 
开发者ID:labcabrera,项目名称:lab-insurance,代码行数:14,代码来源:IntegrationConfig.java

示例5: creationflow

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
IntegrationFlow creationflow() {
	String to = env.getProperty("queues.contract.creation");
	return IntegrationFlows
		.from(MessageChannels.publishSubscribe(Channels.ContractCreationRequest))
		.transform(Transformers.toJson(mapper()))
		.handle(Amqp
			.outboundGateway(amqpTemplate)
			.routingKey(to)
		)
		.transform(Transformers.fromJson(Contract.class, mapper()))
		.channel(MessageChannels.direct(Channels.ContractCreationResponse))
		.get();
}
 
开发者ID:labcabrera,项目名称:lab-insurance,代码行数:15,代码来源:IntegrationConfig.java

示例6: approbationflow

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
IntegrationFlow approbationflow() {
	String to = env.getProperty("queues.contract.approbation");
	return IntegrationFlows
		.from(MessageChannels.publishSubscribe(Channels.ContractApprobationRequest))
		.transform(Transformers.toJson(mapper()))
		.handle(Amqp
			.outboundGateway(amqpTemplate)
			.routingKey(to)
		)
		.transform(Transformers.fromJson(Contract.class, mapper()))
		.channel(MessageChannels.direct(Channels.ContractApprobationResponse))
		.get();
}
 
开发者ID:labcabrera,项目名称:lab-insurance,代码行数:15,代码来源:IntegrationConfig.java

示例7: initialPaymentflow

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
IntegrationFlow initialPaymentflow() {
	String to = env.getProperty("queues.payment.initial-payment-reception");
	return IntegrationFlows
		.from(MessageChannels.publishSubscribe(Channels.InitialPaymentReceptionRequest))
		.transform(Transformers.toJson(mapper()))
		.handle(Amqp
			.outboundGateway(amqpTemplate)
			.routingKey(to)
		)
		.transform(Transformers.fromJson(Order.class, mapper()))
		.channel(MessageChannels.direct(Channels.InitialPaymentReceptionResponse))
		.get();
}
 
开发者ID:labcabrera,项目名称:lab-insurance,代码行数:15,代码来源:IntegrationConfig.java

示例8: myFlow

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
	public IntegrationFlow myFlow() {
		return IntegrationFlows.from(this.integerMessageSource(), c -> c.poller(Pollers.fixedRate(100)))
				.channel(this.inputChannel())
				.filter((Integer p) -> p > 0)
				.transform(Object::toString)
				.channel(MessageChannels.queue("sampleQueue"))
//				.handle(System.out::println)
				.get();
	}
 
开发者ID:netflix-spring-one,项目名称:sample-membership,代码行数:11,代码来源:Membership.java

示例9: myFlow

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
public IntegrationFlow myFlow() {
	return IntegrationFlows.from(this.integerMessageSource(), c ->
			c.poller(Pollers.fixedRate(100)))
			.channel(this.inputChannel())
			.filter((Integer p) -> p > 0)
			.transform(Object::toString)
			.channel(MessageChannels.queue())
			.get();
}
 
开发者ID:EldadDor,项目名称:Spring-Integration-ShowCase,代码行数:11,代码来源:FilterConfiguration.java

示例10: newOrderOutChannel

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean(name= IntegrationFlowKeys.NEW_ORDER_OUT_CHANNEL)
 public MessageChannel newOrderOutChannel(){
     return MessageChannels.executor(Executors.newCachedThreadPool()).get();
}
 
开发者ID:MarcinStachowiak,项目名称:spring-integration-dsl-samle,代码行数:5,代码来源:OrderOutgoingFlowConfiguration.java

示例11: newOrderOutChannel

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean(name= IntegrationFlowKeys.NEW_ORDER_OUT_CHANNEL)
public MessageChannel newOrderOutChannel(){
    return MessageChannels.executor(Executors.newCachedThreadPool()).get();
}
 
开发者ID:MarcinStachowiak,项目名称:spring-integration-dsl-samle,代码行数:5,代码来源:OrderReadyOutgoingFlowConfiguration.java

示例12: outboundRequests

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
public ExecutorChannel outboundRequests() {
	return MessageChannels.executor("outboundRequests", new SimpleAsyncTaskExecutor()).get();
}
 
开发者ID:mminella,项目名称:java-remote-partitioning,代码行数:5,代码来源:JobConfiguration.java

示例13: files

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
MessageChannel files() {
    return MessageChannels.direct().get();
}
 
开发者ID:livelessons-spring,项目名称:building-microservices,代码行数:5,代码来源:IntegrationConfiguration.java

示例14: contractCreationErrorChannel

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
MessageChannel contractCreationErrorChannel() {
	return MessageChannels.direct().get();
}
 
开发者ID:labcabrera,项目名称:lab-insurance,代码行数:5,代码来源:InsuranceContractCreationCoreDslSupport.java

示例15: orderInitializationChannel

import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
MessageChannel orderInitializationChannel() {
	return MessageChannels.direct().get();
}
 
开发者ID:labcabrera,项目名称:lab-insurance,代码行数:5,代码来源:InsuranceContractCreationCoreDslSupport.java


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