spring-integration

Spring integration outbound-gateway want to use URL as dynamic like

折月煮酒 提交于 2019-12-06 07:28:47
spring Integration,in outbound-gateway want to use URL as dynamic like <bean id="requestValues" class="com.src.model.RequestValues"/> <int-http:outbound-gateway request-channel="reqChannel" url="${UrlValue}" http-method="${reqmethod}" expected-response-type="java.lang.String" header-mapper="headerMapper" charset="UTF-8" reply-timeout="5000" reply-channel="responseChannel" > <int-http:uri-variable name="UrlValue" expression="#{requestValues.getUrl()}" /> <int-http:uri-variable name="reqmethod" expression="#{requestValues.getReqMethod()}" /> </int-http:outbound-gateway> Here Requestvalues is

outbound-gateway with Basic Authentication in spring-integration

喜夏-厌秋 提交于 2019-12-06 05:58:52
With spring-integration I would like to call an outbound-gateway with an Basic Authentication. I have something like this : <int-http:inbound-gateway id="versionRequestGateway" supported-methods="POST" request-channel="requestVersionChannel" reply-channel="requestTransformerVersionChannel" path="/consultersite" reply-timeout="10000" request-payload-type="java.lang.String"> </int-http:inbound-gateway> <int-http:outbound-gateway order="1" request-channel="requestVersionChannel" url-expression="@urlExpressionGateway.getUrlFor(payload) + '/consultersite'" reply-channel="responseVersionChannel"

File Inbound Channel unable to read file

旧巷老猫 提交于 2019-12-06 05:00:18
I use Spring Integration to process CSV files manually added to a folder. The beginning of my integration is : <bean id="recursiveScanner" class="org.springframework.integration.file.RecursiveLeafOnlyDirectoryScanner" /> <int-file:inbound-channel-adapter channel="filesIn" directory="file:${integration.directory}" scanner="recursiveScanner"> <int:poller id="poller" fixed-delay="${integration.delay}" /> </int-file:inbound-channel-adapter> Followed by custom service activators. When I move a small file (few megs) in the scanned directory it works perfectly, but when it's a big file (93 Mio) I get

Recommended approach for parallel spring batch jobs

守給你的承諾、 提交于 2019-12-06 04:29:05
The Spring Batch Integration documentation explains how to use remote chunking and partitioning for steps, see http://docs.spring.io/spring-batch/trunk/reference/html/springBatchIntegration.html#externalizing-batch-process-execution Our jobs do not consist of straightforward reader/processor/writer steps. So we want to simply have whole jobs running in parallel, with each job being farmed out to different partitions. Is there already a pattern for this in Spring Batch? Or would I need to implement my own JobLauncher to maintain a pool of slaves to launch jobs on? Cheers, Menno Spring Batch

Spring Integration Chain Flow - Handling Void Gateway Calls

瘦欲@ 提交于 2019-12-06 04:15:20
I have a spring integration flow that has a service activator call to a gateway service that has a void result and it seems to hang. It doesn't continue the rest of the chain. Do I need to specify something else to say I don't expect a result return from my gateway call to continue thread execution? I have a void method declaration. Service package foo; import org.springframework.messaging.handler.annotation.Header; import org.springframework.messaging.handler.annotation.Payload; public interface myService { void capitalString(String inputString ) ; } Spring Integration Flow <import resource=

Spring integration mail poller

懵懂的女人 提交于 2019-12-06 03:57:04
I want to configure a poller for my mail adapter, to run just once or run it programmatically. This is a standalone app (java -jar xxxx.jar) , so I think maybe one option is configure the fixed-rate attribute, to an arbitrary max value and then exit the application, ie: System.exit(0) . Are there more alternatives or some kind of 'correct approach', for this case? This is my integration-context.xml : <int-mail:inbound-channel-adapter id="imapAdapter" store-uri="imaps://${imap.user}:${imap.password}@${imap.server.ip}:${imap.server.port}/inbox" channel="receiveChannel" auto-startup="true" should

How to debug spring-integration

删除回忆录丶 提交于 2019-12-06 03:17:46
问题 We are quite happy with spring-integration except when things do not work as expected. Then it is really difficult to find out what is going on (we are using xml configuration). Can someone point me to the java components behind the spring integration components in order to debug them. For instance: If I have a headerValueRouter, where can I set a breakpoint to find out what is the actual value of the header inside the message, just before the component is doing the routing. Maybe there is

Spring integration: How processing files sequentially

泄露秘密 提交于 2019-12-06 02:50:18
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-messages-per-poll="1" /> </int-file:inbound-channel-adapter> the process of a file is file:inbound-channel

Need to process multiple files in parallel in Spring Integration

守給你的承諾、 提交于 2019-12-06 02:46:29
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).maxMessagesPerPoll(5))) .handle("mybean", "myMethod") .handle(Files.outboundAdapter(new File("success")))

How to read and process multiple files concurrently in spring?

徘徊边缘 提交于 2019-12-06 02:05:43
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 integration. Thank you. Add a task-executor to the poller; see the documentation . You can control the