Size: a a a

Spring Framework and more

2019 November 26

T

Tom in Spring Framework and more
I think that the package scan doesnt work
источник

T

Tom in Spring Framework and more
I just removed the userRepoImpl and now I get the exception
источник

T

Tom in Spring Framework and more
Caused by: java.lang.IllegalArgumentException: Not a managed type: class DOMAIN.User
at org.hibernate.metamodel.internal.MetamodelImpl.managedType(MetamodelImpl.java:552)
at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.<init>(JpaMetamodelEntityInformation.java:74)
at org.springframework.data.jpa.repository.support.JpaEntityInformationSupport.getEntityInformation(JpaEntityInformationSupport.java:66)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getEntityInformation(JpaRepositoryFactory.java:188)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:139)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:123)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:64)
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:305)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:297)
at org.springframework.data.util.Lazy.getNullable(Lazy.java:211)
at org.springframework.data.util.Lazy.get(Lazy.java:94)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:300)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:119)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1821)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1758)
... 53 more
источник

И

Илья in Spring Framework and more
источник

T

Tom in Spring Framework and more
yeah just tried that, not working haha
источник

М

Михаил in Spring Framework and more
Check your configs. Both of them contains @Bean that return PlatformTransactionManager
When you try to create a bean named 'demoRepositoryImpl' Spring doesn't know about what entityManager should be used for autowiring
источник

T

Tom in Spring Framework and more
Михаил
Check your configs. Both of them contains @Bean that return PlatformTransactionManager
When you try to create a bean named 'demoRepositoryImpl' Spring doesn't know about what entityManager should be used for autowiring
I gave both PlatformTransactionManagers a Bean with a unique name
источник

T

Tom in Spring Framework and more
Shouldnt that solve the problem?
источник

М

Михаил in Spring Framework and more
You must specify the exact bean when autowiring in your repo, because you have two candidates
источник

T

Tom in Spring Framework and more
Михаил
You must specify the exact bean when autowiring in your repo, because you have two candidates
and how to do that?
источник

АС

Андрей Силютин in Spring Framework and more
Tom
and how to do that?
источник

АС

Андрей Силютин in Spring Framework and more
"Notice how we're using the ... Primary TransactionManager – by annotating .. with @Primary. That's helpful whenever we're going to implicitly or explicitly inject the transaction manager without specifying which one by name."
источник

T

Tom in Spring Framework and more
So with @Transactional? I am already doing that
источник

АС

Андрей Силютин in Spring Framework and more
источник

T

Tom in Spring Framework and more
I already have that in my config classes
источник

T

Tom in Spring Framework and more
ok I managed to fix the not managed type. it seems like it is working if I dont have the impl classes of my repos.  
The bug must be there
источник

М

Михаил in Spring Framework and more
I think your manually created impl classes break default spring jpa behaviour, it is not a bug
источник

T

Tom in Spring Framework and more
Михаил
I think your manually created impl classes break default spring jpa behaviour, it is not a bug
Yeah probably, which sucks because i need it
источник

RS

Ruslan Stelmachenko in Spring Framework and more
Все именно так. Каждый вебсокет открывает соденинение браузер<->сервер и сервер<->брокер. Плюс есть одно служебное соединение сервер<->брокер. Т.е. всего к брокеру от сервера будет кол-во_вебсокетов+1 соединений.

Да, не лучшая архитектура...

А если еще учесть, что веб-сокеты обычно используют для pub/sub, и в каждом веб-сокете подписываются не на 1, а на много топиков, то при такой архитектуре MQ брокеру еще и очередей нужно создать столько, сколько подписок на разные топики в каждом веб-сокете * кол-во активных веб-сокетов.

Rabbit, например, очень плохо уже себя чувствует, когда 10к юзеров поднимают по одному вебсокету и каждый подписывается на всего лишь 5 топиков. У раббита это уже 50к созданных очередей и биндингов. Ну и 10к открытых TCP-соединений, конечно.

Так что даже если написать свой релей с пулингом конекшенов, чтобы раббит не задалбывать кучей разных TCP-соединений, остаетс проблема с огромным кол-во биндингов и очередей. Как с этим справляется AmazonMQ сказать не могу.
источник

AA

Alexey Astashenko in Spring Framework and more
Ruslan Stelmachenko Спасибо за ответ! Можете что-нибудь посоветовать в данном случае? spring messaging websocket вообще юзабелен в таком виде в котором он есть сейчас? Для более-менее загруженный системы
источник