spring-integration

Spring Integration 4 - configuring a LoadBalancingStrategy in Java DSL

冷暖自知 提交于 2019-12-13 01:29:49
问题 I have a simple Spring Integration 4 Java DSL flow which uses a DirectChannel 's LoadBalancingStrategy to round-robin Message requests to a number of possible REST Services (i.e. calls a REST service from one of two possible service endpoint URIs). How my flow is currently configured: @Bean(name = "test.load.balancing.ch") public DirectChannel testLoadBalancingCh() { LoadBalancingStrategy loadBalancingStrategy = new RoundRobinLoadBalancingStrategy(); DirectChannel directChannel = new

Spring Integration : How to intercept ALL spring integration component and fetch attribute values to log

陌路散爱 提交于 2019-12-13 01:24:32
问题 I need to intercept ALL the Spring Integration components at runtime and should be able to fetch the attribute values in order to log a meaningful message. For example: <int-http:outbound-gateway url="someURL" http-method="GET" request-channel="channel1" expected-response-type="com.example.Test" message-converters="customMessageConverters"> <int-http:uri-variable name="testId" expression="headers.testId"/> </int-http:outbound-gateway> In the example above, I need to intercept int-http

How to covert xml based spring-integration-email configuration to java based config?

我只是一个虾纸丫 提交于 2019-12-13 01:14:57
问题 I am using spring-integration-email in a spring boot application to receive emails. All example I found online use xml based config. I am using java based config in my application and I want to use the same for the spring-integration-email. Below is my xml based config, which works properly. How Can I convert it to java based config? <util:properties id="javaMailProperties"> <prop key="mail.imap.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop> <prop key="mail.imap.socketFactory

'Write-Only' over a TCP connection with Spring Integration

馋奶兔 提交于 2019-12-13 01:07:40
问题 I am using int-ip:tcp-connection-factory and int-ip:tcp-outbound-gateway to communicate with an external server. The protocol for most of the services offered by the server follows the standard request-response style... which is working great. However, there are a few situations where I only need to send a request and no response is expected. My question is, how do I configure my channels and connections so that I can specify whether or not to wait for a response? Currently I can't find a way

spring messaging converting json string to map

喜欢而已 提交于 2019-12-13 00:47:30
问题 Using Spring Integration and I have a json string (see below) and the following code: public SomethingBean convert(Message<?> inMessage) {...} Json string { "addressIdentification": { "identifierType": "nemtom", "addressIdentifier": "eztse" }, "postcode": "BH1EH", "country": "5" } I'd like to use the following method signature: public SomethingBean convert(Message<Map<String, ?>> inMessage) {...} Is it possible to convert the json string to Map automatically? Thanks, V. 回答1: Just use Spring

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

Read stream from input channel

人走茶凉 提交于 2019-12-12 23:13:09
问题 it is possible to read the stream from an input channel without creating a new function and add the streamListenner annotation. I'm using spring cloud stream. Thanks! EDIT Actually, I'm creating a microservice, where I have this method @RequestMapping(method = RequestMethod.POST, value = "/annonces") public void addAnnonce(@RequestBody AnnonceWrapper annonceWrapper) { final Message<AnnonceWrapper> message = MessageBuilder .withPayload(annonceWrapper) .setReplyChannel(messageStream

Spring integration expression map access with dot notation

拜拜、爱过 提交于 2019-12-12 22:42:12
问题 Normally in Spring EL you access a map entry by its key using the key in square brackets. If the payload of a spring integration message is a java.util.Map , then payload['mykey'] gives you the value of the entry having the String 'my-key' as key. When using the standard Spring EL setup, e.g. in a unit test, that is the only way to work with the map. However, in expressions used by Spring integration flows I can use the dot notation for map access. This works: payload.mykey I want to be able

Spring Batch integration Java DSL and RunIdIncrementer not incrementing

拈花ヽ惹草 提交于 2019-12-12 22:14:44
问题 I have a spring boot/integration/batch which will run and poll files on SFTP. I'd like to be able to eventually relaunch a job (could be because application has been restarted or because for some reasons we received the same file again) with the same parameters (same file basically) using RunIdIncrementer defined on Job's Configuration. Unfortunately run.id=1 doesn't increment and I get a JobInstanceAlreadyCompleteException JOB configuration @Autowired private JobBuilderFactory jobBuilders;

Spring Integration Http with Spring Boot and @RequestMapping

天大地大妈咪最大 提交于 2019-12-12 21:27:22
问题 i try to develop a SpringBoot Rest Server with Spring Integration HTTP -> inboundGateway. I've an Controller, annotated with "@Controller" and "@RequestMapping" and try to create following flow: GET Request "/" -> Channel: httpRequestChannel -> Run IndexController -> Channel: httpReplyChannel -> back to Browser But it's not working. My Integration Xml: <int:channel id="httpRequestChannel"> <int:interceptors> <int:wire-tap channel="logHttpRequestChannel" /> </int:interceptors> </int:channel>