-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quarkus Mongodb change stream resume token always null in native #17878
Comments
/cc @evanchooly, @loicmathieu |
A reproducer can be found here: https://mega.nz/file/HUtkiCoS#k0DwHLTbSAoJ6SZ0xE_o5ounfCcvVyEfYsULYc7n-pI |
@AndreaCuiuli can you provide a JUNit test case inside your reproducer project or at least some step to reproduce the issue ? |
@AndreaCuiuli I successfully reproduce the error, the Meanwhile, you can workaround the issue by creating a class that will register the class, for eg:
|
@AndreaCuiuli in fact this has already been fixed in 1.13.5, can you try with the latest 1.13 version, should be 1.13.7.Final, and confirmed it works? |
@loicmathieu Thanks for the update, I will try and let you know! |
Hi @loicmathieu, I've made a test with the version 1.13.7.Final but the resumeToken is still null. [com.tea.eve.eve.EventListener] (async-channel-group-0-handler-executor) Saving resume token for message ChangeStreamDocument{ operationType=OperationType{value='delete'}, resumeToken=null, namespace=teascannerDb.mongoEvent, destinationNamespace=null, fullDocument=null, documentKey={"_id": {"orderId": "60be8d8ba1d87b4bf012445c", "type": "WAITING_ORDER_REMINDER"}}, clusterTime=Timestamp{value=6976499491255877633, seconds=1624342867, inc=1}, updateDescription=null, txnNumber=null, lsid=null} As you can see even with this version it's null. |
The workaround that you suggested worked fine though. I created this class
And the resume token is not null anymore |
@AndreaCuiuli I may have a any why it's happening, meanwhile you can still use the workaround I suggested. |
Fixes quarkusio#17878 (cherry picked from commit 732b2a7)
Describe the bug
I'm building a quarkus app that uses the mongodb change streams functionality with the reactive client.
If I start the application locally from Intellij everything works fine but when I build the native app and try to save the resume token it's always null.
I use this command to build the native app since I need to build it locally on windows and delpoy it on heroku:
This is the class and method where I initialize the change stream and start the watch on the collection
And this is the listener method
The problem is in the message.getResumeToken() method, if I start the application non native than the resume token is present and I can save it without problems, but when I build it native and put it in a container the resume token is always null.
Without resume token the change streams are almost useless since Iit's not possible to recover missing events if a problem occurs or appplication needs to be restarted.
Expected behavior
The resume token using the getResumeToken method of the ChangeStreamDocument class should not return null in native mode.
Actual behavior
The resume token using the getResumeToken method of the ChangeStreamDocument class is always null in native mode.
To Reproduce
Steps to reproduce the behavior:
Environment (please complete the following information):
Output of
java -version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment GraalVM CE 21.0.0 (build 11.0.10+8-jvmci-21.0-b06)
OpenJDK 64-Bit Server VM GraalVM CE 21.0.0 (build 11.0.10+8-jvmci-21.0-b06, mixed mode, sharing)
Quarkus version or git rev
1.13.6.Final
The text was updated successfully, but these errors were encountered: