Thread safety issue while using basicConsume in lambdas
brothergod1 opened this issue · 0 comments
I have a KeyCloak application which as you may know uses Hibernate for entity management. The reason why I mention it is that in DeliverCallback function the client tries to save user with the data provided in this notification, but instead of that it fails an throws an exception "IllegalStateException: Session / Entity Manager is closed". The exception is thrown only in case when the code that is responsible for saving a user is inside the DeliverCallback function and knowing that I might say that the thread safety here is doubtful. I also tries the way of polling the notifications, but it doesn't work properly. Is there any other way to subscribe for notifications except the polling and using the functional interface?