spring-integration-http

Spring Integration HTTP Outbound Gateway header not forwarder on a consecutive request

情到浓时终转凉″ 提交于 2021-01-28 11:14:33
问题 I'm struggling with the following flow: .enrichHeaders(h -> h.headerFunction("ocp-apim-subscription-key", m -> "xxx")) .handle(Http.outboundGateway("https://northeurope.api.cognitive.microsoft.com/vision/v3" + ".0/read/analyzeResults/abc") .mappedRequestHeaders("ocp-apim-subscription-key") .httpMethod(HttpMethod.GET)) .enrichHeaders(h -> h.headerFunction("ocp-apim-subscription-key", m -> "xxx")) .handle(Http.outboundGateway("https://northeurope.api.cognitive.microsoft.com/vision/v3" + ".0

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 fetch paginated results from a REST service

前提是你 提交于 2020-01-03 01:55:29
问题 I'm working on an integration with a REST service, the idea is that it's polled by an outbound gateway marketingCategoryOutboundGateway implemented by HttpRequestExecutingMessageHandler . The gateway makes a request to the REST service and pushes its response to the marketingCategory channel. The gateway itself is triggered by a message created by marketingCategoryPollerMessageSource using the makeTriggeringMessage factory method. The problem is that the service returns paginated results. I

Http inbound adapter gives empty response on OPTIONS request under CORS

感情迁移 提交于 2019-12-24 07:38:50
问题 In my development environment I'm using two separate technology stacks for the frontend and the backend: React + webpack-dev-server for the frontend, served at localhost:8081 Spring for the backend, serving HTTP endpoints over localhost:7080 , in two ways: using integration for the data processing (reception, transformation and storage), this processing starts at an http:inbound-channel-adapter (see the following XML configuration) using MVC to provide a read-only (i.e. GET-only) access

Spring integration DSL Scatter-Gather async/parallel execution for multiple recipientFlows

旧巷老猫 提交于 2019-12-13 00:08:19
问题 we are trying to make parallel calls to different recipient using scatter-gather and it works fine. But the second recipient flow is not starting unless the first one is complete(traced in Zipkin). is there is a way to make all recipients async.. very similar to split-aggregate with executor channel. public IntegrationFlow flow1() { return flow -> flow .split().channel(c -> c.executor(Executors.newCachedThreadPool())) .scatterGather( scatterer -> scatterer .applySequence(true) .recipientFlow

How to use SpEL to read payload and header content in a Spring Integration Router

情到浓时终转凉″ 提交于 2019-12-11 21:29:36
问题 Technologies in my project Spring Boot 2 Spring Integration (XML style) Java 8 Tomcat 9.x/Liberty 19.0.0.1 As a part of my Spring Integration project (REST API with an inbound-http-gateway, that takes an XML input and produces an XML output), I am writing the following components: A service-activator that performs basic validation of the incoming XML against its XSD. If validation is successful, a POJO (a builder-pattern Java object) is built with a Boolean instance variable/property called