issue in spring xd cluster when deploying my module

♀尐吖头ヾ 提交于 2020-01-05 16:49:19

问题


I have a module s3-puller which pulls file from was s3 .In the production i am facing some issue when i try to create a stream.But local single node it works fine and i tried to set up 3 node cluster and 1 admin node in local it works fine. Below is my application context

<?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);
        }
    }

I am getting below exception when i try to create a basic stream

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

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

I get below exception

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)

from the source code i see that its loaded by jmx mbean file of xd and loaded by below java file

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

Solution :

I am planning to inject them from my s3 module .Is it right way to do please let me know what should be the values?

<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>

回答1:


That property should be automatically set up by the ModuleInfoPlugin.

This is the second time someone has said that property is missing somehow.

I have opened a JIRA Issue.



来源:https://stackoverflow.com/questions/34514393/issue-in-spring-xd-cluster-when-deploying-my-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!