spring-integration

Java mail listener using Spring Integration : mail isn't received by multiple app instances

穿精又带淫゛_ 提交于 2020-06-09 05:19:08
问题 I'm using below code in a Springboot application: @Bean public IntegrationFlow mailListener() { return IntegrationFlows.from(Mail.imapInboundAdapter(receiver()), e -> e.poller(Pollers.fixedRate(60000).maxMessagesPerPoll(-1))) .<Message>handle(message -> logMail(message)).get(); } private org.springframework.messaging.Message<?> logMail(org.springframework.messaging.Message<?> message) { System.out.println("received a mail********** !"); // System.out.println(message.getPayload()); // process

Spring-Kafka vs. Spring-Cloud-Stream (Kafka)

大兔子大兔子 提交于 2020-05-25 03:26:25
问题 Using Kafka as a messaging system in a microservice architecture what are the benefits of using spring-kafka vs. spring-cloud-stream + spring-cloud-starter-stream-kafka ? The spring cloud stream framework supports more messaging systems and has therefore a more modular design. But what about the functionality ? Is there a gap between the functionality of spring-kafka and spring-cloud-stream + spring-cloud-starter-stream-kafka ? Which API is better designed? Looking forward to read about your

DuplicateKeyException raised when using Spring JdbcMetadataStore (Oracle)

别来无恙 提交于 2020-05-24 02:05:31
问题 My current configuration of file:inbound-channel-adapter is working fine. I'm running the application in multiple servers and only one is actually processing the file. Database table INT_METADATA_STORE also updated successfully. Issue I'm facing is that one of the servers are still trying to insert the record and below exception is raised: org.springframework.messaging.MessagingException: nested exception is org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [INSERT

Spring Cloud Stream 3.0.1 adding Channel Interceptor around @Input annotation

橙三吉。 提交于 2020-05-17 07:06:21
问题 I am looking for a way to intercept the @Input annotation and add an interceptor for my Subscribable Channel Something like below @Around("@annotation(org.springframework.cloud.stream.annotation.Input)") public Object interceptInput(ProceedingJoinPoint joinPoint) throws Throwable { LOG.debug("Intercepted @Input from method : {}", joinPoint.getSignature()); Object returnValue = null; try { returnValue = joinPoint.proceed(); // add the interceptor for input channel } catch (Exception e) { LOG

Abstracting Spring Cloud Stream Producer and Consumer code

≯℡__Kan透↙ 提交于 2020-05-17 05:52:18
问题 I have a Service that is Producing and Consuming messages from different Spring Cloud Stream Channels (bound to EventHub/Kafka topics). There are several such Services which are setup similarly. The configuration looks like below public interface MessageStreams { String WORKSPACE = "workspace"; String UPLOADNOTIFICATION = "uploadnotification"; String BLOBNOTIFICATION = "blobnotification"; String INGESTIONSTATUS = "ingestionstatusproducer"; @Input(WORKSPACE) SubscribableChannel

How to poll from a queue 1 message at a time after downstream flow is completed in Spring Integration

风格不统一 提交于 2020-05-15 09:35:08
问题 I am currently working on improving performance in an integration flow trying to parallelize message processing. I have implemented all using Java DSL. The current Integration flow takes messages from a Queue Channel with a fixed Poller and process the message serially through multiple handlers one after the other until it reaches a final handler that makes some final calculations taking into account each of the previous handler's output. They are all wired up within the same Integration Flow

Spring Integration Flow API does not response when empty remote directory

你离开我真会死。 提交于 2020-04-30 09:20:58
问题 I am using spring integration SFTP protocol to transfer files on remote inbound and outbound servers.It works fine when my remote inbound server directory contains any file but it does not response when my remote server directory is empty means there is no file.I am using following piece of code IntegrationFlows.from(Sftp.inboundAdapter(inboundSftp) .localDirectory(this.getlocalDirectory(config.getId())) .deleteRemoteFiles(true) .autoCreateLocalDirectory(true) .filter(new

Tracing memory leak in Spring Azure qPID JMS code

烂漫一生 提交于 2020-04-30 05:10:28
问题 Im trying to trace and identify root cause for memory leak in our very small and simple Spring Boot application. It uses following: - Spring Boot 2.2.4 - azure-servicebus-jms-spring-boot-starter 2.2.1 - MSSQL Function: The app only dispatches Azure ServiceBus queue and stores data and sends data to other destination. It is a small app so it starts easily with 64 megs of memory, despite I give it up to 256 megs via Xmx option. Important note is the queue is being dispatched using Spring

Tracing memory leak in Spring Azure qPID JMS code

老子叫甜甜 提交于 2020-04-30 05:10:19
问题 Im trying to trace and identify root cause for memory leak in our very small and simple Spring Boot application. It uses following: - Spring Boot 2.2.4 - azure-servicebus-jms-spring-boot-starter 2.2.1 - MSSQL Function: The app only dispatches Azure ServiceBus queue and stores data and sends data to other destination. It is a small app so it starts easily with 64 megs of memory, despite I give it up to 256 megs via Xmx option. Important note is the queue is being dispatched using Spring

Spring integration - stop polling if no file returned

不羁的心 提交于 2020-04-19 08:51:57
问题 I have a poller that is polling a remote dir in order to sftp the file across but i want to stop it if it doesn't find the file after x amount of attempts. Is there a simple config for this? ApplicationContext.xml <int-sftp:inbound-channel-adapter id="sftpInboundAdaptor" session-factory="sftpSessionFactory" local-directory="${local.dir}" auto-create-local-directory="true" auto-startup="false" channel="SftpChannel" remote-directory="${remote.dir}" filename-pattern="XXXX" delete-remote-files=