spring-integration

Spring Integration - Filter - Send messages to a different end point

别来无恙 提交于 2019-12-24 20:18:40
问题 My input is a csv file as given below: USER_ID, USER_NAME, FREQUENCY, FREQUENCY_DETAIL A123, AAA, ANNUALLY, 1-JUN B123, BBB, INVALID_FREQUENCY, 21-JUN C123, CCC, ANNUALLY, APR D123, DDD, WEEKLY, 1-DEC Validations: USER_ID -> alphanumeric USERNAME -> alphabets only FREQUENCY -> must be one of DAILY, WEEKLY, MONTHLY , ANNUALLY FREQUENCY DETAIL -> Pattern \\d{1,2}-\\w{3} My Bean is as follows: class UserBean { String userID; String userName; String frequency; String frequencyDetail; String

Call REST webservice using Spring Integration and Oauth

北城以北 提交于 2019-12-24 18:43:57
问题 My goal is to perform a call to a REST webservice using an outbound gateway, this webservice needs a token provided by another web service. I've tried using Spring oauth without any luck since I am not sure how to integrate both frameworks. <int:chain input-channel="requestChannel"> <int-http:outbound-gateway url="https://webservice.url/..." http-method="GET" expected-response-type="java.lang.String" rest-template="restTemplate" /> ... </int:chain> <oauth:resource id="oauth1" client-id="admin

Message persistence in Spring Integration Aggregator without MessageStore by using AMQP?

早过忘川 提交于 2019-12-24 18:23:35
问题 I would like to know if I can have persistence in my Spring Integration setup when I use a aggregator, which is not backed by a MessageStore, by leveraging the persistence of AMQP (RabbitMQ) queues before and after the aggregator. I imagine that this would use ack's: The aggregator won't ack a message before it's collected all the parts and sent out the resulting message. Additionally I would like to know if this is ever a good idea :) I am new working with queue's, and am trying to get a

how to define multiple sftp connections?

这一生的挚爱 提交于 2019-12-24 17:25:24
问题 I'm trying to use the outbound gateway to download files from multiple sftp servers, the number of sftp server is configured in properties(which means that i need to define the connection dynamically), my application.properties: sftp.host=host1,host2 sftp.user=user1,user2 sftp.pwd=pwd1,pwd2 current I use the java config as: @Configuration public class SFtpConfig { static Logger logger = LoggerFactory.getLogger(SFtpConfig.class); @Autowired SftpServerProperties sftpServerProperties; @Autowired

Flow with multiple outbound HTTP calls

放肆的年华 提交于 2019-12-24 17:18:09
问题 We have a shopping cart domain model with line items. Externally, we have a single API to checkout the shopping cart. Internally though, we have 3 distinct HTTP services: Create shopping cart Add line item(s) - one HTTP call per line item Checkout We'd like to express this in an integration flow, aborting if any of the steps fail or timeout. Here is some pseudo code for the flow: @Bean public IntegrationFlow cartFlow() { return IntegrationFlows.from(channel()) .transform(fromJson(ShoppingCart

Implementing a MongoDB Inbound Flow with Spring Integration

帅比萌擦擦* 提交于 2019-12-24 17:11:52
问题 We will have a Mongo collection contain multiple units of work. My idea is that the document will have a status field with four options: UNPROCESSED, PROCESSING, DONE, FAILED. Spring Integration will be configured to read from this db and process the messages stored there. An inbound Mongo DSL flow will read from the collection based on a value of UNPROCESSED: MongoDbMessageSource messageSource = new MongoDbMessageSource(mongo, new LiteralExpression("{'status' : 'UNPROCESSED'}")); return

Spring message-driven-channel-adapter: handling connection refused error

天大地大妈咪最大 提交于 2019-12-24 16:35:22
问题 I want to configure my message-driven-channel-adapter in such a way that I can grab the 'connection refused' error in case when: 1) the message broker is down or 2) A wrong broker URL is specified I tried doing this with the code below but it did not work: <int:channel id="invalidChannel" /> <int-mqtt:message-driven-channel-adapter id="myAdapter" client-id="${inbound.client.id}" url="${host.url}" topics="${inbound.topic}" channel="incomingChannel" error-channel="errorChannel" client-factory=

Spring integration DSL running Sftp OutBound flow from Main class

烈酒焚心 提交于 2019-12-24 16:27:06
问题 I have created two integration flow, one is File inbound flow which is lookup my local directory and other one is Sftp outbound flow which is send those files from local to remote directory. I am running these flows from Main class i.e without using the Junit. So how cound I send message from File Inbound flow to Sftp outblound flow. in Junit Test method I can use send() method for file transferring but in this case not able to send the files. So can any one help me as I am not able to

Spring Batch - web service to web service chunking

时间秒杀一切 提交于 2019-12-24 15:50:37
问题 I have a web service hosted which allows to pull records in batch. This web service takes starting record number (ROWID) and page size(800 max) as parameters. There could be 50-60k records to pull from this service and call another web service to post all these data again in chunk without persisting data in between. How could I use Spring Batch to pull the records page by page (chunking) by calling web service and how do I post same records to another web service. I was able to do this using

Partitioned jobs using reply destination

邮差的信 提交于 2019-12-24 14:16:22
问题 We have a JEE app that uses about 40 partitioned jobs on a cluster. It can be deployed on both JBoss and WebSphere. We are experiencing 2 problems: messaging system failures in both JBoss and WebSphere typically related to temporary queue connection problems partitioned jobs effectively hung because of lost messages. I read a posting that switching the reply-destination of the outbound-gateway can improve robustness and allow for re-connection in the case of failures. The inbound-gateway