我试图使用Spring Integration配置以下内容:
>向频道发送消息.>将此消息发布到与n个消费者的兔子扇出(pub / sub)交换.>每个消费者都提供响应消息.>让Spring Integration在将它们返回到原始客户端之前聚合这些响应.
到目前为止,我有一些问题……
>我正在使用发布 – 订阅 – 通道来设置apply-sequence =“true”属性,以便correlationId,sequenceSize& sequenceNumber属性已设置. DefaultAmqpHeaderMapper抛弃了这些属性. DEBUG hea...
Service:package com.example.ec.service;import com.example.ec.domain.Tour;
import com.example.ec.domain.TourRating;
import com.example.ec.repo.TourRatingRepository;
import com.example.ec.repo.TourRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.d...
开篇词
尤金的第 25 篇 Java 周评,诞生了!
Java 以及 Spring 相关Java 8 周五:最佳的 Java 8 资源 - 你的周末被预订了
我将在本周的回顾中开始 … 等一下 … 资源列表(多么的元啊)。虽然这是一个很好的选择,但我毫不犹豫地将其放在首位 - 尽情享受。该博客也在内的事实是否会导致栈溢出?我知道这是无趣的笑话 - 但如果不在这里的话,在哪里?
Eclipse 4.4 Luna 崛起了!
又到了每年的这个时候 - 新 Eclipse 的发布。
我个...
如何使用自定义应用程序从Java程序中打开文件?Desktop.getDesktop().open(file);仅使用系统默认应用程序打开文件.我需要的是像open(myapp, file);解决方法:如果目标应用程序接受要打开的文件作为参数,则可以执行以下操作:Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("CustomApp "+filename);
我目前正在将Spring Integration 4.1.0与Spring 4.1.2结合使用.我要求能够逐行读取文件并将读取的每一行都用作消息.基本上,我想允许我们的消息源之一“重播”,但是消息不是保存在单个文件中,而是保存在单个文件中.我对此用例没有交易要求.除了与JVM运行所在的服务器位于同一服务器上的文件外,我的要求与该发布类似:spring integration – read a remote file line by line
如我所见,我有以下选择:
1.使用int-file:inbound-chann...
我正在使用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...
我有一个集成流程,如下所示:@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...
如何通过注释而不是常规配置文件配置入站通道适配器?我可以为会话工厂定义bean,如下所示:@Bean
public DefaultFtpSessionFactory ftpSessionFactory() {DefaultFtpSessionFactory ftpSessionFactory = new DefaultFtpSessionFactory();ftpSessionFactory.setHost(host);ftpSessionFactory.setPort(port);ftpSessionFactory.setUsername(username);ftpSessionFactory.setPassword(password);return ftpSessionFactory;}如何配置通...
我需要类似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...
我经历了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...
我有一个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...
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...
我想使用Spring Batch和Spring Integration从数据库导入数据并将它们写入文件并将它们ftp到远程服务器.
但我想我的问题是我不想为我的表创建域对象.我的查询是随机的,我想要的东西只是读取数据并将其写入文件和传输.
我可以在不创建相应域对象的情况下使用Spring Batch和Integration吗?解决方法:绝对.您可以使用JDBC ItemReaders或JPA ItemReader与ColumnMapRowMapper一起检索结果集的Map.您可以非常简单地使用FlatFileItemWriter...
对于我的Spring-Boot应用程序,我通过@Configuration文件提供了RestTemplate,因此我可以添加合理的默认值(ex Timeouts).对于我的集成测试,我想模拟RestTemplate,因为我不想连接到外部服务 – 我知道期望的响应.我尝试在集成测试包中提供不同的实现,希望后者将覆盖实际的实现,但是反过来检查日志:真正的实现覆盖了测试.如何确保TestConfig中的那个是使用的?
这是我的配置文件:@Configuration
public class RestTemplateProvider {...
我尝试将地铁网络服务与春天融为一体.但是我在applicationContext.xml中遇到错误<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ws="http://jax-ws.dev.java.net/spring/core"xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www...