streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Blackmon (JIRA)" <>
Subject [jira] [Created] (STREAMS-223) streams-monitoring exception when streamConfig not set
Date Fri, 14 Nov 2014 06:35:34 GMT
Steve Blackmon created STREAMS-223:

             Summary: streams-monitoring exception when streamConfig not set
                 Key: STREAMS-223
             Project: Streams
          Issue Type: Bug
            Reporter: Steve Blackmon

LocalStreamBuilder supports a default execution even when streamConfig is empty/null

StreamBuilder builder = new LocalStreamBuilder(100);

streams-monitoring throws an exception and does not run when no config is supplied.

00:31:21.762 [main] ERROR o.a.s.m.tasks.BroadcastMonitorThread - Exception while trying to
set default broadcast thread wait time: {}
java.lang.NullPointerException: null
	at org.apache.streams.monitoring.tasks.BroadcastMonitorThread.setWaitTime(
	at org.apache.streams.monitoring.tasks.BroadcastMonitorThread.<init>(
	at org.apache.streams.twitter.example.TwitterUserstreamConsole.main(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_20]
	at sun.reflect.NativeMethodAccessorImpl.invoke( ~[na:1.8.0_20]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke( ~[na:1.8.0_20]
	at com.intellij.rt.execution.application.AppMain.main( [idea_rt.jar:na]
00:31:21.773 [main] DEBUG - Attaching shutdown handler

The workaround is to supply a config like this:
        Map<String, Object> streamConfig = Maps.newHashMap();
        streamConfig.put(LocalStreamBuilder.TIMEOUT_KEY, 20 * 60 * 1000);
        streamConfig.put("monitoring_broadcast_interval_ms", -1);
        StreamBuilder builder = new LocalStreamBuilder(100, streamConfig);

But that should not be necessary.  

Establish documented defaults for this capability, ensure no exceptions occur in the default
state, and do not require explicit action by the implementation to use the default.

This message was sent by Atlassian JIRA

View raw message