spring-integration

spring receive emails without xml (using annotations only)

早过忘川 提交于 2019-12-03 17:20:36
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"/> </mail:inbound-channel-adapter> <int:channel id="testReceiveEmailChannel"> <int:interceptors> <int

Intellij spring integration flow diagram

吃可爱长大的小学妹 提交于 2019-12-03 12:53:03
问题 In Intellij do we have a feature to generate a flow diagram for message/event processing in various spring integration channels? Given a complex spring integration XML config file with various transformers, inbound, outbound channels and service-activators, is there a way to pictorially view the flow across all these channels? Is there any tool for such diagram generation? Note: its not just spring beans diagrams but actual message flow using spring integration 回答1: In Intellij, open the

Distributed Transaction between multiple Apps in Spring

蓝咒 提交于 2019-12-03 08:53:17
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 financial into different Web apps by using REST calls but faced issue with transaction management. What we are

Spring Integration Http Outbound Gateway Header Mapper

不打扰是莪最后的温柔 提交于 2019-12-03 08:45:38
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="POST" request-factory="serviceRequestFactory" expected-response-type="java.lang.String" error-handler=

Using Spring Integration with RabbitMQ

我只是一个虾纸丫 提交于 2019-12-03 08:42:45
I'm in the process of developing a messaging interface for one of our applications. The application is a service which is designed to accept a "Job", do some processing, and return the result (in the form of a File actually). The idea is to use RabbitMQ as the messaging infrastructure and Spring AMQP to handle protocol specific details. I do not want to have a tight coupling from my code to Spring AMQP, so I would like to use Spring Integration to hide the messaging api. So basically I want this: Message sent to RabbitMQ ====> Spring AMQP ====> Spring Integration ====> MyService ====> reply

How can I use Spring Boot auto-configured beans in XML configuration files?

假装没事ソ 提交于 2019-12-03 07:01:28
问题 I'd like to take advantage of some of the Spring Boot auto-configured beans in XML configuration files, but I keep running into exceptions and errors when I try to do so. For example, if I have data-related libraries on my class path, Spring Boot will auto-configure a DataSource object which I can autowire into my own beans and classes, like so: @Configuration @ImportResource("classpath:xmlconfig.xml") public class Config { // This works!! @Autowired private DataSource dataSource; @Bean

How to leverage Spring Integration in a real-world JMS distributed architecture?

佐手、 提交于 2019-12-03 04:38:52
问题 For the following scenario I am looking for your advices and tips on best practices: In a distributed (mainly Java-based) system with: many (different) client applications (web-app, command-line tools, REST API) a central JMS message broker (currently in favor of using ActiveMQ) multiple stand-alone processing nodes (running on multiple remote machines, computing expensive operations of different types as specified by the JMS message payload) How would one best apply the JMS support provided

spring integration - read a remote file line by line

这一生的挚爱 提交于 2019-12-02 21:42:47
问题 I am trying to read a remote file line by line, using spring integration. Using the spring documentation found here I have set up my project to poll for the file and transfer it via sftp when it is found. I am stuck on how to go about reading the file contents one line at a time. Here is my inbound channel adapter setup that currently works to pull in files. <int-sftp:inbound-channel-adapter id="sftpAdapterAutoCreate" session-factory="sftpSessionFactory" channel="receiveChannel" filename

Spring Integration: Get rid of code duplication for setting up beans

萝らか妹 提交于 2019-12-02 21:17:54
问题 For my SFTP client project, I am using spring integration. We have different clients and have to connect to different SFTP servers, but, all of the logic is same, so I have abstracted them out into AbstractSFTPEndPoint. Each client-specific class implements getClientId(), which is used by AbstractSFTPEndPoint to get client-specific details like SFTP credentials. However, the entire logic is same for all the clients, but I am still having to implement specific classes for each client. This is

Beans not recognized from spring-context.xml while loading the XML file as a part of a (Spring Boot Application) jar file

北城余情 提交于 2019-12-02 21:15:30
问题 I have an assignment wherein after creating a jar file using Spring Boot, I have to load it using URLClassLoader in a Java class to execute it. Issue is that although the jar file runs fine when launched directly but when I try to load it in a Java class using the following code, it fails. public static void main(String[] args) { // Getting the jar URL which contains target class URL[] classLoaderUrls = new URL[]{new URL("file:///C://Users\\CHH7KOR\\Documents\\POC\\BootDemo\\target\\BootDemo