spring-integration

Create MessageSource for Redis in Spring Integration

馋奶兔 提交于 2019-12-04 11:42:55
I want to configure InboundChannelAdapter so that it should pop message from a redis queue and pass it to a ServiceActivator in Java based annotations(only, prefer to avoid XML). I found the code from Spring documentation: @Bean("someAdapter.source") @EndpointId("someAdapter") @InboundChannelAdapter(channel = "channel3", poller = @Poller(fixedDelay = "5000")) public MessageSource<?> source() { return () -> { ... }; } But what I do not understand here is, how can I return MessageSource by poping the data from redis queue using redisConnectionFactory? In other words, how can I do this in java

How can I create http outbound-gateway with JAVA config in Spring integration?

北城以北 提交于 2019-12-04 11:22:59
I have the following http outbound gateway. How can I do this configuration with Java Config or Spring DSL? <int-http:outbound-gateway id="test" url="http://localhost:8080/" http-method="POST" charset="UTF-8" header-mapper="soapHeaderMapper" request-factory="requestFactory" request-channel="inputChannel"/> @Bean public IntegrationFlow httpOut() { return IntegrationFlows.from("inputChannel") .handle(Http.outboundGateway("http://localhost:8080/") .charset("UTF-8") .httpMethod(HttpMethod.POST) .headerMapper(soapHeaderMapper()) .requestFactory(requestFactory()), e -> e.id("test")) .get(); } Or

JMS connections exhausted using WebSphere MQ

有些话、适合烂在心里 提交于 2019-12-04 09:31:37
I have configured CachingConnectionFactory that wraps a MQTopicConnectionFactory and MQQueueConnectionFactory with cache size set to 10 each. These are than used in several jms:outbound-channel-adapter or jms:message-driven-channel-adapter as part of various spring integration workflows that I have in my application. It is noticed that once in a while the connection count on MQ channel reaches maximum allowed (about 1000) when the process stops functioning. This is a serious problem for a production application. Bringing the application down does not reduce the connection count so looks like

How to debug spring-integration

别来无恙 提交于 2019-12-04 09:22:03
We are quite happy with spring-integration except when things do not work as expected. Then it is really difficult to find out what is going on (we are using xml configuration). Can someone point me to the java components behind the spring integration components in order to debug them. For instance: If I have a headerValueRouter, where can I set a breakpoint to find out what is the actual value of the header inside the message, just before the component is doing the routing. Maybe there is even a list int:component->java class? True. The list exists, but it isn't so direct, as you may expect.

How should I build my Messages in Spring Integration?

笑着哭i 提交于 2019-12-04 04:55:09
问题 I have an application I coded which I am refactoring to make better use of Spring Integration. The application processes the contents of files. The problem (as I see it) is that my current implementation passes Files instead of Messages , i.e. Spring Integration Messages. In order to avoid further rolling my own code, which I then have to maintain later, I'm wondering if there is a recommended structure for constructing Messages in Spring Integration. What I wonder is if there is some

Remote partition - slave getting greedy

做~自己de王妃 提交于 2019-12-04 04:48:10
问题 Following is what we are trying to achieve. We want a big xml file to be staged in a database parallely in different vms. To achieve this, we are using the scalable spring batch remote partition approach and we are running into some issues. Following is the high level setup master - splits an xml file into multiple partitions ( we currently have a grid size of 3). slave 1 - processing partitions (reads index based partitions and writes to DB) slave 2 - processing partitions We are running it

Consuming from Kafka failed Iterator is in failed state

懵懂的女人 提交于 2019-12-04 01:57:47
问题 I am getting exception while consuming the messages from kafka. org.springframework.messaging.MessagingException: Consuming from Kafka failed; nested exception is java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Iterator is in failed state I have one consumer in the application context with one outbound adapter. Consumer configuration in application context <int-kafka:consumer-context id="consumerContext" consumer-timeout="4000" zookeeper-connect="zookeeperConnect">

Spring Integration Kafka Consumer Listener not Receiving messages

只谈情不闲聊 提交于 2019-12-04 00:38:29
According to the documentation provided here , I am trying on a POC to get messages into a listener as mentioned in the the same documentation , Below is how I have written the configuration. @Configuration public class KafkaConsumerConfig { public static final String TEST_TOPIC_ID = "record-stream"; @Value("${kafka.topic:" + TEST_TOPIC_ID + "}") private String topic; @Value("${kafka.address:localhost:9092}") private String brokerAddress; /* @Bean public KafkaMessageDrivenChannelAdapter<String, String> adapter( KafkaMessageListenerContainer<String, String> container) {

Waiting for all threads to finish in Spring Integration

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 23:26:27
I have a self-executable jar program that relies heavily on Spring Integration. The problem I am having is that the program is terminating before the other Spring beans have completely finished . Below is a cut-down version of the code I'm using, I can supply more code/configuration if needed. The entry point is a main() method, which bootstraps Spring and starts the import process: public static void main(String[] args) { ctx = new ClassPathXmlApplicationContext("flow.xml"); DataImporter importer = (DataImporter)ctx.getBean("MyImporterBean"); try { importer.startImport(); } catch (Exception e

Spring Integration multiple UDP inbound/outbound channels

爱⌒轻易说出口 提交于 2019-12-03 21:10:41
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 TCP and UDP support , but it is rather... compact, and opaque. The javadocs on the org.springframework