проблема в весеннем кластере xd при развертывании моего модуля

У меня есть модуль s3-puler, который извлекает файл из s3. В производстве я сталкиваюсь с некоторой проблемой, когда пытаюсь создать поток. Но локальный одиночный узел работает нормально, и я попытался настроить кластер из 3 узлов и 1 узел администратора. в локалке работает нормально. Ниже мой контекст приложения

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:int="http://www.springframework.org/schema/integration"
       xmlns:int-aws="http://www.springframework.org/schema/integration/aws"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
        http://www.springframework.org/schema/integration/aws http://www.springframework.org/schema/integration/aws/spring-integration-aws-1.0.xsd">

    <int:poller fixed-delay="${fixed-delay}" default="true"/>

    <bean id="credentials" class="org.springframework.integration.aws.core.BasicAWSCredentials">
        <property name="accessKey" value="${accessKey}"/>
        <property name="secretKey" value="${secretKey}"/>
    </bean>

    <bean
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location">
            <value>dms-aws-s3-nonprod.properties</value>
        </property> 
    </bean>  

    <bean id="clientConfiguration" class="com.amazonaws.ClientConfiguration">
        <property name="proxyHost" value="${proxyHost}"/>
        <property name="proxyPort" value="${proxyPort}"/>
    <property name="preemptiveBasicProxyAuth" value="false"/> 
    </bean>

    <bean id="s3Operations" class="org.springframework.integration.aws.s3.core.CustomC1AmazonS3Operations">
        <constructor-arg index="0" ref="credentials"/>
        <constructor-arg index="1" ref="clientConfiguration"/>
        <property name="awsEndpoint" value="s3.amazonaws.com"/>
        <property name="temporaryDirectory" value="${temporaryDirectory}"/>
        <property name="awsSecurityKey"  value="${awsSecurityKey}"/>
    </bean>



    <!-- aws-endpoint="https://s3.amazonaws.com"  -->
    <int-aws:s3-inbound-channel-adapter aws-endpoint="s3.amazonaws.com"
                                        bucket="${bucket}"
                                        s3-operations="s3Operations"
                                        credentials-ref="credentials"
                                        file-name-wildcard="${file-name-wildcard}"
                                        remote-directory="${remote-directory}"
                                        channel="splitChannel"
                                        local-directory="${local-directory}"
                                        accept-sub-folders="false"
                                        delete-source-files="true"
                                        archive-bucket="${archive-bucket}"
                                        archive-directory="${archive-directory}">
    </int-aws:s3-inbound-channel-adapter>

    <int:splitter input-channel="splitChannel" output-channel="output"
          expression="T(org.apache.commons.io.FileUtils).lineIterator(payload)"/>

    <int:channel id="output"/>

my Application.java package com.capitalone.api.dms.main;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ImportResource;

    @SpringBootApplication
    @ImportResource("classpath:config/applicationContext.xml")
    public class Application {

        public static void main(String[] args) throws Exception {
            new SpringApplicationBuilder(Application.class)
                    .web(false)
                    .showBanner(false)
                    .properties("security.basic.enabled=false")
                    .run(args);
        }
    }

Я получаю исключение ниже, когда пытаюсь создать базовый поток

module upload --file   aws.jar  --name aws-s3-options --type source

stream create feedTest91 --definition "aws-s3-options    | log" --deploy

Я получаю исключение ниже

DeploymentStatus{state=failed,error(s)=org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'objectNameProperties' defined in null: Could not resolve placeholder 'xd.module.sequence' in string value "${xd.module.sequence}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'xd.module.sequence' in string value "${xd.module.sequence}" at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:211) at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:222) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:86) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:265)

из исходного кода я вижу, что он загружается файлом jmx mbean из xd и загружается ниже java-файла

https://github.com/spring-projects/spring-xd/blob/6923ee8705bd9c2c58ad73120724b8b87c5ba37d/spring-xd-dirt/src/main/resources/META-INF/spring-xd/plugins/jmx/mbean-exporters.xml

https://github.com/spring-projects/spring-xd/blob/e9ce8e897774722c1e61038817ebd55c5cf0befc/spring-xd-dirt/src/main/java/org/springframework/xd/dirt/plugins/MBeanExportingPlugin.java

Решение :

Я планирую ввести их из моего модуля s3. Правильно ли это сделать, пожалуйста, дайте мне знать, какие должны быть значения?

<context:mbean-export />



      <int-jmx:mbean-export object-naming-strategy="moduleObjectNamingStrategy" />

        <util:properties id="objectNameProperties">
            <prop key="group">${xd.group.name}</prop>
            <prop key="label">${xd.module.label}</prop>
            <prop key="type">${xd.module.type}</prop>
            <prop key="sequence">${xd.module.sequence}</prop>
        </util:properties>

        <bean id="moduleObjectNamingStrategy"
              class="org.springframework.xd.dirt.module.jmx.ModuleObjectNamingStrategy">
            <constructor-arg value="xd.${xd.stream.name:${xd.job.name:}}" />
            <constructor-arg ref="objectNameProperties" />
        </bean>

person constantlearner    schedule 29.12.2015    source источник


Ответы (1)


Это свойство должно быть автоматически установлено с помощью ModuleInfoPlugin.

Это второй раз, когда кто-то сказал, что свойство почему-то отсутствует.

Я открыл JIRA Issue.

person Gary Russell    schedule 29.12.2015
comment
Включите ведение журнала DEBUG для контейнера и зафиксируйте весь процесс, от запуска контейнера до развертывания, и прикрепите его к JIRA. - person Gary Russell; 29.12.2015
comment
Это способ изменить журнал отладки в файле spring-xd-1.2.1.RELEASE/xd/config xd-admin-logback.groovy и xd-container-logback.groovy и регистраторе строки (org.springframework, WARN) на DEBUG как для контейнера, так и для администратора? - person constantlearner; 29.12.2015
comment
да, но убедитесь, что все регистраторы отлажены (особенно o.s.xd.* и т. д., а также o.s.*). - person Gary Russell; 29.12.2015