spring-integration

How can I set default outgoing port and listening port on spring integration?

不羁岁月 提交于 2019-12-11 19:39:57
问题 How can I set default outgoing port and listening port for the reply on spring integration? Is it possible? I want to do that with tcp technology. Here is my code: <int-ip:tcp-connection-factory id="client" type="client" host="${netSocketServer}" port="${netPort}" single-use="true" so-timeout="${netSoTimeOut}" /> <int:channel id="input" /> <int-ip:tcp-outbound-gateway id="outGateway" request-channel="input" reply-channel="reply" connection-factory="client" request-timeout="${netRequestTimeout

Echo socket service in Spring Integration DSL using Channels and Gateways

筅森魡賤 提交于 2019-12-11 19:15:51
问题 This is variant of my question How to implement simple echo socket service in Spring Integration DSL. A good working solutions was introduced but I would like to explore alternatives. Particularly I am interested in solution based on using inbound and outbound channels explicitly, in client and server implementations. Is that possible? So far I was able to come up with: HeartbeatClientConfig ... @Bean public IntegrationFlow heartbeatClientFlow( TcpNetClientConnectionFactory

Accessing Spring bean from different HTTP request

痴心易碎 提交于 2019-12-11 19:04:31
问题 I now know how to manually start and stop a channel adapter thanks to Gary Russells answer to my previous question on SO: Spring Integration manually start/stop channel adapter via control bus My application is now running as a servlet on a tomcat. Now, is there anyway to stop a channel from a request other than the request that started this channel? I am not sure about the scope issue, but it seemes to me, like if each request is creating a new gateway, and therefore me issuing a "stop"

Timeout waiting for connection from pool while polling S3 for Objects

别说谁变了你拦得住时间么 提交于 2019-12-11 18:45:15
问题 I am working on a backend service which polls S3 bucket periodically using spring aws integration and processes the polled object from S3. Below is the implementation for it @Configuration @EnableIntegration @IntegrationComponentScan @EnableAsync public class S3PollerConfiguration { //private static final Logger log = (Logger) LoggerFactory.getLogger(S3PollerConfiguration.class); @Value("${amazonProperties.bucketName}") private String bucketName; @Bean @InboundChannelAdapter(value =

Sidekiq-like queue using java tools?

こ雲淡風輕ζ 提交于 2019-12-11 17:39:13
问题 I want to have a work queue that behaves almost exactly like ruby's sidekiq(it doesn't need to use Redis, but it can - I just can't use ruby - not even Jruby). Basically I want to be able to create jobs that runs with some parameters and a worker pool executes the jobs. The workers are going to use hibernate to do some work, so I think that Spring integration could make things easier. 回答1: Spring Integration has Redis Queue inbound and outbound channel adapters. The inbound message-driven

How to pass header using wireTap?

主宰稳场 提交于 2019-12-11 17:18:54
问题 Now I have following flow: flow -> flow.channel(some_channel()) ..... .gateway(anotherFlow, idempotentByHeader(OBJECT_ID_HEADER)); Consumer<GatewayEndpointSpec> idempotentByHeader(String objectIdHeader) { return endpointSpec -> endpointSpec.advice(idempotentByHeaderInterceptor(objectIdHeader)).errorChannel(errorChannel()); } default IdempotentReceiverInterceptor idempotentByHeaderInterceptor(String header) { MessageProcessor<String> headerSelector = message -> headerExpression(header).apply

Int:Splitter is not sending messages to channels to invoke them

…衆ロ難τιáo~ 提交于 2019-12-11 17:12:34
问题 I am trying send message from int-file:inbound-channel-adapter to int-ftp:outbound-channel-adapter for moving file to remote directory and int-ftp:outbound-gateway to delete file in remote directory. Now int-file:inbound-channel-adapter polls and sends message to int-ftp:outbound-channel-adapter and when it polls second time sends message to int-ftp:outbound-gateway. By using int:splitter i am still able to receive single message for single file and only one channel is getting invoke. I want

rabbitmq channel shutdown with PRECONDITION_FAILED - fast reply consumer does not exist

核能气质少年 提交于 2019-12-11 16:59:11
问题 We are getting the below error when we are posting a message to rabbitmq from a spring boot service. Also this is intermittent and we are not able to reproduce this. [AMQP Connection 123.11.xxx.xx:5672] ERROR [] org.springframework.amqp.rabbit.connection.CachingConnectionFactory - Channel shutdown: channel error; protocol method: #method(reply-code=406, reply-text=PRECONDITION_FAILED - fast reply consumer does not exist, class-id=60, method-id=40) Does anyone faced similar issue with rabbitmq

Can't remove file from batch listener on Windows? (The process cannot access the file because it is being used by another process)

一曲冷凌霜 提交于 2019-12-11 16:32:02
问题 I created simple job which reads all files from folder( D:\\chunk ), does empty procesing and empty writing and I registered listener to remove file after processing. On Windows(On Linux and MacOs it does not happen) mashine I experince following error: 2019-09-09 12:08:13.752 WARN 4028 --- [ main] c.b.m.b.RemovingListener : Failed to remove chunk 0b9a2623-b4c3-42b2-9acf-373a2d81007c.csv java.nio.file.FileSystemException: D:\chunk\1.csv: The process cannot access the file because it is being

maprsteam with spring integration java client

余生颓废 提交于 2019-12-11 16:30:15
问题 I am looking for a solution to use maprstream with spring integration. I could able to create the stream and topic and also could able to consume/publish messages using stream:topic combination. Used the Kafka client by referring the link: But struggling to consume/publish message using Spring integration and couldn't see any sample programs explaining the same. Can someone please help me on this? 回答1: spring-integration-kafka 2.0 (via spring-kafka 1.0) uses the 0.9 Kafka API. See the