spring-integration

spring integration - read a remote file line by line

对着背影说爱祢 提交于 2019-12-02 09:12:44
I am trying to read a remote file line by line, using spring integration. Using the spring documentation found here I have set up my project to poll for the file and transfer it via sftp when it is found. I am stuck on how to go about reading the file contents one line at a time. Here is my inbound channel adapter setup that currently works to pull in files. <int-sftp:inbound-channel-adapter id="sftpAdapterAutoCreate" session-factory="sftpSessionFactory" channel="receiveChannel" filename-pattern="*.txt" remote-directory="/home/springftp" preserve-timestamp="true" local-directory="file:C:

How To get JMS Destination from WMQ

核能气质少年 提交于 2019-12-02 08:50:23
I am consuming a message from wmq using spring integration but i am not able to get JMS Destination in message header. I would want to know the queue name from where the message is consumed. In active mq we will be getting a parameter called JMS Destination where the queue name will be available. Is there a possiblity to find queue name from wmq using spring integration message. In Spring Integration, the JMSDestination is mapped to a header named jms_destination ( JmsHeaders.DESTINATION ). See Mapping Message Headers to/from JMS Message . The default mapper is the DefaultJmsHeaderMapper . 来源:

Beans not recognized from spring-context.xml while loading the XML file as a part of a (Spring Boot Application) jar file

随声附和 提交于 2019-12-02 08:31:08
I have an assignment wherein after creating a jar file using Spring Boot, I have to load it using URLClassLoader in a Java class to execute it. Issue is that although the jar file runs fine when launched directly but when I try to load it in a Java class using the following code, it fails. public static void main(String[] args) { // Getting the jar URL which contains target class URL[] classLoaderUrls = new URL[]{new URL("file:///C://Users\\CHH7KOR\\Documents\\POC\\BootDemo\\target\\BootDemo-0.0.1-SNAPSHOT.jar")}; // Create a new URLClassLoader URLClassLoader urlClassLoader = new

Having trouble handling exceptions in Spring Integration

馋奶兔 提交于 2019-12-02 08:12:30
问题 I'm new to spring integration and am confused about how to send error messages to a designated error queue. I want the error message to be a header on the original message and end up in a separate queue. I read that this can be done with a header enricher, which I tried to implement but nothing is showing up in the error queue. Also, do I need a separate exception handling class in order for the error messages to make it to the error queue or can I just throw exceptions in my transforming

Which library of spring should I use to send emails with multy-threading

邮差的信 提交于 2019-12-02 07:56:40
I have too many emails. I should write scheduler in order to send messages to them. Messages are different. I use spring framework 4.x. I can write simple class, which connects to SMTP server. But in this case I should write my thread library too in order to send emails parallel. Do spring have already written library which give me more flexible way to do this tasks? I do not want to use threads. It will be nice if spring already have this functionality. Do I need Spring integration for this? Best regards, Yes, you definitely can do that with Spring Integration, because there is an

SourcePollingChannelAdapter with Transaction

馋奶兔 提交于 2019-12-02 07:55:46
I would like to use a SourcePollingChannelAdapter with a transaction propagation REQUIRED when the polling is realized, to rollback all operations if an error is occured. The method setTransactionSynchronizationFactory is not commented... Thanks a lot for your help ! In XML I can do : <int:poller fixed-rate="5000"> <int:transactional transaction-manager="transactionManager" propagation="REQUIRED" /> </int:poller> I would like to use a transaction like this programmatically with a SourcePollingChannelAdapter and a PeriodicTrigger, but I don't know how. I have this : SourcePollingChannelAdapter

How to send asynchronous requests/responses through collaborating Channel Adapters without correlating data

試著忘記壹切 提交于 2019-12-02 07:32:57
Summary I'm using Spring Integration's TCP & UDP Support to proxy TCP stream traffic through my application to an upstream server, and then proxy that server's response back through my application to the client. Although this is two-way communication, I need high-volume, asynchronous throughput, so I can't use Gateways. Instead, I am trying to use Collaborating Outbound and Inbound Channel Adapters as described in section 34.8.2. Integration Component Setup Request A TcpReceivingChannelAdapter receives requests via a TcpNetServerConnectionFactory on port 6060. It places these requests on a

RequestHandlerRetryAdvice cannot be made to work with Ftp.outboundGateway in Spring Integration

半世苍凉 提交于 2019-12-02 06:38:02
My situation is similar to the one described in this SO question . The difference being that I don't use a WebFlux.outboundGateway but an Ftp.outboundGateway on which I call an AbstractRemoteFileOutboundGateway.Command.GET command, the common problem being that I can't get the defined RequestHandlerRetryAdvice to be used. The configuration looks like this (stripped down to the relevant parts): @RestController @RequestMapping( value = "/somepath" ) public class DownloadController { private DownloadGateway downloadGateway; public DownloadController( DownloadGateway downloadGateway ) { this

message-driven-channel-adapter drops first message after app context startup unless send is called with a delay

六月ゝ 毕业季﹏ 提交于 2019-12-02 06:37:06
I have an integration test for my Spring Integration config, which consumes messages from a JMS topic with durable subscription. For testing, I am using ActiveMQ instead of Tibco EMS. The issue I have is that I have to delay sending the first message to the endpoint using a sleep call at the beginning of our test method. Otherwise the message is dropped. If I remove the setting for durable subscription and selector, then the first message can be sent right away without delay. I'd like to get rid of the sleep, which is unreliable. Is there a way to check if the endpoint is completely setup

Spring int-xml:xpath-expression erros with node function

老子叫甜甜 提交于 2019-12-02 05:37:29
I used XMLSpy to write the following XPath to determine the longest string length and it works in XMLSpy: string-length(//exception:ElementMessageAbcException/@exceptionMsg[not(string-length(.) < //exception:ElementMessageAbcException/@exceptionMsg/string-length(.))] ) But when I put the same string into a xpath-expression in spring integration it errors: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xpathMaxLengthExceptionMsg': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory