I am getting the error above when trying to publish in a SNS topic.
I'm using Java Spring Boot. My maven depencies are as follow:
<aws-java-sdk.version>1.12.674</aws-java-sdk.version>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>${aws-java-sdk.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- AWS SNS -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sns</artifactId>
<version>${aws-java-sdk.version}</version>
</dependency>
The class that publishes into topic is:
public void pubInBatch(List<PublishBatchRequestEntry> entries, String topicArn) {
try {
Log.logInfo("Iniciando conexão com SNS para envio dos dados ao DataMesh");
PublishBatchRequest request = new PublishBatchRequest()
.withTopicArn(topicArn)
.withPublishBatchRequestEntries(entries);
PublishBatchResult result = snsClient.publishBatch(request);
Log.logInfo("SNSDataMesh: Mensagens enviadas "
+ " Sucessos = " + result.getSuccessful().size()
+ " Falhas = " + result.getFailed().size());
} catch (AmazonSNSException e) {
Log.logError("Erro ao enviar mensagem para o SNS - Data Mesh" + e.getMessage(), e);
}
}
The error occurs on line PublishBatchResult result = snsClient.publishBatch(request); and nothing else is logged not even catched by exception.
The most weird thing is that I have another API with the same configurations and same version of dependencies that it's working and these one it's not.
Any help?