spring-integration

SourcePollingChannelAdapter with Transaction

本秂侑毒 提交于 2019-12-02 20:45:47
问题 I would like to use a SourcePollingChannelAdapter with a transaction propagation REQUIRED when the polling is realized, to rollback all operations if an error is occured. The method setTransactionSynchronizationFactory is not commented... Thanks a lot for your help ! In XML I can do : <int:poller fixed-rate="5000"> <int:transactional transaction-manager="transactionManager" propagation="REQUIRED" /> </int:poller> I would like to use a transaction like this programmatically with a

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

有些话、适合烂在心里 提交于 2019-12-02 20:38:52
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 public ClassThatRequiresADataSource() { ClassThatRequiresADataSource foo = new ClassThatRequiresADataSource(

Spring Integration jdbc:inbound-channel-adapter - Set max-rows-per-poll dynamic to throttle

▼魔方 西西 提交于 2019-12-02 18:51:59
问题 I have a JDBC:inbound-channel-adapter : To set the 'max-rows-per-poll' dynamic to throttle the messages getting passed on the channel. I have a QueueChannel which has a capacity of 200. The inbound-channel-adapter would be sending the message to this QueueChannel. I would like to set the 'max-rows-per-poll' value depending on the RemainingCapacity of the QueueChannel. For this I tried to Inject the QueueChannel in a Bean but I get the error when deploying the war file. Error: Cannot Inject

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

我只是一个虾纸丫 提交于 2019-12-02 17:47:26
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 by the Spring Integration framework to decouple the clients from the worker nodes? When reading through

Spring int-xml:xpath-expression erros with node function

南楼画角 提交于 2019-12-02 14:11:51
问题 I used XMLSpy to write the following XPath to determine the longest string length and it works in XMLSpy: string-length(//exception:ElementMessageAbcException/@exceptionMsg[not(string-length(.) < //exception:ElementMessageAbcException/@exceptionMsg/string-length(.))] ) But when I put the same string into a xpath-expression in spring integration it errors: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xpathMaxLengthExceptionMsg': Instantiation of bean

Deadlock using Aggregator + Redis

北战南征 提交于 2019-12-02 14:05:18
问题 This post is related to this one Spring integration deadlock using Aggregator + MessageStoreReaper + Redis? but this message is too long to post. I continue with the original post I upgraded to to the latest Java 7 build 1.7.0_60-b19 but the problem is still there. I made another thread dump and found the same issue: all DefaultMessageListenerContainers (count 20) are locked by the taskScheduler (entityScheduler-3) in the AbstractCorrelatingMessageHandler lock invocation. Here's the scheduler

message-driven-channel-adapter drops first message after app context startup unless send is called with a delay

雨燕双飞 提交于 2019-12-02 14:03:29
问题 I have an integration test for my Spring Integration config, which consumes messages from a JMS topic with durable subscription. For testing, I am using ActiveMQ instead of Tibco EMS. The issue I have is that I have to delay sending the first message to the endpoint using a sleep call at the beginning of our test method. Otherwise the message is dropped. If I remove the setting for durable subscription and selector, then the first message can be sent right away without delay. I'd like to get

Spring TCP Client without Transformer

自古美人都是妖i 提交于 2019-12-02 13:19:37
I followed this example for setting up a TCP Client in Spring. Below is my tcpClientServerDemo-context.xml file where the transformer lies. Can someone help me remove the transformer and send the data as it is without any modifications? If I try to remove the line reply-channel='clientBytes2StringChannel' or even make it null, I get exceptions when building the project. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-ip=

How do I make Jersey use Java serialization?

为君一笑 提交于 2019-12-02 12:38:02
问题 I realize it's a little un-RESTful, but I'd like to use a Jersey client to send a Spring Integration GenericMessage to a Jersey server using Java serialization as the "marshalling". Is there built-in or contrib support for that, or will I have to write my own MessageBodyReader/Writer? I've tried setting the type in the Client request to both "application/x-java-serialized-object" and MediaType.APPLICATION_OCTET_STREAM_TYPE, and it just gives the usual: ClientHandlerException: A message body

Moving processed files to another directory using Spring integration ftp inbound adapter

喜夏-厌秋 提交于 2019-12-02 12:17:57
问题 I am trying to poll local directory using ftp inbound adapter to fetch files for further processing. I want to move the file to another local directory and delete it from origination. Not getting a way to achieve it. Here's what I have so far: <int-ftp:inbound-channel-adapter id="ftpInbound" channel="ftpChannel" session-factory="ftpClientFactory" filename-pattern="*.xml" auto-create-local-directory="false" delete-remote-files="false" remote-directory="/" local-directory="//C://FBS//testmq">