本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例13: files
import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
MessageChannel files() {
return MessageChannels.direct().get();
}
示例14: contractCreationErrorChannel
import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
MessageChannel contractCreationErrorChannel() {
return MessageChannels.direct().get();
}
示例15: orderInitializationChannel
import org.springframework.integration.dsl.channel.MessageChannels; //导入依赖的package包/类
@Bean
MessageChannel orderInitializationChannel() {
return MessageChannels.direct().get();
}