Due to default backoff/retry on notification failure my threads remain blocked for longer which impact the positive flow of my application. I don't want this retry or want to minimize it. The logic am using to create FirebaseApp is:
FileInputStream serviceAccount = new FileInputStream("fileName");
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.build();
FirebaseApp app = FirebaseApp.initializeApp(options, vendorId);
After that i set data and send request to FCM server as:
Message.Builder builder = Message.builder
.setToken(fcmToken);
//put required payload data
builder.putData("key", "value");
//Added android Configs
AndroidConfig androidConfigs = AndroidConfig.builder()
.setTtl(30000)
.setPriority(AndroidConfig.Priority.HIGH)
.build();
builder.setAndroidConfig(androidConfigs);
//sending request to FCM
app.sendAsync(builder.build(), false);
I read a suggestion, it was told that Retry-After
header will help in this, am not sure where to add in my code.
Please suggest me, Thanks in advance.