Open heruan opened 2 years ago
Spring beans cannot be serialized so they can't be used as topic data. One workaround is to use a Spring bean that provides the data you need in topic, e.g.
public class SomeView extends VerticalLayout {
public SomeView(@Autowired UserInfoProvider localUserProvider) {
UserInfo localUser = localUserProvider.get();
CollaborationEngine.getInstance().openTopicConnection(this, localUser, "topic", conn -> {
conn.getNamedList("users").add(localUser);
});
}
}
The exception message might provide more context and possibly suggest this workaround.
Describe the bug Spring enhanced beans fails serialization when added to topic data structures.
To Reproduce Steps to reproduce the behavior:
Expected behavior The bean is added to the topic.
Versions
Additional context The following code throws the exception below.