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

Update microprofile examples to use microprofile-config.properties #2163

Merged
merged 3 commits into from
Jul 14, 2020

Conversation

barchetta
Copy link
Member

Changed these two examples to use microprofile-config.properties (and not application.yaml).

This required removing the integer array in config (supported by yaml, not properties).

@barchetta barchetta added this to the 2.0.2 milestone Jul 14, 2020
@barchetta barchetta self-assigned this Jul 14, 2020
@ljnelson
Copy link
Member

(Full disclaimer: haven't looked in detail at this.) MicroProfile Config does support arrays of things natively. For example, if this is in a ConfigSource somewhere:

foo.bar = 2,4,6,8

…or:

foo.bar = 2, 4, 6, 8

…and you include it like this:

@Inject
@ConfigProperty("foo.bar")
private int[] ints;

…or you get it like this:

final int[] ints = Config.getValue("foo.bar", int[].class);

…I believe it is supposed to be handled automatically by all conformant implementations (such as ours), though I'm typing off the cuff here so be kind in terms of syntax 😄 . Were you not seeing this?

@barchetta barchetta requested a review from ljnelson July 14, 2020 15:58
@barchetta
Copy link
Member Author

Put back int list in the example that used them.

```

By default the server will use a dynamic port, see the messages displayed
when the application starts.
Copy link
Member

Choose a reason for hiding this comment

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

Haven't looked deeply but down below you set the port to 7001, so will a dynamic port truly be used?

Copy link
Member Author

Choose a reason for hiding this comment

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

In the explicit example it uses a dynamic port. In the implicit example it uses 7001.

ljnelson
ljnelson previously approved these changes Jul 14, 2020
@barchetta barchetta merged commit 1ec8339 into helidon-io:master Jul 14, 2020
@barchetta barchetta deleted the microprofile-examples branch July 29, 2020 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants