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;
这样写就正常了.
原因未知,先记上,稍后排查.