spring-integration

Group received messages in RabbitMQ, preferably using Spring AMQP?

江枫思渺然 提交于 2019-12-07 15:39:45
问题 I'm receiving messages from a service (S) that publishes each individual property change to an entity as a separate message. A contrived example would be an entity like this: Person { id: 123 name: "Something", address: {...} } If name and address are updated in the same transaction then (S) will publish two messages, PersonNameCorrected and PersonMoved . The problem is on the receiving side where I'm storing a projection of this Person entity and each property change causes a write to the

Handle expected return from Spring Integration File

陌路散爱 提交于 2019-12-07 15:28:34
I have the following configuration file for Spring Integration File: @Configuration @EnableIntegration public class MyIntegrationConfiguration { private static final String FILE_CHANNEL_PROCESSING = "processingfileChannel"; private static final String INTERVAL_PROCESSING = "5000"; private static final String FILE_PATTERN = "*.txt"; @Value("${import.path.source}") private String sourceDir; @Value("${import.path.output}") private String outputDir; @Bean @InboundChannelAdapter(value = FILE_CHANNEL_PROCESSING, poller = @Poller(fixedDelay = INTERVAL_PROCESSING)) public MessageSource<File>

Spring Batch with multi tenancy

心已入冬 提交于 2019-12-07 15:24:55
问题 How do we define spring batch jobs to run against multiple tenants? I have setup to run a sequence of jobs in order every night against one database schema currently. All the jobs currently read files from a location and insert to database.The batch configuration was very basic where I defined a data-source, transaction manager and mapped job-repository to it. My jobs will point to this repository and transaction manager. Also I am currently persisting batch meta data information in database.

How to read and process multiple files concurrently in spring?

陌路散爱 提交于 2019-12-07 14:28:00
问题 I am new to Spring framework and I am doing one simple project using spring and got stuck in between. In my project I am reading the file from directory using spring poller. And then processing that file through various channels and sending it to the queue. But problem is that "file-inbound-channel-adapter" (which I'm using ) is reading only one file at a time. So I need a solution which will read and process multiple files at a time. Is there any way to implement multithreading in spring

Spring integration: How processing files sequentially

别等时光非礼了梦想. 提交于 2019-12-07 13:54:58
问题 I use "int-file: inbound-channel-adapter" to load files which exist into a directory. And i like to process files sequentially: it means that when the processing of the first file is completed, I load the second file ...etc. I see a sample but I can't forcast the needed period to processing one file which depends on its size. My source code: <int-file:inbound-channel-adapter directory="${directory.files.local}" id="filesIn" channel="channel.filesIn"> <int:poller fixed-delay="1000" max

Need to process multiple files in parallel in Spring Integration

你离开我真会死。 提交于 2019-12-07 13:41:35
问题 I have a SFTP directory and reading files and sending the files for further processing to a ServiceActivator.At any point I need to process them parallely using the handler. Here is my SPring Integration java DSL flow. IntegrationFlows.from(Sftp.inboundAdapter(getSftpSessionFactory()) .temporaryFileSuffix("COPY") .localDirectory(directory) .deleteRemoteFiles(false) .preserveTimestamp(true) .remoteDirectory("remoteDir")) .patternFilter("*.txt")), e -> e.poller(Pollers.fixedDelay(500)

Making SFTP outbound gate way pollable for mput operation

最后都变了- 提交于 2019-12-07 12:44:29
I am using spring integration for SFTP operation. I need to poll the files with directory structure from a certain location of SFTP and also put files with directory structure from local directory to certain SFTP location. I have added faking inbound channel adapter fro mget & mput opeation. While running Junit , some junk message files are generated in target SFTP location of mput operation. And ,after war is deployed no file is getting transferred to mget local directory. The mput and mget operation will started once war is deployed in server Please advice the configuration. This queston is

Spring Integration application does not define channels when executed as packaged jar

拜拜、爱过 提交于 2019-12-07 12:41:41
问题 I started to use Spring Integration in a project at work. Everything was looking fine and running smoothly on my local dev environment (when executed from Eclipse). However, when I tried to deploy to our dev/staging environment I got some issues related with the definition of the Spring Integration channels. After a couple of hours completely clueless (blaming external dependencies, our development/staging environment setup etc etc), I came to realize that I would get exactly the same issue

NoUniqueBeanDefinitionException in Spring annotation driven configuration

瘦欲@ 提交于 2019-12-07 10:39:04
问题 I am getting the following error when trying to autowire two beans using No qualifying bean of type [javax.jms.ConnectionFactory] is defined: expected single matching bean but found 2: aConnectionFactory, bConnectionFactory Description: Parameter 1 of method jmsListenerContainerFactory in org.springframework.boot.autoconfigure.jms.JmsAnnotationDrivenConfiguration required a single bean, but 2 were found: - aConnectionFactory: defined by method 'aConnectionFactory' in package.Application -

Automatic retry connection to broker by spring-rabbitmq

孤者浪人 提交于 2019-12-07 08:20:27
问题 I have read this fragment of docs: RabbitMQ Automatic Connection/Topology recovery Since the first version of Spring AMQP, the framework has provided its own connection and channel recovery in the event of a broker failure. Also, as discussed in Section 3.1.10, “Configuring the broker”, the RabbitAdmin will re-declare any infrastructure beans (queues etc) when the connection is re-established. It therefore does not rely on the Auto Recovery that is now provided by the amqp-client library.