本文整理匯總了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();
}
示例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();
}