spring-integration

Using spring integration IMAP adapter, how to fetch an email which was marked “unread” manually?

夙愿已清 提交于 2019-12-18 08:26:36
问题 I have a piece of code which uses spring integration's IMAP adapter to poll an inbox to read all incoming emails which are unread and that works perfectly. But if I open any email message and and then mark it as "unread" in my outlook inbox the poller doesn't fetch the marked email. I can use the pop3 adapter which fetches all the email, but deletes them afterwords, but I want to keep the emails in my inbox and I want the poller to fetch all the email which are unseen. Any suggestions to

How can @MessagingGateway be configured with Spring Cloud Stream MessageChannels?

烂漫一生 提交于 2019-12-18 06:23:10
问题 I have developed asynchronous Spring Cloud Stream services, and I am trying to develop an edge service that uses @MessagingGateway to provide synchronous access to services that are async by nature. I am currently getting the following stack trace: Caused by: org.springframework.messaging.core.DestinationResolutionException: no output-channel or replyChannel header available at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler

Spring Batch : How to use spring batch to read file from sftp server and save it into database?

蹲街弑〆低调 提交于 2019-12-18 05:07:07
问题 My current project is based on Spring Batch and Spring integration. My goal is using Spring Batch to execute job flow steps: read file from SFTP server(step1). decrypt the file(step2). save the file into database(step3). I want to divide this into steps queue(read from sftp, decrypt, write to db). And I also need to save the file, transfer start time, transfer end time, file size into DB. Some days ago, I used Spring integration to poll file from sftp server and then send it to Spring batch

Read one record/item and write multiple records/items using spring batch

筅森魡賤 提交于 2019-12-17 19:27:47
问题 I did some searching but couldn't find any sample/example. I've a requirement where geo coordinates from one table (input) are read, processed to generate POI's associated to coordinate. So one geo coordinate will result in one or more POI's that needs to be inserted into another table (output). I'm currently using a JdbcCursorItemReader and JdbcBatchItemWriter to read one item/record and write one item/record. There is also an ItemProcessor that generates the POI's for a give geo coordinate.

Spring Integration manually start/stop channel adapter via control bus

这一生的挚爱 提交于 2019-12-17 16:36:15
问题 Is there anyway to manually start/init a channel adapter? I have two pairs of inbound/outbound adapters in my context.xml and would like to decide at runtime which one of them I want to get started. EDIT: The concrete scenario: I have a client, that can be configured at runtime to be an mqtt publisher or subscriber. My context.xml looks like this: <int-mqtt:message-driven-channel-adapter client-id="foo" auto-startup="true" url="tcp://192.168.97.164:1883" topics="testtopic/#" channel=

spring integration + cron + quartz in cluster?

可紊 提交于 2019-12-17 09:51:11
问题 I have a spring integration flow triggered by the cron expression like follows: <int-ftp:inbound-channel-adapter id="my-input-endpoint" ...> <int:poller trigger="my-trigger"/> </int-ftp:inbound-channel-adapter> <bean id="my-trigger" class="org.springframework.scheduling.support.CronTrigger"> <constructor-arg value="0 * * * * *" /> </bean> It works fine. But now I have to extend the implementation to make it cluster ready (job execution on only one cluster node at the same point of time). My

Spring Integration - Failing to Retrieve Oracle Array OUT PARAM

╄→尐↘猪︶ㄣ 提交于 2019-12-14 03:49:02
问题 Description : Attempting to create a gateway service call that returns a oracle array type. Specially getting the sys.dbmsoutput_linesarray. The error I get below seems that I have something wrong on my configuration when I register the OUT param or possibly in the service. Wondering if someone can tell me what I am doing wrong? Error Message: CallableStatementCallback; uncategorized SQLException for SQL [{call GET_DBMS_OUTPUT(?)}]; SQL state [99999]; error code [17004]; Invalid column type:

Spring Integration - Parallel ordered processing

雨燕双飞 提交于 2019-12-14 03:02:23
问题 In the application i work on, there is a continuous flow of messages coming from a TCP socket. Messages have different types. Different types of messages should be processed in parallel. But each specific type of message must be processed in the order they come in. I used ExecutorChannel from spring integration and it solves parallel processing need. I created a channel for each specific type of message. But i cannot guarantee ordered processing of messages for specific types. Is there a way

AllowAllHostnameVerifier for HTTPS in Spring Integration XML

狂风中的少年 提交于 2019-12-14 02:34:58
问题 I am trying to make an HTTPS REST call using Spring Integration, below is my configuration. <int-http:outbound-gateway id="Auth Outbound Gateway" request-channel="RequestChannel" request-factory="sslFactory" header-mapper="headerMapper" url="https://XX.XX.XX.XXX:XXXX/abcd" http-method="POST" expected-response-type="java.lang.String"> </int-http:outbound-gateway> <bean id="sslFactory" class="org.springframework.http.client.HttpComponentsClientHttpRequestFactory"> <constructor-arg ref=

Spring Integration HTTP request throttling

北战南征 提交于 2019-12-13 21:28:25
问题 Looking to implement http request throttle limits and wondering if Poller is the option or should Interceptor be used? The idea is have a rule of "X number of requests/operations in Y amount of time" and it should work across the cluster. 回答1: It depends on what you want to do to the throttled caller; throw an exception (after some timeout) or wait forever. Using a queue channel after the gateway (with a limit and a send-timeout on the gateway) would work, and throw an exception if the time