You would have needed a get(0) only if the promise wrapped some collection like List and you needed to get its first element. In your code, you do not need that.
From where did you get that code? Blocking the Promise (with the get(5000)) is not something that you want to do, because it fails the idea of using an execution context (customServiceExecContext) where you run the blocking code. What you should do instead is to map over the Promise to do something with the result. In your case, it looks like you don’t even need to map:
public F.Promise<Integer> sendEvent(JsonNode jsonMessage) {
return F.Promise.promise(() -> {
Event record = new Event("Category1", jsonMessage);
int failedCount = <<ExternalService>>.sendEvent(record);
return failedCount;
}, customServiceExecContext);
}
Notice how the return is now a Promise instead of a plain int.