spring-integration-dsl

How to add attachments in mail using spring integration mail with DSL configuration

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-28 13:34:18
问题 I am new to Spring integration, trying to send an email with attachment (excel sheet) using spring integration mail dependency with DSL configuration. My problem is I don't know how to add the attachments in Mail.outboundadapter IntegrationFlow . Is anyone having the attachment sample please post it or share some sample code? I have gone through the spring docs, could not understand the attachment concept there.Below is my code. SampleClass.java @EnableAutoConfiguration @SpringBootApplication

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

How can I map incoming headers as String instead of byte[] in my Spring Cloud Stream project?

北慕城南 提交于 2021-01-27 06:17:06
问题 I have a simple Spring Cloud Stream project using Spring Integration DSL flows and using the Kafka binder. Everything works great, but message header values coming from Kafka arrive as byte[] . This means that my SI @Header parameters need to be of type byte[] . Which works, but it'd be nice to have them as Strings (all the inbound headers I care about are String values). I've configured the Kafka clients to use StringSerializer/StringDeserializer. I assume I also need to somehow tell Spring

Spring Integration: how to unit test a poller advice

安稳与你 提交于 2020-08-12 02:54:25
问题 I'm trying to unit test an advice on the poller which blocks execution of the mongo channel adapter until a certain condition is met (=all messages from this batch are processed). The flow looks as follow: IntegrationFlows.from(MongoDb.reactiveInboundChannelAdapter(mongoDbFactory, new Query().with(Sort.by(Sort.Direction.DESC, "modifiedDate")).limit(1)) .collectionName("metadata") .entityClass(Metadata.class) .expectSingleResult(true), e -> e.poller(Pollers.fixedDelay(Duration.ofSeconds

How to config tcp server to receive data from multiple client using spring boot?

你离开我真会死。 提交于 2020-07-20 03:44:52
问题 I would like to configure TCP server to receive and reply data from multiple clients. I searched many other thread but could not found exact way to do. I'm using spring integration first time and have no experience. Server requirement should be able to receive and reply data to specific client (can have multiple client, each client should processed separately) should be able to send data to client and wait for response for specific timeout. Should be able to detect client is disconnect or not

How to config tcp server to receive data from multiple client using spring boot?

折月煮酒 提交于 2020-07-20 03:44:50
问题 I would like to configure TCP server to receive and reply data from multiple clients. I searched many other thread but could not found exact way to do. I'm using spring integration first time and have no experience. Server requirement should be able to receive and reply data to specific client (can have multiple client, each client should processed separately) should be able to send data to client and wait for response for specific timeout. Should be able to detect client is disconnect or not

How to config tcp server to receive data from multiple client using spring boot?

大兔子大兔子 提交于 2020-07-20 03:44:46
问题 I would like to configure TCP server to receive and reply data from multiple clients. I searched many other thread but could not found exact way to do. I'm using spring integration first time and have no experience. Server requirement should be able to receive and reply data to specific client (can have multiple client, each client should processed separately) should be able to send data to client and wait for response for specific timeout. Should be able to detect client is disconnect or not

How to config tcp server to receive data from multiple client using spring boot?

安稳与你 提交于 2020-07-20 03:44:04
问题 I would like to configure TCP server to receive and reply data from multiple clients. I searched many other thread but could not found exact way to do. I'm using spring integration first time and have no experience. Server requirement should be able to receive and reply data to specific client (can have multiple client, each client should processed separately) should be able to send data to client and wait for response for specific timeout. Should be able to detect client is disconnect or not

Free queue channel in spring integration with java DSL

与世无争的帅哥 提交于 2020-07-03 09:39:30
问题 i have a channel that stores messages. When new messages arrive, if the server has not yet processed all the messages (that still in the queue), i need to clear the queue (for example, by rerouting all data into another channel). For this, I used a router. But the problem is when a new messages arrives, then not only old but also new ones rerouting into another channel. New messages must remain in the queue. How can I solve this problem? This is my code: @Bean public IntegrationFlow