Skip to content

Commit

Permalink
Make sure JsonbConfigCustomizers are sorted by @priority
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Jul 11, 2022
1 parent de2bbb2 commit 17c0497
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package io.quarkus.jsonb;

import java.util.List;

import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.Produces;
import javax.inject.Singleton;
import javax.json.bind.Jsonb;
import javax.json.bind.JsonbBuilder;
import javax.json.bind.JsonbConfig;

import io.quarkus.arc.All;
import io.quarkus.arc.DefaultBean;

@Singleton
Expand All @@ -16,7 +18,7 @@ public class JsonbProducer {
@Produces
@Dependent //JsonbConfig is not thread safe so it must not be made singleton.
@DefaultBean
public JsonbConfig jsonbConfig(Instance<JsonbConfigCustomizer> customizers) {
public JsonbConfig jsonbConfig(@All List<JsonbConfigCustomizer> customizers) {
JsonbConfig jsonbConfig = new JsonbConfig();
for (JsonbConfigCustomizer customizer : customizers) {
customizer.customize(jsonbConfig);
Expand Down

0 comments on commit 17c0497

Please sign in to comment.