void run()

in pekko-connectors-sample-sqs-java/src/main/java/alpakka/sample/sqssample/PublishToSqs.java [38:53]


    void run() throws Exception {
        // create SQS client
        String sqsEndpoint = "http://localhost:9324";
        SqsAsyncClient sqsClient =
                SqsAsyncClient.builder()
                        .credentialsProvider(
                                StaticCredentialsProvider.create(AwsBasicCredentials.create("x", "x")))
                        .endpointOverride(URI.create(sqsEndpoint))
                        .region(Region.EU_CENTRAL_1)
                        .httpClient(AkkaHttpClient.builder().withActorSystem(system.classicSystem()).build())
                        .build();
        system.getWhenTerminated().thenAccept((notUsed) -> sqsClient.close());

        publishMessageToSourceTopic(sqsClient, "{\"id\":423,\"name\":\"Alpakka\"}")
                .thenAccept(done -> system.terminate());
    }