spring-integration

Polling S3 bucket for files and processing using spring integration aws

别来无恙 提交于 2019-12-05 23:13:38
I need to poll a S3 bucket for files and pick them up and process them as soon as any file becomes available. I need to do this using Spring Integration and spring-integration-aws. So the code i have so far looks like this: public AmazonS3 amazonS3 = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretKey));`enter code here` @Bean public S3InboundFileSynchronizer s3InboundFileSynchronizer() { S3InboundFileSynchronizer synchronizer = new S3InboundFileSynchronizer(amazonS3); synchronizer.setDeleteRemoteFiles(true); synchronizer.setPreserveTimestamp(true); synchronizer.setRemoteDirectory

Spring Integration JDBC inbound poller Java Based Configuration

我与影子孤独终老i 提交于 2019-12-05 23:08:28
I want to configure an Inbound pooler with Spring Integration JDBC. So far I have found xml configuration but I want to implement in java configuration. I want to continuously check for changes in db table and I think this is achievable with Spring Integration JDBC. My Db is in different Docker Container and my Application (Spring Boot) is in different Docker Container. I Can not use Hibernate Interceptor here because some other application will edit table. Not sure what resources have you investigated, but we have on first pages of our official Reference Manual this sample: @Bean

Spring Integration - IBM MQ - Consuming large messages from Queue

萝らか妹 提交于 2019-12-05 22:29:08
We are using spring integration to connect to IBM MQ V7.5 to read messages from queue. We occasionally get large messages to read. SI jms adapter fails to read to large message, but it works for smaller messages. Below is the exception we are getting 23:18:35,470 WARN DefaultMessageListenerContainer:839 - Setup of JMS message listener invoker failed for destination 'queue:///Cis.Orders' - trying to recover. Cause: JMSWMQ2002: Failed to get a message from destination 'XXX'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '1' ('MQCC_WARNING')

Group received messages in RabbitMQ, preferably using Spring AMQP?

会有一股神秘感。 提交于 2019-12-05 19:57:55
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 database. So in this example there would be two writes to the database but if I could batch messages for

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

别等时光非礼了梦想. 提交于 2019-12-05 19:33:58
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 whenever I tried to execute my application as a packaged jar (on my local machine) I did a small "sample

Spring Integration Kafka Consumer Listener not Receiving messages

心不动则不痛 提交于 2019-12-05 14:58:01
问题 According to the documentation provided here, I am trying on a POC to get messages into a listener as mentioned in the the same documentation, Below is how I have written the configuration. @Configuration public class KafkaConsumerConfig { public static final String TEST_TOPIC_ID = "record-stream"; @Value("${kafka.topic:" + TEST_TOPIC_ID + "}") private String topic; @Value("${kafka.address:localhost:9092}") private String brokerAddress; /* @Bean public KafkaMessageDrivenChannelAdapter<String,

Dynamic TCP Server with Spring Integration using Java DSL

偶尔善良 提交于 2019-12-05 14:25:59
I am trying to create a TCP server and client by reading the property files which contains the detail of the connections. I am using Dynamic and runtime Integration Flows with the help of following reference document ( 9.20 Dynamic and runtime Integration Flows) The code is working fine while creating the client but when I am creating the server using the same with changes in the code as follow: IntegrationFlow flow = f -> f .handle(Tcp.inboundAdapter(Tcp.netServer(2221) .serializer(TcpCodecs.crlf()) .deserializer(TcpCodecs.lengthHeader1()) .id("server"))) .transform(Transformers

Spring Integration DSL - Outbound Gateway with access to Headers

早过忘川 提交于 2019-12-05 12:51:48
I'm having an issue with Spring Integration. I'm using Spring Boot 1.4.0.RELEASE, Spring Integration 4.3.1.RELEASE, Spring Integration DSL 1.2.0.M1. What I'm trying to do: I'm writing an application that will read files from FTP and local file system (using inbound channel adapters), transfer the files to a local working directory (using file outbound gateways), process, then move them to a final destination (file outbound gateway/adapters). EDIT: The original issue stemmed from incorrect usage of the OutboundGateway . For details of what I was doing wrong, look at the edit history. I'm having

Automatic retry connection to broker by spring-rabbitmq

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 11:48:46
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. Spring AMQP now uses the 4.0.x version of amqp-client, which has auto recovery enabled by default. Spring

Spring integration: how to handle exceptions in services after an aggregator?

人盡茶涼 提交于 2019-12-05 10:13:06
I have an application relying on Spring Integration (4.0.4.RELEASE) and RabbitMQ. My flow is as follow: Messages are put in queue via a process (they do not expect any answer): Gateway -> Channel -> RabbitMQ And then drained by another process: RabbitMQ --1--> inbound-channel-adapter A --2--> chain B --3--> aggregator C --4--> service-activator D --5--> final service-activator E Explanations & context The specific thing is that nowhere in my application I am using a splitter: aggregator C just waits for enough messages to come, or for a timeout to expire, and then forwards the batch to service