集群模式下的Spring入站集成

时间:2016-11-17 18:27:45

标签: spring spring-integration load-balancing

我们正在使用spring入站轮询适配器来检查文件并对其进行处理。问题是进程在集群模式下运行多个节点。我们的测试环境使用两个节点的负载平衡,要求是在一个节点上启动此轮询过程。如何在不创建两个战争文件的情况下实现这一目标。我们不应该使用XML配置。

1 个答案:

答案 0 :(得分:0)

为此,Spring Integration提供FileSystemPersistentAcceptOnceFileListFilter,您应该使用相同的共享外部MetadataStore配置autoStartup

修改

正如Gary建议的那样,您可以控制入站通道适配器的@BeforeClass public static void setup() { System.setProperty("integrationAllowed", "false"); } ... @Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { return new PropertySourcesPlaceholderConfigurer(); } @Bean @InboundChannelAdapter(value = "flow1.input", autoStartup = "${integrationAllowed}", poller = @Poller(fixedRate = "100")) public MessageSource<?> integerMessageSource() {

我测试了它:

${integrationAllowed}

运作良好。

表达式$scope.items= [{},{},{},{}]; $scope.columns = { data: 'foo', title: "<input type='checkbox' onclick='console.log(items)' class='foo'>, type: 'checkbox', renderer: $scope.checkboxRenderer }; $scope.checkboxRenderer = function(instance, td, row, col, prop, value, cellProperties) { Handsontable.renderers.CheckboxRenderer.apply(this, arguments); if (value === true) { td.style.background = '#59e817'; } else { td.style.background= '#ff2400'; }; return td; }; 表示属性占位符句子。

如果您不能使用某些共享持久性资源来控制群集状态,那么它看起来就像群集......