spring-integration

Consuming from Kafka failed Iterator is in failed state

假如想象 提交于 2019-12-01 09:35:45
I am getting exception while consuming the messages from kafka. org.springframework.messaging.MessagingException: Consuming from Kafka failed; nested exception is java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Iterator is in failed state I have one consumer in the application context with one outbound adapter. Consumer configuration in application context <int-kafka:consumer-context id="consumerContext" consumer-timeout="4000" zookeeper-connect="zookeeperConnect"> <int-kafka:consumer-configurations> <int-kafka:consumer-configuration group-id="GR1" value-decoder=

Spring Integration / JSch: Auth fail

心不动则不痛 提交于 2019-12-01 08:43:49
问题 I'm trying to use Spring Integration's SFTP Inbound Channel Adapter, but I'm stuck here: 20:29:30,458 INFO [com.jcraft.jsch] (task-scheduler-6) Connecting to deployment port 22 20:29:30,484 INFO [com.jcraft.jsch] (task-scheduler-6) Connection established 20:29:30,514 INFO [com.jcraft.jsch] (task-scheduler-6) Remote version string: SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1 20:29:30,514 INFO [com.jcraft.jsch] (task-scheduler-6) Local version string: SSH-2.0-JSCH-0.1.45 20:29:30,514 INFO [com.jcraft

How to decompress a Flux<DataBuffer> (and how to write one)?

丶灬走出姿态 提交于 2019-12-01 08:17:29
I have a requirement to read and write compressed (GZIP) streams without intermediate storage. Currently, I'm using Spring RestTemplate to do the writing, and Apache HTTP client to do the reading (see my answer here for an explanation of why RestTemplate can't be used for reading large streams). The implementation is fairly straightforward, where I slap a GZIPInputStream on the response InputStream and move on. Now, I'd like to switch to using Spring 5 WebClient (just because I'm not a fan of status quo). However, WebClient is reactive in nature and deals with Flux<Stuff> ; I believe it's

Kafka Spring Integration: Headers not coming for kafka consumer

烈酒焚心 提交于 2019-12-01 04:50:42
问题 I am using Kafka Spring Integration for publishing and consuming messages using kafka. I see Payload is properly passed from producer to consumer, but the header information is getting overridden somewhere. @ServiceActivator(inputChannel = "fromKafka") public void processMessage(Message<?> message) throws InterruptedException, ExecutionException { try { System.out.println("Headers :" + message.getHeaders().toString()); } } catch (Exception e) { e.printStackTrace(); } } I get following headers

How to create a Spring Reactor Flux from a ActiveMQ queue?

青春壹個敷衍的年華 提交于 2019-12-01 03:16:01
I am experimenting with the Spring Reactor 3 components and Spring Integration to create a reactive stream (Flux) from a JMS queue. I am attempting to create a reactive stream (Spring Reactor 3 Flux) from a JMS queue (ActiveMQ using Spring Integration) for clients to get the JMS messages asynchronously. I believe that I have everything hooked up correctly but the client does not receive any of the JMS messages until the server is stopped. Then all of the messages get "pushed" to the client a once. Any help would be appreciated. Here is the configuration file that I am using to configure the

Spring integration for sftp

一个人想着一个人 提交于 2019-12-01 01:12:29
How can I move file from local system to remote FTP using SFTP adapter. I am going through the examples and all are mentioning to copy files from remote FTP to local machine. I need to move files from local machine to remote system folder. <?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:int="http://www.springframework.org/schema/integration" xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp" xmlns:file="http://www.springframework.org/schema/integration/file" xsi

Spring Integration - programmatically create / teardown channels

时光总嘲笑我的痴心妄想 提交于 2019-12-01 00:45:09
Is it possible to programmatically create / teardown Spring Integration channels, as opposed to declaring them statically in Spring config? My situation is this: I have a webapp that requires push notifications, so I'm using long polling. Those long polling calls need to block on the server until they get an event. What I'm envisioning (open to alternatives, of course), is a Spring Integration queue channel for each session , each listening to a single pubsub channel. So, when a server event happens it will be published to the pubsub, which will then pipe down to the individual session queues

How to create a Spring Reactor Flux from a ActiveMQ queue?

五迷三道 提交于 2019-12-01 00:24:30
问题 I am experimenting with the Spring Reactor 3 components and Spring Integration to create a reactive stream (Flux) from a JMS queue. I am attempting to create a reactive stream (Spring Reactor 3 Flux) from a JMS queue (ActiveMQ using Spring Integration) for clients to get the JMS messages asynchronously. I believe that I have everything hooked up correctly but the client does not receive any of the JMS messages until the server is stopped. Then all of the messages get "pushed" to the client a

Moving processed files in remote S(ftp) using Java DSL

主宰稳场 提交于 2019-12-01 00:15:33
I'm trying to move files on remote SFTP once the batch has successfully processed the files using Spring integration and Java DSL. What would be the best way to achieve that? Adding a step in batch to move remote files ? Or using FTP Outbound Gateway and provide the MV command ? I tend to prefer the second solution and let the batch focus on the logic only, but I've hard times trying to implement it with java dsl. I've read http://docs.spring.io/spring-integration/reference/html/ftp.html#ftp-outbound-gateway and tried to implement like that : @Bean public MessageHandler ftpOutboundGateway() {

Spring Integration Control Bus configuration via annotations

两盒软妹~` 提交于 2019-11-30 21:13:48
Just a simple question: Is there any way to configure Spring Integration Control Bus via annotations (without any xml) <control-bus input-channel="operationChannel"/> ? @Bean @ServiceActivator(inputChannel = "controlBusChannel") public ExpressionControlBusFactoryBean controlBus() throws Exception { ExpressionControlBusFactoryBean controlBus = new ExpressionControlBusFactoryBean(); return controlBus; } Note that any outputChannel on the annotation will be ignored; it is defined on the bus itself. Typically the output channel of a control bus is omitted with the result of normal request/reply