-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #257 to add quarkus-artemis-jms-ra
- Loading branch information
Showing
37 changed files
with
1,044 additions
and
9 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
15 changes: 15 additions & 0 deletions
15
...main/java/io/quarkus/artemis/core/deployment/health/ExtraArtemisHealthCheckBuildItem.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,15 @@ | ||
package io.quarkus.artemis.core.deployment.health; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
|
||
public final class ExtraArtemisHealthCheckBuildItem extends MultiBuildItem { | ||
private final String name; | ||
|
||
public ExtraArtemisHealthCheckBuildItem(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
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
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 @@ | ||
quarkus.log.category."org.apache.activemq.audit".level=WARN |
3 changes: 2 additions & 1 deletion
3
integration-tests/jms/without-default/src/main/resources/application.properties
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,3 +1,4 @@ | ||
quarkus.artemis."named-1".devservices.enabled=false | ||
quarkus.artemis."named-1".xa-enabled=true | ||
quarkus.artemis."named-2".enabled=false | ||
quarkus.artemis."named-2".enabled=false | ||
quarkus.log.category."org.apache.activemq.audit".level=WARN |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.quarkiverse.artemis</groupId> | ||
<artifactId>quarkus-artemis-integration-tests-parent</artifactId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>quarkus-integration-test-artemis-jms-ra</artifactId> | ||
<name>Quarkus - Artemis - Integration Tests - JMS Resource Adapter</name> | ||
<description>The Apache ActiveMQ Artemis JMS Resource Adapter integration tests</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-hibernate-orm-panache</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-jdbc-postgresql</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-micrometer-registry-prometheus</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-narayana-jta</artifactId> | ||
</dependency> | ||
|
||
<!-- Artemis --> | ||
<dependency> | ||
<groupId>io.quarkiverse.artemis</groupId> | ||
<artifactId>quarkus-artemis-jms-ra</artifactId> | ||
</dependency> | ||
|
||
<!-- Test --> | ||
<dependency> | ||
<groupId>io.quarkiverse.artemis</groupId> | ||
<artifactId>quarkus-integration-test-artemis-common</artifactId> | ||
<classifier>tests</classifier> | ||
<type>test-jar</type> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<version>3.24.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
11 changes: 11 additions & 0 deletions
11
integration-tests/ra/src/main/java/io/quarkus/it/artemis/ra/Gift.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,11 @@ | ||
package io.quarkus.it.artemis.ra; | ||
|
||
import jakarta.persistence.Entity; | ||
|
||
import io.quarkus.hibernate.orm.panache.PanacheEntity; | ||
|
||
@Entity | ||
public class Gift extends PanacheEntity { | ||
|
||
public String name; | ||
} |
90 changes: 90 additions & 0 deletions
90
integration-tests/ra/src/main/java/io/quarkus/it/artemis/ra/JcaResource.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,90 @@ | ||
package io.quarkus.it.artemis.ra; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.inject.Inject; | ||
import jakarta.jms.ConnectionFactory; | ||
import jakarta.jms.JMSContext; | ||
import jakarta.jms.JMSProducer; | ||
import jakarta.jms.Queue; | ||
import jakarta.jms.TextMessage; | ||
import jakarta.transaction.Transactional; | ||
import jakarta.ws.rs.DELETE; | ||
import jakarta.ws.rs.DefaultValue; | ||
import jakarta.ws.rs.FormParam; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.QueryParam; | ||
|
||
import io.quarkus.narayana.jta.QuarkusTransaction; | ||
|
||
@Path("/jca") | ||
@ApplicationScoped | ||
public class JcaResource { | ||
// add some rest methods here | ||
|
||
@Inject | ||
ConnectionFactory factory; | ||
|
||
@GET | ||
@Transactional | ||
public String hello(@QueryParam("name") @DefaultValue("JCA") String name) { | ||
try (JMSContext context = factory.createContext()) { | ||
Queue myQueue = context.createQueue("MyQueue"); | ||
JMSProducer producer = context.createProducer(); | ||
producer.send(myQueue, "Hello " + name); | ||
Gift gift = new Gift(); | ||
gift.name = name; | ||
gift.persist(); | ||
if (name.equals("rollback")) { | ||
QuarkusTransaction.setRollbackOnly(); | ||
} | ||
} | ||
return "Hello " + name; | ||
} | ||
|
||
@POST | ||
@Transactional | ||
@Path("/sales") | ||
public void sendToSalesQueue(@FormParam("name") String name) throws Exception { | ||
try (JMSContext context = factory.createContext()) { | ||
JMSProducer producer = context.createProducer(); | ||
TextMessage msg = context.createTextMessage(name); | ||
msg.setJMSReplyTo(context.createQueue("inventory")); | ||
producer.send(context.createQueue("sales"), msg); | ||
} | ||
} | ||
|
||
@DELETE | ||
@Path("/gifts") | ||
@Transactional | ||
public void deleteGifts() { | ||
Gift.deleteAll(); | ||
} | ||
|
||
@GET | ||
@Path("/gifts/count") | ||
@Transactional | ||
public long countGifts() { | ||
return Gift.count(); | ||
} | ||
|
||
@GET | ||
@Path("/transacted") | ||
@Transactional | ||
public boolean Transacted() { | ||
return isTransacted(); | ||
} | ||
|
||
@GET | ||
@Path("/not-transacted") | ||
public boolean notTransacted() { | ||
return isTransacted(); | ||
} | ||
|
||
private boolean isTransacted() { | ||
try (JMSContext context = factory.createContext()) { | ||
return context.getTransacted(); | ||
} | ||
} | ||
} |
Oops, something went wrong.