spring-integration-dsl

Spring Integration DSL History issue

本小妞迷上赌 提交于 2020-01-14 02:59:17
问题 I have to setup the flows dynamically. Example: @Component @Slf4j public class FTPFlow { @Autowired private IntegrationFlowContext integrationFlowContext; @EventListener(ApplicationReadyEvent.class) public void setup(){ integrationFlowContext.registration(flow()).register(); } public IntegrationFlow flow() { DefaultFtpSessionFactory defaultFtpSessionFactory = new DefaultFtpSessionFactory(); defaultFtpSessionFactory.setHost("localhost"); defaultFtpSessionFactory.setPort(252);

Spring MVC Test - multipart POST json originalFilename is required

一世执手 提交于 2020-01-06 14:15:46
问题 I use spring-boot 2.0.3.RELEASE with junit5. I have just tried to test multipart request with mockMvc. MockMultipartFile file = new MockMultipartFile("file", "contract.pdf", MediaType.APPLICATION_PDF_VALUE, "<<pdf data>>".getBytes(StandardCharsets.UTF_8)); MockMultipartFile metadata = new MockMultipartFile("metadata", "", MediaType.APPLICATION_JSON_VALUE, objectMapper.writeValueAsString(metadata).getBytes(StandardCharsets.UTF_8)); this.mockMvc.perform(multipart("/documents") .file(file) .file

spring-integration: MessageProducer may only be referenced once

痴心易碎 提交于 2020-01-05 05:47:09
问题 I want to use a gateway in multiple flows. My gateway definition is: @Bean @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) public MarshallingWebServiceOutboundGateway myServiceGateway() { Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); marshaller.setPackagesToScan("blah.*"); MarshallingWebServiceOutboundGateway gateway = new MarshallingWebServiceOutboundGateway( serviceEndpoint, marshaller, messageFactory); gateway.setMessageSender(messageSender); gateway.setRequestCallback

Configure error handling and retry for Http.outboundGateway spring dsl

二次信任 提交于 2020-01-04 06:28:35
问题 I have a requirement where i need to make a rest call when it fails i have to retry 3 times and depending on the status code received i need perform different action, i couldn't find a proper spring integration dsl example. How to configure the error handler and retry @Bean public IntegrationFlow performCreate() { return IntegrationFlows.from("createFlow") .handle(Http.outboundGateway("http://localhost:8080/create") .httpMethod(HttpMethod.GET) .expectedResponseType(String.class)

Advice on Integration Flow Design

笑着哭i 提交于 2019-12-25 04:06:46
问题 I am planning to implement an integration flow as below: IntegrationFlows.from(httpInboundGateway) .transform(transformer-rest-api-1) .transform(transformer-rest-api-2) .handle(jdbc-outbound) .handle(http-outbound-gateway-1) .get(); The requirements that I want to fulfill are: to make this run in parallel threads as much as possible persist message at every end-point make very endpoint as rest-api (to make the flow scalable) Does it make any sense to make the flow reactive? If so how to go

Spring Integration Java DSL using JMS retry/redlivery

自古美人都是妖i 提交于 2019-12-25 02:22:06
问题 How can I effectively support JMS redelivery when msg handling throws an exception? I have a flow using JMS (ActiveMQ) with a connectionFactory that is configured to allow n redelivery attempts. I would like to have any error that occurs while handling the msg cause the msg to get put back for redelivery as many times as the connectionFactory config allows and then when max redelivery attempts are exhausted, deliver to DLQ. per usual with AMQ. An answer to a related SO question implies that I

TcpReceivingChannelAdapter vs TcpSendingMessageHandler

偶尔善良 提交于 2019-12-25 01:22:09
问题 Why channel can be set on TcpReceivingChannelAdapter , the inbound adapter, but not on TcpSendingMessageHandler , the outbound adapter? Why outbound adapter is called TcpSendingMessageHandler, why handler , not adapter? One would intuitively expects that inbound adapter and outbound adapter would be "mirrors" of each other, just with different directions. My question is variation of Spring Integration - Inbound vs Outbound Channel Adapters question, but focused on Spring Integration DSL API

Spring Integration redelivery via errorChannel throw with JmsTransactionManager doesnt honor maximumRedeliveries

安稳与你 提交于 2019-12-25 00:14:00
问题 Related to SO question: Spring Integration Java DSL using JMS retry/redlivery Using a transacted poller and JmsTransactionManager on a connectionFactory with maximumRedeliveries set to 3 results in a doubling of the actual redlievery attempts. How can I get this to honor the redelivery settings of the connection factory? My connectionFactory is built as: @Bean (name="spring-int-connection-factory") ActiveMQConnectionFactory jmsConnectionFactory(){ return buildConnectionFactory( brokerUrl,

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

Add adviceChain to StandardIntegrationFlow to set a CountDownLatch on a message handler

六眼飞鱼酱① 提交于 2019-12-13 19:12:07
问题 I´m trying to add a CountDownLatch to an org.springframework.integration.dsl.StandardIntegrationFlow in Spring Integration via an adviceChain and the BeanFactoryPostProcessor . The reason for this is to monitor, if the message handler within this integration flow was called and has finished his work or not. There is a solution without using the Java DSL of Spring Integration here: spring-integration unit test outbound-channel adapter. But sadly it´s not working for me because of the Java DSL