integration

以下是为您整理出来关于【integration】合集内容,如果觉得还不错,请帮忙转发推荐。

【integration】技术教程文章

java – 在Integration测试中覆盖bean【代码】

对于我的Spring-Boot应用程序,我通过@Configuration文件提供了RestTemplate,因此我可以添加合理的默认值(ex Timeouts).对于我的集成测试,我想模拟RestTemplate,因为我不想连接到外部服务 – 我知道期望的响应.我尝试在集成测试包中提供不同的实现,希望后者将覆盖实际的实现,但是反过来检查日志:真正的实现覆盖了测试.如何确保TestConfig中的那个是使用的? 这是我的配置文件:@Configuration public class RestTemplateProvider {...

java – Spring Batch和Spring Integration【代码】

我想使用Spring Batch和Spring Integration从数据库导入数据并将它们写入文件并将它们ftp到远程服务器. 但我想我的问题是我不想为我的表创建域对象.我的查询是随机的,我想要的东西只是读取数据并将其写入文件和传输. 我可以在不创建相应域对象的情况下使用Spring Batch和Integration吗?解决方法:绝对.您可以使用JDBC ItemReaders或JPA ItemReader与ColumnMapRowMapper一起检索结果集的Map.您可以非常简单地使用FlatFileItemWriter...

MessageStore支持的QueueChannel与Spring Integration Java Config【代码】

Spring Integration reference guide指的是使用MessageStore实现为QueueChannel提供持久性. 提到了很多次,但是所有示例都使用XML配置,即<int:channel id="dbBackedChannel"><int:queue message-store="channelStore"/> </int:channel><bean id="channelStore" class="o.s.i.jdbc.store.JdbcChannelMessageStore"><property name="dataSource" ref="dataSource"/><property name="channelMessageStoreQueryProvider" ref="queryProv...

java-Spring Integration-应用程序代码中的调用方法【代码】

我有一个outbound-channel-adapter,其相关配置如下所示.<int:outbound-channel-adapter channel="foo-fileChannel" ref="foo-handlerTarget" method="handleFeedFile"><int:poller fixed-delay="5000" receive-timeout="1000" max-messages-per-poll="10" /> </int:outbound-channel-adapter> <int:channel id="foo-fileChannel"><int:queue /> </int:channel><bean id="foo-handlerTarget" class="com.abc.FooFeedHandlerImpl"><p...

java-Spring Batch和Spring Integration的集成问题-“未为端点定义轮询器”异常【代码】

我经历了Spring Integration guide和examples here,并获得了Spring Integration SFTP程序的工作样本.我已经有一个运行中的Spring Batch程序,该程序可以读取一堆文件并将其转储到数据库中. 我现在正在尝试通过Spring docs来集成Spring Batch和Spring Integration程序,并创建了以下配置.<bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory"><property name="host" value...

java-如何发送对TCP请求的答复(spring-integration)?【代码】

我需要类似Can not send response for UDP message的内容但对于TCP.因此客户端发送消息,TCP服务器可以像OK一样发送回响应.对于TCP socket-expression =“ @ inbound.socket”和destination-expression =“ headers [‘ip_packetAddress’]”无法使用. 这是我的配置现在的样子:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-in...

java-Spring Integration Inbound-Channel-Adapter逐行读取大文件【代码】

我目前正在将Spring Integration 4.1.0与Spring 4.1.2结合使用.我要求能够逐行读取文件并将读取的每一行都用作消息.基本上,我想允许我们的消息源之一“重播”,但是消息不是保存在单个文件中,而是保存在单个文件中.我对此用例没有交易要求.除了与JVM运行所在的服务器位于同一服务器上的文件外,我的要求与该发布类似:spring integration – read a remote file line by line 如我所见,我有以下选择: 1.使用int-file:inbound-chann...

Headerenricher Spring Integration和Java DSL【代码】

我正在使用Spring Integration和Java DSL规范来实现我的IntegrationFlow.我想使用一个自定义的头文件扩充工具来向头文件添加一些文件名,就像这样:public class FileHeaderNamingEnricher {public Message<File> enrichHeader(Message<File> fileMessage) {// getting some details fom the database ...return messageBuilder.setHeader("filename", "somestuff").build();} }我的集成流程如下所示:public IntegrationFlow myf...

java-AMQP Spring Integration错误处理【代码】

我有一个集成流程,如下所示:@Bean public IntegrationFlow auditFlow(@Qualifier("eventLoggingConnectionFactory") ConnectionFactory connectionFactory,@Qualifier("writeChannel") MessageChannel messageChannel,@Qualifier("parseErrorChannel") MessageChannel errorChannel) {return IntegrationFlows.from(Amqp.inboundAdapter(connectionFactory, auditQueue).errorChannel(errorChannel).concurrentConsumers(numConsu...

java-Spring Integration:通过注释配置入站通道适配器【代码】

如何通过注释而不是常规配置文件配置入站通道适配器?我可以为会话工厂定义bean,如下所示:@Bean public DefaultFtpSessionFactory ftpSessionFactory() {DefaultFtpSessionFactory ftpSessionFactory = new DefaultFtpSessionFactory();ftpSessionFactory.setHost(host);ftpSessionFactory.setPort(port);ftpSessionFactory.setUsername(username);ftpSessionFactory.setPassword(password);return ftpSessionFactory;}如何配置通...