Files
spring-integration-extensions/spring-integration-java-dsl
Artem Bilan c161210c3e Introduce method-invoking handle
* Add generic argument to `GenericEndpointSpec`.
Since `EndpointSpec#get()` returns `Tuple` with `EndpointFactoryBean` and `MessageHandler` objects
it is useful to get deal with specific generic for further `MessageHandler` configuration within `EndpointConfigurer` lambda
* Change DSL-methods to get deal deal with those generics.
* Add `FileWritingMessageHandler` test to demonstrate it.
* Fix bug around double `MessageHandler` bean registration from `DslIntegrationConfigurationInitializer`, when handler is a reference
to existing bean.
2014-02-17 17:11:41 +02:00
..
2014-02-13 21:44:48 +02:00
2014-02-17 17:11:41 +02:00
2014-02-17 17:11:41 +02:00
2014-02-11 18:12:55 -05:00

Spring Integration Java DSL

The Spring Integration JavaConfig and DSL extension. Provides a set of convenient Builders and fluent API to configure Spring Integration message flows from Spring @Configuration classes.

Example Configurations

    @Configuration
    @EnableIntegration
    public class MyConfiguration {

        @Bean
        public MessageSource<?> integerMessageSource() {
            MethodInvokingMessageSource source = new MethodInvokingMessageSource();
            source.setObject(new AtomicInteger());
            source.setMethodName("getAndIncrement");
            return source;
        }

        @Bean
        public DirectChannel inputChannel() {
            return new DirectChannel();
        }

        @Bean
        public IntegrationFlow myFlow() {
            PollerMetadata pollerMetadata = new PollerMetadata();
            pollerMetadata.setTrigger(new PeriodicTrigger(100));

            return IntegrationFlows.from(this.integerMessageSource())
                        .poll(this.inputChannel(), pollerMetadata)
                        .transform((Integer p) -> p * 2)
                        .transform(Object::toString)
                        .channel(new QueueChannel())
                        .build();
        }
    }

As the result after ApplicationContext start up will be created Spring Integration endpoints and Message Channels as it is after XML parsing. Such configuration can be used to replace XML configuration or together with that.

Maven

Repository

<repository>
    <id>repository.springframework.maven.snapshot</id>
    <name>Spring Framework Maven Snapshot Repository</name>
    <url>http://repo.spring.io/libs-snapshot</url>
</repository>

Artifact

<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-dsl</artifactId>
    <version>1.0.0.BUILD-SNAPSHOT</version>
</dependency>

Support

Check out the Spring Integration forums and the spring-integration tag on Stack Overflow. Commercial support is available, too.

For more information, please also don't forget to visit the Spring Integration website.