generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support using CXF TagsCustomizers and deprecate dynamic usage of
MeterFilter #1492
- Loading branch information
Showing
12 changed files
with
126 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
integration-tests/hc5/src/main/java/io/quarkiverse/cxf/hc5/it/FactorHeaderRequestFilter.java
This file was deleted.
Oops, something went wrong.
18 changes: 17 additions & 1 deletion
18
.../cxf/hc5/it/MyContainerRequestFilter.java → ...5/it/HeaderToMetricsTagRequestFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,35 @@ | ||
package io.quarkiverse.cxf.hc5.it; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.enterprise.context.RequestScoped; | ||
import jakarta.inject.Inject; | ||
import jakarta.ws.rs.container.ContainerRequestContext; | ||
import jakarta.ws.rs.container.ContainerRequestFilter; | ||
import jakarta.ws.rs.ext.Provider; | ||
|
||
@ApplicationScoped | ||
@Provider | ||
public class MyContainerRequestFilter implements ContainerRequestFilter { | ||
public class HeaderToMetricsTagRequestFilter implements ContainerRequestFilter { | ||
@Inject | ||
RequestScopedHeader requestScopedHeader; | ||
|
||
@Override | ||
public void filter(ContainerRequestContext requestContext) { | ||
requestScopedHeader.setHeaderValue(requestContext.getHeaderString(RequestScopedHeader.header)); | ||
} | ||
|
||
@RequestScoped | ||
public static class RequestScopedHeader { | ||
public static final String header = "my-header"; | ||
|
||
public String getHeaderValue() { | ||
return headerValue; | ||
} | ||
|
||
public void setHeaderValue(String headerValue) { | ||
this.headerValue = headerValue; | ||
} | ||
|
||
private String headerValue; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...tion-tests/hc5/src/main/java/io/quarkiverse/cxf/hc5/it/HeaderToMetricsTagsCustomizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.quarkiverse.cxf.hc5.it; | ||
|
||
import jakarta.inject.Inject; | ||
import jakarta.inject.Named; | ||
import jakarta.inject.Singleton; | ||
|
||
import org.apache.cxf.message.Exchange; | ||
import org.apache.cxf.metrics.micrometer.provider.TagsCustomizer; | ||
|
||
import io.micrometer.core.instrument.Tag; | ||
import io.micrometer.core.instrument.Tags; | ||
import io.quarkiverse.cxf.hc5.it.HeaderToMetricsTagRequestFilter.RequestScopedHeader; | ||
|
||
@Singleton | ||
@Named("headerToMetricsTagsCustomizer") | ||
public class HeaderToMetricsTagsCustomizer implements TagsCustomizer { | ||
|
||
@Inject | ||
RequestScopedHeader requestScopedHeader; | ||
|
||
@Override | ||
public Iterable<Tag> getAdditionalTags(Exchange ex, boolean client) { | ||
final String val = requestScopedHeader.getHeaderValue(); | ||
if (val != null) { | ||
return Tags.of(Tag.of("my-header", val)); | ||
} | ||
return Tags.empty(); | ||
} | ||
} |
31 changes: 0 additions & 31 deletions
31
integration-tests/hc5/src/main/java/io/quarkiverse/cxf/hc5/it/MeterFilterProducer.java
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
integration-tests/hc5/src/main/java/io/quarkiverse/cxf/hc5/it/RequestScopedHeader.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters