Add support for @EnableModule, @Input and @Output
* enable the component model based on @EnableModule with existing functionality * any field annotated with Input/Output will trigger the creation and injection of a channel * update examples and tests * update README
This commit is contained in:
committed by
Mark Fisher
parent
2fa5724cee
commit
23e4cbc7ac
@@ -21,7 +21,8 @@ import java.util.Date;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.cloud.streams.EnableChannelBinding;
|
||||
import org.springframework.cloud.streams.annotation.EnableModule;
|
||||
import org.springframework.cloud.streams.annotation.Output;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.integration.annotation.InboundChannelAdapter;
|
||||
@@ -35,18 +36,15 @@ import org.springframework.messaging.support.GenericMessage;
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
@Configuration
|
||||
@EnableChannelBinding
|
||||
@EnableModule
|
||||
@EnableConfigurationProperties(TimeSourceOptionsMetadata.class)
|
||||
public class TimeSource {
|
||||
|
||||
@Autowired
|
||||
private TimeSourceOptionsMetadata options;
|
||||
|
||||
@Bean
|
||||
public MessageChannel output() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
@Output
|
||||
public MessageChannel output;
|
||||
|
||||
@Bean
|
||||
@InboundChannelAdapter(value = "output", autoStartup = "false", poller = @Poller(fixedDelay = "${fixedDelay}", maxMessagesPerPoll = "1"))
|
||||
|
||||
@@ -19,9 +19,6 @@ package source;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
import org.springframework.xd.module.options.mixins.MaxMessagesDefaultOneMixin;
|
||||
import org.springframework.xd.module.options.mixins.PeriodicTriggerMixin;
|
||||
import org.springframework.xd.module.options.spi.Mixin;
|
||||
import org.springframework.xd.module.options.validation.DateFormat;
|
||||
|
||||
/**
|
||||
@@ -30,7 +27,6 @@ import org.springframework.xd.module.options.validation.DateFormat;
|
||||
* @author Eric Bottard
|
||||
* @author Gary Russell
|
||||
*/
|
||||
@Mixin({ PeriodicTriggerMixin.class, MaxMessagesDefaultOneMixin.class })
|
||||
public class TimeSourceOptionsMetadata {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user