storm初始化Bolt实例,spring bean绑定失败原因排查

 
public static final String METRICS_AGGREGATE_PERIOD_MILLISECONDS = "metrics.storm.aggregate.period.milliseconds";
    @Value("${" + METRICS_AGGREGATE_PERIOD_MILLISECONDS + "}")
    private long metricsAggregateIntervalMilliSeconds;
上面这样书写,Bolt实例化后metricsAggregateIntervalMilliSeconds的值为null

 

public static final String METRICS_AGGREGATE_PERIOD_MILLISECONDS = "metrics.storm.aggregate.period.milliseconds";
    @Value("${" + METRICS_AGGREGATE_PERIOD_MILLISECONDS + "}")
    private transient long metricsAggregateIntervalMilliSeconds;

 

上面这样写,Bolt实例化后metricsAggregateIntervalMilliSeconds的值为0

 

public static final String METRICS_AGGREGATE_PERIOD_MILLISECONDS = "metrics.storm.aggregate.period.milliseconds";
    @Value("${" + METRICS_AGGREGATE_PERIOD_MILLISECONDS + "}")
    private long metricsAggregateIntervalMilliSeconds;

这样写就正常了.

原因未知,先记上,稍后排查.

posted @ 2015-07-27 22:26  剣の心  阅读(686)  评论(0编辑  收藏  举报