spring-dsl

Java Mail Listner : This email server does not support RECENT or USER flags

谁说胖子不能爱 提交于 2020-06-29 04:25:08
问题 This is a continuation of Java mail listener using Spring Integration : mail isn't received by multiple app instances . I'm using below ImapMailReceiver code : @Bean public ImapMailReceiver receiver() { ImapMailReceiver receiver = new ImapMailReceiver( "imaps://username:pwd@mail.company.com/INBOX"); receiver.setShouldMarkMessagesAsRead(false); receiver.setSimpleContent(true); receiver.setUserFlag("test-flag"); //receiver.setJavaMailProperties(javaMailProperties()); return receiver; } My

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 Batch Integration config using Java DSL

假装没事ソ 提交于 2020-01-15 09:40:01
问题 The Spring Integration Java DSL Reference and Spring Batch Java Configuration documentation show how to use Java Configuration for Spring Integration and Spring Batch. But they dont show how to configure it for the Spring Batch Integration. How is a JobLaunchingGateway configured using DSL? Cheers, Menno 回答1: The JobLaunchingGateway is a MessageHandler so you would define it as a @Bean and use it in a .handle() method in the flow. 回答2: Gary is correct. You can see a demo of the java config

Spring Batch Integration config using Java DSL

最后都变了- 提交于 2020-01-15 09:37:27
问题 The Spring Integration Java DSL Reference and Spring Batch Java Configuration documentation show how to use Java Configuration for Spring Integration and Spring Batch. But they dont show how to configure it for the Spring Batch Integration. How is a JobLaunchingGateway configured using DSL? Cheers, Menno 回答1: The JobLaunchingGateway is a MessageHandler so you would define it as a @Bean and use it in a .handle() method in the flow. 回答2: Gary is correct. You can see a demo of the java config

Spring Batch Integration config using Java DSL

与世无争的帅哥 提交于 2020-01-15 09:37:07
问题 The Spring Integration Java DSL Reference and Spring Batch Java Configuration documentation show how to use Java Configuration for Spring Integration and Spring Batch. But they dont show how to configure it for the Spring Batch Integration. How is a JobLaunchingGateway configured using DSL? Cheers, Menno 回答1: The JobLaunchingGateway is a MessageHandler so you would define it as a @Bean and use it in a .handle() method in the flow. 回答2: Gary is correct. You can see a demo of the java config

Example Spring integration DSL for JPA Inbound Channel adapter

别等时光非礼了梦想. 提交于 2020-01-14 13:53:46
问题 I can't find a useful example for polling a JPA source for inbound data. I know how to do this in XML but can't figure out how do it in DSL. In short what I want to do is periodically poll a JPA repository for records then put the records into a flow that will do the usual filtering/transforming/executing. Kind regards David Smith 回答1: Wire up a JpaPollingChannelAdapter as a @Bean and use IntegrationFlows.from(jpaMessageSource(), c -> c.poller(Pollers.fixedDelay(1000))) .transform(...) ...

Getting the exception 'Cannot find any routes with this RouteBuilder reference: RouteBuilderRef[routebuilderOne]'

孤街浪徒 提交于 2019-12-24 18:22:12
问题 I am getting the exception Cannot find any routes with this RouteBuilder reference: RouteBuilderRef[routebuilderOne] when I am trying to wire the route builder based on configuration. Class file of Route Builder 1 import org.apache.camel.spring.SpringRouteBuilder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component public class RoutebuilderOne extends

Convert Message to Job to make it Spring Integration with Batch Processing

若如初见. 提交于 2019-12-24 13:29:15
问题 I am trying to process a series of files using Spring Integration in a batch fashion. I have this very old xml which tries to convert the messages into jobs <int:transformer ref="messageToJobTransformer"/> <batch-int:job-launching-gateway job-launcher="jobLauncher"/> The messageToJobTransformer is a class which can convert a Message into a Job. The problem is I don't know where this file is now neither I want a xml config. I want it to be pure Java DSL. Here is my simple config. return

Spring Integration with Jackson ObjectMapper and Java 8 Time (JSR-310)

╄→尐↘猪︶ㄣ 提交于 2019-12-20 03:17:15
问题 I am struggling with configuring a "custom" ObjectMapper to be used by the Spring Integration DSL transformers. I receive an java.time.Instant json representations that I would like to parse to object properties. i.e: {"type": "TEST", "source":"TEST", "timestamp":{"epochSecond": 1454503381, "nano": 335000000}} The message is a kafka message which raises a question: Should I write a custom serializer implementing Kafka encoders/decoders in order to be able to transform the kafka message to the

Spring Integration DSL ErrorHandling

这一生的挚爱 提交于 2019-12-20 02:43:08
问题 As the title says, I'm looking for a good example on errorHandling within a DSL flow. Specifically, I'm looking to handle errors from a service activator. Example: IntegrationFlows.from(Amqp.inboundAdapter(simpleMessageListenerContainer())) .transform(new JsonToObjectTransformer(AlbumDescriptor.class)) .handle(AlbumDescriptor.class, (p,h) -> transformXml(p)) .transform(new ObjectToJsonTransformer()) .handle(Amqp.outboundAdapter(rabbitTemplate).routingKey("xml-transformed")) .get(); If my