firebase / firebase/firebase-admin-node

[FR]Use multiplexing over HTTP2 in sendEachForMulticast method for batch push.

Offen
#2,488 22 Kommentare 14 Reaktionen 1 zugewiesene Person Beansprucht von @jonathanedey Auf GitHub ansehen
api: messaging type: feature request
Vorherrschende Sprache
TypeScript
Sterne
1.7k
Forks
419
Ø Merge
3 T. 10 Std.
Gemergte PRs (30 T.)
16

Beschreibung

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
When I upgrade fcm to Http V1, the speed will become very slow when using sendEachForMulticast in firebase-admin:9.2.0.
Isn't HTTP/2 used in the SDK?

**Describe the solution you'd like**
Convert bulk send in SDK to HTTP/2.

**Describe alternatives you've considered**
Keep the original sendMulticast method.

**Additional context**
According to the database conditions, users (hundreds of thousands) who meet the sending conditions are selected for message push.
If the current sendEachForMulticast is used, it will be a nightmare.
The following code took 15 seconds to execute.
```
List registrationTokens = new ArrayList<>();
for (int i = 1; i <= 500; i++) {
registrationTokens.add(TOKEN + i);
}

MulticastMessage message = MulticastMessage.builder()
.setNotification(Notification.builder().setTitle("test title").setBody("test body").build())
.addAllTokens(registrationTokens).build();
BatchResponse response = FirebaseMessaging.getInstance().sendEachForMulticast(message);
System.out.println(response.getSuccessCount() + " messages were sent successfully");
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.