spring-integration

Spring Integration multiple UDP inbound/outbound channels

坚强是说给别人听的谎言 提交于 2019-12-05 08:30:44
问题 I am trying to build a module to be deployed on multiple nodes using Spring boot. Due to time constraints of the specific application, I have to use UDP and cannot rely on the easier-to-use REST facilities that Spring provides. I have to be able to send datagrams to a set of nodes that may vary in time (i.e. the set may grow or shrink, or some nodes may move to new ip/port "coordinates"). Communication must be unicast . I have been reading the official documentation about TCP and UDP support

How to setup TLS Server to authenticate client in spring integration?

北城余情 提交于 2019-12-05 06:28:52
问题 Refer to Running the client with SSL/TLS. This explains a scenario where server does a client authentication. I am using Spring Integration to process TLS connections. My spring-context file is: <bean id="sslContextSupport" class="org.springframework.integration.ip.tcp.connection.DefaultTcpSSLContextSupport"> <constructor-arg value="file:keystore.jks"/> <constructor-arg value="file:truststore.jks"/> <constructor-arg value="keystorepass"/> <constructor-arg value="trustpass"/> </bean> <int-ip

spring receive emails without xml (using annotations only)

陌路散爱 提交于 2019-12-05 02:33:27
问题 I need to periodically check about 30 mailboxes and want to do this with annotations only. I know how to do it with XML files, it looks like this: <mail:inbound-channel-adapter id="ImapAdapter" store-uri="imaps://${login}:${pass}@${host}:993/inbox" channel="testReceiveEmailChannel" should-delete-messages="false" should-mark-messages-as-read="true" auto-startup="true" java-mail-properties="javaMailProperties"> <int:poller fixed-delay="200" time-unit="SECONDS" task-executor="asyncTaskExecutor"/

@MessagingGateway, Spring Cloud Stream, and error handling across both

若如初见. 提交于 2019-12-04 20:14:44
Regarding the answer posted for How can @MessagingGateway be configured with Spring Cloud Stream MessageChannels? , what is the correct way to handle errors at the @MessagingGateway that can be returned from Spring Cloud Stream services? To recap, I have a @MessagingGateway that provides synchronous access to asynchronous services built using Spring Cloud Stream. When an error occurs within my Spring Cloud Stream service layer, I create an error response and send it through a SubscribableChannel to other @StreamListener services that process the errors. For example, when an account is created,

Spring Integration - Reliable TCP for high volume application

£可爱£侵袭症+ 提交于 2019-12-04 19:58:02
I'm using Spring Integration for TCP server which keeps connections to a few thousand clients. I need the server to throttle clients in case of excessive load and not to lose messages. My server configuration: <task:executor id="myTaskExecutor" pool-size="4-8" queue-capacity="0" rejection-policy="CALLER_RUNS" /> <int-ip:tcp-connection-factory id="serverTcpConFact" type="server" port="60000" using-nio="true" single-use="false" so-timeout="300000" task-executor="myTaskExecutor" /> <int-ip:tcp-inbound-channel-adapter id="tcpInboundAdapter" channel="tcpInbound" connection-factory="serverTcpConFact

Spring integration move file after processing

懵懂的女人 提交于 2019-12-04 18:12:14
How to move a file after processing in spring integration after processing file ..? I have followed http://xpadro.blogspot.com/2016/07/spring-integration-polling-file.html to implement the file polling , but I need to add onSuccess and OnError transnational events (with out XML configurations) I am not sure what you mean by "transaction", file systems are generally not transactional, but you can add an advice to the final consumer in the flow... @SpringBootApplication public class So40625031Application { public static void main(String[] args) { SpringApplication.run(So40625031Application.class

Subset of changes from transaction sometimes not visible shortly after commit

a 夏天 提交于 2019-12-04 18:10:50
Let's consider the following context: 2 spring integration channels, they are each in separate database transactions. At the end of the first transaction, a message is put into the second channel. In the first channel, elements are created in the database that is later consumed by the corresponding message that has been sent from the first channel to the second channel. To make sure that the transaction from channel 1 is fully committed before the second channel is triggered our subclass of the JpaTransactionManager is registering a TransactionSynchronization in the prepareForCommit method it

Spring Integration listen on queue without poller

可紊 提交于 2019-12-04 18:10:48
I want to implement the HTTP endpoint using Spring Integration, which listen to the http requests, sends the request data as messages to the channel and another endpoint should listen messages on this channel and process them. Sounds simple. But what I want to achieve is: Messages should be processed in order. Messages should be processed asap (without delay after http request, if the queue is already empty). The http request should be responded as soon as message is received, not after it is processed, so the sender will know only that message is received for processing. I don't want to use

Spring Integration Http Outbound Gateway Header Mapper

╄→гoц情女王★ 提交于 2019-12-04 15:23:47
问题 I am trying to add custom headers to my http outbound gateway. Things that I have tried & work: <int:header-enricher> <int:header name="replyChannel" value="nullChannel" /> <int:header name="Content-Type" value="application/xml" /> <int:header name="X-Operation" value="CUSTOM_OPERATION" /> <int:header name="X-StatusCode" value="200" /> </int:header-enricher> <int-http:outbound-gateway url="${custom.url}/update" mapped-request-headers="HTTP_REQUEST_HEADERS, Operation, StatusCode" http-method=

Distributed Transaction between multiple Apps in Spring

送分小仙女□ 提交于 2019-12-04 13:55:16
问题 I currently have a set of ERP style web applications build on top spring 3. The application is deployed into tomcat 7. The system developed some time ago without a cleanly defined architecture. Each Application has 3 parts (as sub projects). API: Defining Models and Interfaces, IMPL: The Service Layer, and the WEB. Current layout of system is as below. Financial API+IMPL is included to Inventory module for achieving transaction management. We previously tried to separate inventory and