consumer/src/main/java/net/devfront/aws/sqslambda/consumer/service/impl/DequeueServiceImpl.java
/**
     * Invoke worker lambda to do the work.
     *
     * @param payload the payload
     */
Invoke worker lambda to do the work.
@param payload the payload
Invoke worker lambda to do the work . @param payload the payload
private void invokeWorkerLambda(String payload) {
        InvokeRequest invokeRequest = new InvokeRequest()
            .withFunctionName(consumerConfig.getWorkerLambdaName())
            .withInvocationType(InvocationType.Event)
            .withPayload(ByteBuffer.wrap(payload.getBytes()));
        Future<InvokeResult> futureResult = awsLambdaAsync.invokeAsync(invokeRequest);
        try {
            InvokeResult invokeResult = futureResult.get();
            logger.info("Invoke worker lambda, STATUS_CODE={}", invokeResult.getStatusCode());
        } catch (InterruptedException|ExecutionException e) {
            logger.error("Error on invoking worker lambda, {}", e.getMessage());
        }
    }
private void invokeWorkerLambda ( String payload ) { InvokeRequest invokeRequest = new InvokeRequest ( ) . withFunctionName ( consumerConfig . getWorkerLambdaName ( ) ) . withInvocationType ( InvocationType . Event ) . withPayload ( ByteBuffer . wrap ( payload . getBytes ( ) ) ) ; Future < InvokeResult > futureResult = awsLambdaAsync . invokeAsync ( invokeRequest ) ; try { InvokeResult invokeResult = futureResult . get ( ) ; logger . info ( "Invoke worker lambda, STATUS_CODE={}" , invokeResult . getStatusCode ( ) ) ; } catch ( InterruptedException | ExecutionException e ) { logger . error ( "Error on invoking worker lambda, {}" , e . getMessage ( ) ) ; } }
Invoke worker lambda to do the work.
Invoke worker lambda to do the work .