Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #9 to add config to register classes #17

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

zhfeng
Copy link
Contributor

@zhfeng zhfeng commented Nov 5, 2024

No description provided.

@zhfeng zhfeng requested a review from a team as a code owner November 5, 2024 05:47
@zhfeng zhfeng force-pushed the issue_9_config_regiser_classes branch from 51b16d9 to 1f79b9a Compare November 5, 2024 05:57


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_FURY_REGISTER_CLASSES__REGISTER_CLASS_NAME__CLASS_ID+++[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Environment variable: env_var_with_copy_button:+++QUARKUS_FURY_REGISTER_CLASSES__REGISTER_CLASS_NAME__CLASS_ID+++[]
Environment variable: env_var_with_copy_button:+++QUARKUS_FURY_REGISTER_CLASSES_REGISTER_CLASS_NAME_CLASS_ID+++[]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, This is generated by quarkus-maven-plugin. I think the double _ means that the users need to replace it with the real class name. So the environment looks like QUARKUS_FURY_REGISTER_CLASSES__io.quarkiverse.fury.it.Foo__CLASS_ID.

@gastaldi is it right? I assume that this is similar with the logger configuration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @zhfeng is right

@@ -0,0 +1,2 @@
quarkus.fury.register-class-names=io.quarkiverse.fury.it.Struct
quarkus.fury.register-classes."io.quarkiverse.fury.it.Foo".class-id=300
Copy link
Contributor

@chaokunyang chaokunyang Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you share en exmaple how to configure multiple class with class id and serializer in application.properties?

Does it look like following code? If so, I perfer name configuration key as register-class instead of register-classes

quarkus.fury.register-classes."io.quarkiverse.fury.it.Foo".class-id=300
quarkus.fury.register-classes."io.quarkiverse.fury.it.Foo".serialize=io.quarkiverse.fury.it.FooSerializer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use register_classes instead of register-classes, will quarkus still parse config correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it look like following code? If so, I perfer name configuration key as register-class instead of register-classes

Yeah, it is. I can change it to register-class.

If we use register_classes instead of register-classes, will quarkus still parse config correctly?

No, it will not. I think Quarkus uses microprofile config spec.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, let's change to register-class. And it would be great if we can add a serializer config here for test

Copy link
Contributor

@chaokunyang chaokunyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhfeng zhfeng merged commit 285962a into quarkiverse:main Nov 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants