Skip to content

Commit

Permalink
Add ArtemisJmsRABuildItem
Browse files Browse the repository at this point in the history
  • Loading branch information
zhfeng committed Aug 1, 2024
1 parent f03561e commit afb15dd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ public class ArtemisCoreProcessor {

@SuppressWarnings("unused")
@BuildStep
FeatureBuildItem feature(Optional<ArtemisJmsBuildItem> artemisJms) {
if (artemisJms.isEmpty()) {
FeatureBuildItem feature(Optional<ArtemisJmsBuildItem> artemisJms,
Optional<ArtemisJmsRABuildItem> ra) {
if (artemisJms.isEmpty() && ra.isEmpty()) {
return new FeatureBuildItem(FEATURE);
}
return null;
Expand Down Expand Up @@ -109,8 +110,9 @@ ArtemisCoreConfiguredBuildItem configure(
ArtemisBuildTimeConfigs buildTimeConfigs,
ArtemisBootstrappedBuildItem bootstrap,
BuildProducer<SyntheticBeanBuildItem> syntheticBeanProducer,
Optional<ArtemisJmsBuildItem> artemisJms) {
if (artemisJms.isPresent()) {
Optional<ArtemisJmsBuildItem> artemisJms,
Optional<ArtemisJmsRABuildItem> ra) {
if (artemisJms.isPresent() || ra.isPresent()) {
return null;
}
if (shadowRunTimeConfigs.isEmpty() && buildTimeConfigs.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.quarkus.artemis.core.deployment;

import io.quarkus.builder.item.SimpleBuildItem;

/**
* Marker build item indicating that RA is enabled
*/
public class ArtemisJmsRABuildItem extends SimpleBuildItem {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Optional;
import java.util.Set;

import io.quarkus.artemis.core.deployment.ArtemisJmsRABuildItem;
import jakarta.enterprise.context.ApplicationScoped;

import io.quarkus.arc.deployment.SyntheticBeanBuildItem;
Expand Down Expand Up @@ -77,8 +78,9 @@ private static Set<String> processConfigs(
HealthBuildItem healthChecks(
Capabilities capabilities,
Optional<ArtemisJmsBuildItem> artemisJms,
Optional<ArtemisJmsRABuildItem> ra,
Optional<ArtemisHealthSupportBuildItem> artemisHealthSupportBuildItem) {
if (artemisJms.isPresent()) {
if (artemisJms.isPresent() || ra.isPresent()) {
return null;
}
if (artemisHealthSupportBuildItem.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Map.Entry;

import io.quarkus.artemis.core.deployment.ArtemisJmsRABuildItem;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Default;

Expand Down Expand Up @@ -29,6 +30,11 @@ FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

@BuildStep
void load(BuildProducer<ArtemisJmsRABuildItem> ra) {
ra.produce(new ArtemisJmsRABuildItem());
}

@Record(ExecutionTime.RUNTIME_INIT)
@BuildStep
void setupServerLocatorForHealthCheck(ArtemisResourceAdapterRecorder recorder,
Expand Down

0 comments on commit afb15dd

Please sign in to comment.