@Test public void maxRetryDelay() { StreamConfiguration et = new StreamConfiguration(); try { et.maxRetryDelay( TimeUnit.SECONDS.toMillis(StreamConnectionRetryFlowable.DEFAULT_MIN_DELAY_SECONDS) - 1, TimeUnit.MILLISECONDS); fail("did not throw on very low max delay"); } catch (IllegalArgumentException ignored) { } et.maxRetryDelay(TimeUnit.SECONDS.toMillis(StreamConnectionRetryFlowable.DEFAULT_MIN_DELAY_SECONDS), TimeUnit.MILLISECONDS); et.maxRetryDelay(TimeUnit.SECONDS.toMillis(StreamConnectionRetryFlowable.DEFAULT_MIN_DELAY_SECONDS) + 1, TimeUnit.MILLISECONDS); }
public StreamConfiguration maxRetryDelay(long maxRetryDelay, TimeUnit unit) throws IllegalArgumentException { NakadiException.throwNonNull(unit, "Please provide a time unit for max retry delay"); if (TimeUnit.SECONDS.toMillis(minRetryDelay) > unit.toMillis(maxRetryDelay)) { throw new IllegalArgumentException( "supplied max delay cannot be less than " + minRetryDelay + "s"); } this.maxRetryDelay = unit.toSeconds(maxRetryDelay); return this; }
StreamConfiguration { public StreamConfiguration maxRetryDelay(long maxRetryDelay, TimeUnit unit) throws IllegalArgumentException { NakadiException.throwNonNull(unit, "Please provide a time unit for max retry delay"); if (TimeUnit.SECONDS.toMillis(minRetryDelay) > unit.toMillis(maxRetryDelay)) { throw new IllegalArgumentException( "supplied max delay cannot be less than " + minRetryDelay + "s"); } this.maxRetryDelay = unit.toSeconds(maxRetryDelay); return this; } }
StreamConfiguration { public StreamConfiguration maxRetryDelay(long maxRetryDelay, TimeUnit unit) throws IllegalArgumentException { NakadiException.throwNonNull(unit, "Please provide a time unit for max retry delay"); if (TimeUnit.SECONDS.toMillis(minRetryDelay) > unit.toMillis(maxRetryDelay)) { throw new IllegalArgumentException( "supplied max delay cannot be less than " + minRetryDelay + "s"); } this.maxRetryDelay = unit.toSeconds(maxRetryDelay); return this; }  }
StreamConfiguration { public StreamConfiguration maxRetryDelay(long maxRetryDelay, TimeUnit unit) throws IllegalArgumentException { NakadiException.throwNonNull(unit, "Please provide a time unit for max retry delay"); if (TimeUnit.SECONDS.toMillis(minRetryDelay) > unit.toMillis(maxRetryDelay)) { throw new IllegalArgumentException( "supplied max delay cannot be less than " + minRetryDelay + "s"); } this.maxRetryDelay = unit.toSeconds(maxRetryDelay); return this; }  String eventTypeName(); StreamConfiguration eventTypeName(String topic); String subscriptionId(); StreamConfiguration subscriptionId(String subscriptionId); long connectTimeoutMillis(); StreamConfiguration connectTimeout(long timeout, TimeUnit unit); long readTimeoutMillis(); StreamConfiguration readTimeout(long timeout, TimeUnit unit); long maxUncommittedEvents(); StreamConfiguration maxUncommittedEvents(long maxUncommittedEvents); int batchLimit(); StreamConfiguration batchLimit(int batchLimit); int streamLimit(); StreamConfiguration streamLimit(int streamLimit); long batchFlushTimeoutSeconds(); StreamConfiguration batchFlushTimeout(long batchFlushTimeout, TimeUnit unit); long streamTimeoutSeconds(); StreamConfiguration streamTimeout(long streamTimeout, TimeUnit unit); long commitTimeoutSeconds(); StreamConfiguration commitTimeout(long commitTimeout, TimeUnit unit); int streamKeepAliveLimit(); StreamConfiguration streamKeepAliveLimit(int streamKeepAliveLimit); Optional<List<Cursor>> cursors(); StreamConfiguration cursors(Cursor... cursors); StreamConfiguration cursor(Cursor cursor); long maxRetryDelaySeconds(); StreamConfiguration maxRetryDelay(long maxRetryDelay, TimeUnit unit); int maxRetryAttempts(); StreamConfiguration maxRetryAttempts(int maxRetryAttempts); Map<String, String> requestHeaders(); StreamConfiguration requestHeaders(Map<String, String> headers); StreamConfiguration requestHeader(String name, String value); StreamConfiguration batchBufferCount(int eventBufferSize); int batchBufferCount(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
StreamConfiguration { public StreamConfiguration maxRetryDelay(long maxRetryDelay, TimeUnit unit) throws IllegalArgumentException { NakadiException.throwNonNull(unit, "Please provide a time unit for max retry delay"); if (TimeUnit.SECONDS.toMillis(minRetryDelay) > unit.toMillis(maxRetryDelay)) { throw new IllegalArgumentException( "supplied max delay cannot be less than " + minRetryDelay + "s"); } this.maxRetryDelay = unit.toSeconds(maxRetryDelay); return this; }  String eventTypeName(); StreamConfiguration eventTypeName(String topic); String subscriptionId(); StreamConfiguration subscriptionId(String subscriptionId); long connectTimeoutMillis(); StreamConfiguration connectTimeout(long timeout, TimeUnit unit); long readTimeoutMillis(); StreamConfiguration readTimeout(long timeout, TimeUnit unit); long maxUncommittedEvents(); StreamConfiguration maxUncommittedEvents(long maxUncommittedEvents); int batchLimit(); StreamConfiguration batchLimit(int batchLimit); int streamLimit(); StreamConfiguration streamLimit(int streamLimit); long batchFlushTimeoutSeconds(); StreamConfiguration batchFlushTimeout(long batchFlushTimeout, TimeUnit unit); long streamTimeoutSeconds(); StreamConfiguration streamTimeout(long streamTimeout, TimeUnit unit); long commitTimeoutSeconds(); StreamConfiguration commitTimeout(long commitTimeout, TimeUnit unit); int streamKeepAliveLimit(); StreamConfiguration streamKeepAliveLimit(int streamKeepAliveLimit); Optional<List<Cursor>> cursors(); StreamConfiguration cursors(Cursor... cursors); StreamConfiguration cursor(Cursor cursor); long maxRetryDelaySeconds(); StreamConfiguration maxRetryDelay(long maxRetryDelay, TimeUnit unit); int maxRetryAttempts(); StreamConfiguration maxRetryAttempts(int maxRetryAttempts); Map<String, String> requestHeaders(); StreamConfiguration requestHeaders(Map<String, String> headers); StreamConfiguration requestHeader(String name, String value); StreamConfiguration batchBufferCount(int eventBufferSize); int batchBufferCount(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }