If you encountered a problem, bug, issue, or simply have a question.
Hi Everyone,
We have entity that gets updated from another source using REST API. We have registered a listener for entitychanged events of that entity in the middleware. Whenever we receive after commit event we send an event to web module using global events add on.
In this flow at times we observed that the REST API which is invoked from another source is not returning.
Below is the code snipped in middleware for entity change event
@Async
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
private void afterCommit(EntityChangedEvent<Submission, Long> event) {
String message = "Submission:"+event.getEntityId().getValue().toString();
events.publish(new UiNotificationEvent(this, Strings.isNullOrEmpty(message) ? "test" : message));
}
Below are the logs:
2022-03-22 14:42:43.632 DEBUG [default task-79/app-core/admin] com.haulmont.cuba.core.app.RdbmsStore - load: metaClass=rioc_Submission, id=54273, view=com.entity.Submission/
2022-03-22 14:42:43.632 DEBUG [default task-79/app-core/admin] com.haulmont.cuba.core.app.RdbmsStore - commit: commitInstances=[entity.Submission-54273 [detached]], removeInstances=[]
2022-03-22 14:42:43.648 DEBUG [default task-79/app-core/admin] com.haulmont.addon.globalevents.core.WebSocketServer - Sending UiNotificationEvent{message=‘Submission:54273’, source=SubmissionEntityChangeListener@5bdd06db} to {WebSocketServerSockJsSession[id=b0d12d67e04841b6af60096ac1faeb27]=true, WebSocketServerSockJsSession[id=d8d710ec692f40d3820018e4c4983f87]=true}
2022-03-22 14:42:43.648 DEBUG [default task-79/app-core/admin] com.haulmont.addon.globalevents.core.WebSocketServer - Sending message TextMessage payload=[rO0ABXNyAC…], byteCount=740, last=true] to WebSocketServerSockJsSession[id=b0d12d67e04841b6af60096ac1faeb27]
2022-03-22 14:43:16.523 INFO [default task-80/app-core/server] com.haulmont.cuba.security.auth.AuthenticationManagerBean - Logged in:
After the event is sent to web module the application is hanged and there are logs for about 1minute.
This issue is happening randomly.
Could you please help us in resolving the issue.
We are using cuba platfrom 7.0.12
Thanks in advance for the support.