private void invokeScannerOnSegment(final int segment, final String startScore) { new Thread() { @Override public void run() { SegmentScanner scanner = LambdaInvokerFactory.build( SegmentScanner.class, lambda); SegmentScannerInput input = new SegmentScannerInput(); input.setSegment(segment); input.setTotalSegments(totalSegments); input.setMaxConsumedCapacity(maxConsumedCapacityPerSegment); input.setStartScore(startScore); scanner.scanSegment(input); } }.start(); }
public TestResult run() { final LambdaSeleniumService lambdaService = LambdaInvokerFactory.builder() .lambdaClient(AWSLambdaClientBuilder.defaultClient()) .build(LambdaSeleniumService.class); return lambdaService.runTest(request); }
FeignLambdaServiceInvokerClient(LambdaInvokerFactory.Builder builder, AWSLambda awsLambdaClient, String functionName, String functionAlias, String functionVersion) { requireNonNull(awsLambdaClient); requireNonNull(functionName); service = builder .lambdaFunctionNameResolver((method, annotation, config) -> functionName) .functionAlias(functionAlias) .functionVersion(functionVersion) .lambdaClient(awsLambdaClient) .build(LambdaInvokerService.class); }
@BeforeEach public void setup() { lambdaInvokerFactoryBuilder = mock(LambdaInvokerFactory.Builder.class); when(lambdaInvokerFactoryBuilder.lambdaFunctionNameResolver(any())).thenReturn(lambdaInvokerFactoryBuilder); when(lambdaInvokerFactoryBuilder.functionAlias(any())).thenReturn(lambdaInvokerFactoryBuilder); when(lambdaInvokerFactoryBuilder.functionVersion(any())).thenReturn(lambdaInvokerFactoryBuilder); when(lambdaInvokerFactoryBuilder.lambdaClient(any())).thenReturn(lambdaInvokerFactoryBuilder); when(lambdaInvokerFactoryBuilder.build(LambdaInvokerService.class)).thenReturn(service); }
public FeignLambdaServiceInvokerClient(@Nonnull AWSLambda awsLambdaClient, @Nonnull String functionName, @Nullable String functionAlias, @Nullable String functionVersion) { this(LambdaInvokerFactory.builder(), awsLambdaClient, functionName, functionAlias, functionVersion); }
/** * Creates a proxy instance of a supplied interface that contains methods annotated with * {@link LambdaFunction}. Provides automatic credential support to authenticate with an IAM * access keys using {@link BasicSessionCredentials} auto-configured from Spring Boot * configuration properties in {@link AmazonProperties}. * * @param type * @param <T> * @return */ public <T> T getFunctionInstance(Class<T> type) { return LambdaInvokerFactory.builder() .lambdaClient(AWSLambdaClientBuilder.standard() .withRegion(Regions.US_EAST_1) .withCredentials(new LambdaCredentialsProvider(amazonProperties)) .build()) .build(type); }