Open lucazin opened 9 months ago
now.. 7 listeners and loss 1 and after 7 again..
the problem is stop working some principal listeners.
Im trying to do this
dbfirestore = FirestoreClient.getFirestore(); dbfirestore.getOptions().toBuilder().setChannelProvider( FirestoreOptions.getDefaultTransportChannelProviderBuilder() .setPoolSize(2).build());
Again, we are having a strange behavior of listeners. We have 7 listeners active and some time just 6..just 5.. and back to 7 ..but with this behavior we can put our plataform in production stage.
Java
implementation 'com.google.firebase:firebase-admin:9.1.1'
Resource resource = resourceLoader.getResource("classpath:prod-firebase.json"); String fileLines = new BufferedReader(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8)) .lines() .collect(Collectors.joining()); InputStream serviceAccount = new ByteArrayInputStream(fileLines.getBytes());
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("realtimedatabaseurl") //we are using realtimedatabase
.build();
FirebaseApp.initializeApp(options);
databaseReference = FirebaseDatabase.getInstance().getReference();
dbfirestore = FirestoreClient.getFirestore(); // firestore instance
if we change te firestore instance to this line
dbfirestore = FirestoreClient.getFirestore(); dbfirestore.getOptions().toBuilder().setChannelProvider( FirestoreOptions.getDefaultTransportChannelProviderBuilder() .setPoolSize(2).build());
will change something?
Can you describe the execution environment? Is this running in an EC2 container or something?
Are there any exceptions in the Java logs?
Lets Go.
No exception, just stop listening..
Im running a API in SpringBoot inside a EC2 Linux ( Normal Java Application API) work like a charm no problem with the api. I have added firebase admin in dependecy gradle (like google said) I have the credentials by service account, like google explain.
The realtime database work good! firestore work too but some times the listener drop, i know because the document is not deleted from collection and not saving in database inside API.
This is NOT expected behavior because listener drop and not delete other 500 messages.. its not equals count read, write, delete..
This is right EXPECTED behavior, because listener is active, read, process and delete ..
I have 7 listeners and this is expected, not drop
But this behavior is not expected
I will try to put this code and check if resolve something, i will set pool size 2.. but i thinks is not necessary.. we talking about 7 listeners only..
dbfirestore = FirestoreClient.getFirestore(); dbfirestore.getOptions().toBuilder().setChannelProvider( FirestoreOptions.getDefaultTransportChannelProviderBuilder() .setPoolSize(2).build());
im glad someone can help me resolve my problem with firestore.
i did now a stress work load... i send a lot request to a specific listener and this is the behavior.
Drop a lot os listeners.. @gregfenton i have to restart the server to back the listeners again..
if i have a higher workload.. firestore drop the listener..
@schmidt-sebastian @lanbochen is related with this issue? ( the difference is nodejs to java )
i change my code just to check the workload.
for(int i=0;i<=50;i++) new DBFireStore().SendOrdersTransport(onFinishedListener,context,orderItens);
my listener drop after run this.. i put for just to see ..but original code dont have.. but when users are send orders in high scale happen the same thing..
the problem is higher workload .. i check three times the workload and if we see the listener drop when the workload if high. the clock below each graph show us.. everytime have a peak drop listener.
now..i dont know what to do.. :(
im using this
https://firebase.google.com/docs/admin/setup#java
implementation 'com.google.firebase:firebase-admin:9.2.0'
@gregfenton
Issue related : https://github.com/googleapis/google-cloud-java/issues/3514
I have this kind of problem @schmidt-sebastian
i have 7 listeners, but always disconnecting some listeners and stop registering information in database. Im using Java.
What i have to do..to stop this behavior..?? because its intermitent situation.
I have to move to realtime database? or have some config extra to fix that? Because when i restart the server the listener back again..
Can someone help me?