Open dartartem opened 3 years ago
I realized that entities are in eventutate-tram-sagas and not indexed by jandex.
Solved by copying orders-and-customers to eventuate-tram-sagas-quarkus
Please provide more explanation including commit
Please provide more explanation including commit
Chris, as I wrote in the email, I need some time to prepare commit. I need to review, clean up, configure circle ci. I will do it tomorrow ASAP.
Explanation: Quarkus shows UnsatisfiedResolutionException because there are no entities visible to quarkus. To work with beans and entities they should be indexed by special plugin for quarkus: "org.kordamp.gradle.jandex" Since orders-and-customers module (that defines jpa entities) is located in original sagas project, it does not use jandex plugin. Jandex is quarkus only plugin, so, I don't think that it makes sense to use it in eventuate-tram-sagas, so I copied that module to eventuate-tram-sagas-quarkus project and applied jandex plugin there.
Jandex is quarkus only plugin, so, I don't think that it makes sense to use it in eventuate-tram-sagas, so I copied that module to eventuate-tram-sagas-quarkus project and applied jandex plugin there.
https://quarkus.io/guides/cdi-reference says:
If you can’t modify the dependency, you can still index it by adding quarkus.index-dependency entries to your application.properties:
Yes, jandex creates index automatically. Probably I can create index manually, but I am not sure that is better than adding jandex plugin to orders-and-customers in original sagas project.
To summarize, we have following options:
I would prefer the first option. If you prefer 3 option, please confirm.
If you can’t modify the dependency, you can still index it by adding quarkus.index-dependency entries to your application.properties:
My interpretation of this sentence is that eventuate-tram-sagas/orders-and-customers is a dependency of eventuate-tram-sagas-quarkus. You could therefore index eventuate-tram-sagas/orders-and-customers by adding the necessary entries to eventuate-tram-sagas-quarkus's application.properties.
I indexed orders-and-customers by adding this:
quarkus.index-dependency.orders-and-customers.group-id=io.eventuate.tram.sagas
quarkus.index-dependency.orders-and-customers.artifact-id=orders-and-customers
to application.properties.
But there is one thing.
We have following dependency chain:
orders-and-customers (original saga) -> orders-and-customers-quarkus -> orders-and-customers-quarkus-integration-tests
To solve the issue, I needed to specify properties in both modules. Otherwise, if specify only in one place, no matter which one, the error appears.
Everything is configured as in eventuate-tram-quarkus-examples-customers-and-orders. However when I am trying to use EntityManager I am getting this:
Found this: https://github.com/quarkusio/quarkus/issues/11483
I realized that entities are in eventutate-tram-sagas and not indexed by jandex.
Solved by copying orders-and-customers to eventuate-tram-sagas-quarkus