Package net.jodah.lyra.config

Examples of net.jodah.lyra.config.Config


  /**
   * Asserts that invocation failures are rethrown when a connection is shutdown and a connection
   * recovery policy is not set even when a channel recovery policy is set.
   */
  public void shouldThrowOnConnectionShutdownWithNoCxnRecoveryPolicy() throws Throwable {
    config = new Config().withRetryPolicy(RetryPolicies.retryAlways())
        .withConnectionRecoveryPolicy(RecoveryPolicies.recoverNever())
        .withChannelRecoveryPolicy(RecoveryPolicies.recoverAlways());
    performThrowableInvocation(retryableConnectionShutdownSignal());
    verifySingleInvocation();
  }
View Full Code Here


  /**
   * Asserts that invocation failures are rethrown when a channel is shutdown and a connection
   * recovery policy is set but a channel recovery policy is not.
   */
  public void shouldThrowOnConnectionShutdownWithNoChannelRecoveryPolicy() throws Throwable {
    config = new Config().withRetryPolicy(RetryPolicies.retryAlways())
        .withConnectionRecoveryPolicy(RecoveryPolicies.recoverAlways())
        .withChannelRecoveryPolicy(RecoveryPolicies.recoverNever());
    performThrowableInvocation(retryableConnectionShutdownSignal());
    verifyCxnCreations(2);
    verifyChannelCreations(1, 1);
View Full Code Here

   */
  public static ConfigurableConnection create(ConnectionOptions options, Config config)
      throws IOException {
    Assert.notNull(options, "options");
    Assert.notNull(config, "config");
    ConnectionHandler handler = new ConnectionHandler(options.copy(), new Config(config));
    ConfigurableConnection proxy = (ConfigurableConnection) Proxy.newProxyInstance(
        Connection.class.getClassLoader(), CONNECTION_TYPES, handler);
    handler.createConnection(proxy);
    return proxy;
  }
View Full Code Here

  public Firehose connect(StringInputRowParser firehoseParser) throws IOException
  {
    final StringInputRowParser stringParser = firehoseParser;

    ConnectionOptions lyraOptions = new ConnectionOptions(this.connectionFactory);
    Config lyraConfig = new Config()
        .withRecoveryPolicy(
            new RetryPolicy()
                .withMaxRetries(config.getMaxRetries())
                .withRetryInterval(Duration.seconds(config.getRetryIntervalSeconds()))
                .withMaxDuration(Duration.seconds(config.getMaxDurationSeconds()))
View Full Code Here

TOP

Related Classes of net.jodah.lyra.config.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.