Compare commits
2 commits
41b144a3b9
...
524ca47f16
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
524ca47f16 | ||
|
|
a54ce0f0af |
9 changed files with 7 additions and 203 deletions
|
|
@ -1,60 +0,0 @@
|
||||||
# rabbitmq-quickstart-akka
|
|
||||||
|
|
||||||
This project uses Quarkus, the Supersonic Subatomic Java Framework.
|
|
||||||
|
|
||||||
If you want to learn more about Quarkus, please visit its website: <https://quarkus.io/>.
|
|
||||||
|
|
||||||
## Running the application in dev mode
|
|
||||||
|
|
||||||
You can run your application in dev mode that enables live coding using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw quarkus:dev
|
|
||||||
```
|
|
||||||
|
|
||||||
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at <http://localhost:8080/q/dev/>.
|
|
||||||
|
|
||||||
## Packaging and running the application
|
|
||||||
|
|
||||||
The application can be packaged using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package
|
|
||||||
```
|
|
||||||
|
|
||||||
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
|
|
||||||
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.
|
|
||||||
|
|
||||||
The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.
|
|
||||||
|
|
||||||
If you want to build an _über-jar_, execute the following command:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package -Dquarkus.package.jar.type=uber-jar
|
|
||||||
```
|
|
||||||
|
|
||||||
The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.
|
|
||||||
|
|
||||||
## Creating a native executable
|
|
||||||
|
|
||||||
You can create a native executable using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package -Dnative
|
|
||||||
```
|
|
||||||
|
|
||||||
Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package -Dnative -Dquarkus.native.container-build=true
|
|
||||||
```
|
|
||||||
|
|
||||||
You can then execute your native executable with: `./target/rabbitmq-quickstart-akka-1.0.0-SNAPSHOT-runner`
|
|
||||||
|
|
||||||
If you want to learn more about building native executables, please consult <https://quarkus.io/guides/maven-tooling>.
|
|
||||||
|
|
||||||
## Related Guides
|
|
||||||
|
|
||||||
- Scheduler ([guide](https://quarkus.io/guides/scheduler)): Schedule jobs and tasks
|
|
||||||
- REST ([guide](https://quarkus.io/guides/rest)): A Jakarta REST implementation utilizing build time processing and Vert.x. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it.
|
|
||||||
- Messaging - RabbitMQ Connector ([guide](https://quarkus.io/guides/rabbitmq)): Connect to RabbitMQ with Reactive Messaging
|
|
||||||
|
|
@ -15,11 +15,11 @@ public class UpdateAktorCronJob {
|
||||||
Emitter<AkkaData> emitter;
|
Emitter<AkkaData> emitter;
|
||||||
|
|
||||||
@Scheduled(cron = "{cron.expr}")
|
@Scheduled(cron = "{cron.expr}")
|
||||||
void cronJobWithExpressionInConfig() {
|
void cronJobCreateActor() {
|
||||||
AkkaData akkaData = new AkkaData();
|
AkkaData akkaData = new AkkaData();
|
||||||
UUID uuid = UUID.randomUUID();
|
UUID uuid = UUID.randomUUID();
|
||||||
akkaData.setOrgnr(uuid.toString());
|
akkaData.setOrgnr(uuid.toString());
|
||||||
emitter.send(akkaData);
|
emitter.send(akkaData);
|
||||||
System.out.println("Emitted that actor was updated");
|
System.out.println("Emitted that actor was created");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
# rabbitmq-quickstart-processor
|
|
||||||
|
|
||||||
This project uses Quarkus, the Supersonic Subatomic Java Framework.
|
|
||||||
|
|
||||||
If you want to learn more about Quarkus, please visit its website: <https://quarkus.io/>.
|
|
||||||
|
|
||||||
## Running the application in dev mode
|
|
||||||
|
|
||||||
You can run your application in dev mode that enables live coding using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw quarkus:dev
|
|
||||||
```
|
|
||||||
|
|
||||||
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at <http://localhost:8080/q/dev/>.
|
|
||||||
|
|
||||||
## Packaging and running the application
|
|
||||||
|
|
||||||
The application can be packaged using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package
|
|
||||||
```
|
|
||||||
|
|
||||||
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
|
|
||||||
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.
|
|
||||||
|
|
||||||
The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.
|
|
||||||
|
|
||||||
If you want to build an _über-jar_, execute the following command:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package -Dquarkus.package.jar.type=uber-jar
|
|
||||||
```
|
|
||||||
|
|
||||||
The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.
|
|
||||||
|
|
||||||
## Creating a native executable
|
|
||||||
|
|
||||||
You can create a native executable using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package -Dnative
|
|
||||||
```
|
|
||||||
|
|
||||||
Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package -Dnative -Dquarkus.native.container-build=true
|
|
||||||
```
|
|
||||||
|
|
||||||
You can then execute your native executable with: `./target/rabbitmq-quickstart-processor-1.0.0-SNAPSHOT-runner`
|
|
||||||
|
|
||||||
If you want to learn more about building native executables, please consult <https://quarkus.io/guides/maven-tooling>.
|
|
||||||
|
|
||||||
## Related Guides
|
|
||||||
|
|
||||||
- Messaging - RabbitMQ Connector ([guide](https://quarkus.io/guides/rabbitmq)): Connect to RabbitMQ with Reactive Messaging
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package se.saasta.rabbitmq.model;
|
package se.saasta.rabbitmq.model;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -8,18 +7,9 @@ import java.util.List;
|
||||||
@RegisterForReflection
|
@RegisterForReflection
|
||||||
public class StaraData {
|
public class StaraData {
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
private long id;
|
|
||||||
private long amount;
|
private long amount;
|
||||||
private List<String> orgnr;
|
private List<String> orgnr;
|
||||||
|
|
||||||
public long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getAmount() {
|
public long getAmount() {
|
||||||
return amount;
|
return amount;
|
||||||
|
|
@ -40,8 +30,7 @@ public class StaraData {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "StaraData{" +
|
return "StaraData{" +
|
||||||
"id=" + id +
|
"amount=" + amount +
|
||||||
", amount=" + amount +
|
|
||||||
", orgnr=" + orgnr +
|
", orgnr=" + orgnr +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ public class StaraProcessor {
|
||||||
@Incoming("stara")
|
@Incoming("stara")
|
||||||
public void process(JsonObject quoteRequest) throws InterruptedException {
|
public void process(JsonObject quoteRequest) throws InterruptedException {
|
||||||
StaraData data = quoteRequest.mapTo(StaraData.class);
|
StaraData data = quoteRequest.mapTo(StaraData.class);
|
||||||
System.out.println("RECEIVED DATA WOOP WOOP: " + data.toString());
|
System.out.println("Received data from Stara: " + data.toString());
|
||||||
|
|
||||||
service.persistStaraData(data);
|
service.persistStaraData(data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,4 @@ mp.messaging.incoming.stara.exchange.name=stara
|
||||||
mp.messaging.incoming.akka.connector=smallrye-rabbitmq
|
mp.messaging.incoming.akka.connector=smallrye-rabbitmq
|
||||||
mp.messaging.incoming.akka.queue.name=akka
|
mp.messaging.incoming.akka.queue.name=akka
|
||||||
mp.messaging.incoming.akka.exchange.name=akka
|
mp.messaging.incoming.akka.exchange.name=akka
|
||||||
# Configure the outgoing RabbitMQ exchange `quotes`
|
|
||||||
mp.messaging.outgoing.quotes.connector=smallrye-rabbitmq
|
|
||||||
mp.messaging.outgoing.quotes.exchange.name=stara
|
|
||||||
quarkus.http.port=8081
|
quarkus.http.port=8081
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
# rabbitmq-quickstart-producer
|
|
||||||
|
|
||||||
This project uses Quarkus, the Supersonic Subatomic Java Framework.
|
|
||||||
|
|
||||||
If you want to learn more about Quarkus, please visit its website: <https://quarkus.io/>.
|
|
||||||
|
|
||||||
## Running the application in dev mode
|
|
||||||
|
|
||||||
You can run your application in dev mode that enables live coding using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw quarkus:dev
|
|
||||||
```
|
|
||||||
|
|
||||||
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at <http://localhost:8080/q/dev/>.
|
|
||||||
|
|
||||||
## Packaging and running the application
|
|
||||||
|
|
||||||
The application can be packaged using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package
|
|
||||||
```
|
|
||||||
|
|
||||||
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
|
|
||||||
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.
|
|
||||||
|
|
||||||
The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.
|
|
||||||
|
|
||||||
If you want to build an _über-jar_, execute the following command:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package -Dquarkus.package.jar.type=uber-jar
|
|
||||||
```
|
|
||||||
|
|
||||||
The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.
|
|
||||||
|
|
||||||
## Creating a native executable
|
|
||||||
|
|
||||||
You can create a native executable using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package -Dnative
|
|
||||||
```
|
|
||||||
|
|
||||||
Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
|
|
||||||
|
|
||||||
```shell script
|
|
||||||
./mvnw package -Dnative -Dquarkus.native.container-build=true
|
|
||||||
```
|
|
||||||
|
|
||||||
You can then execute your native executable with: `./target/rabbitmq-quickstart-producer-1.0.0-SNAPSHOT-runner`
|
|
||||||
|
|
||||||
If you want to learn more about building native executables, please consult <https://quarkus.io/guides/maven-tooling>.
|
|
||||||
|
|
||||||
## Related Guides
|
|
||||||
|
|
||||||
- REST Jackson ([guide](https://quarkus.io/guides/rest#json-serialisation)): Jackson serialization support for Quarkus REST. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it
|
|
||||||
- Messaging - RabbitMQ Connector ([guide](https://quarkus.io/guides/rabbitmq)): Connect to RabbitMQ with Reactive Messaging
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package se.saasta.rabbitmq.producer;
|
package se.saasta.rabbitmq.producer;
|
||||||
|
|
||||||
|
|
||||||
import io.smallrye.mutiny.Multi;
|
|
||||||
import jakarta.ws.rs.Consumes;
|
import jakarta.ws.rs.Consumes;
|
||||||
import jakarta.ws.rs.POST;
|
import jakarta.ws.rs.POST;
|
||||||
import jakarta.ws.rs.Path;
|
import jakarta.ws.rs.Path;
|
||||||
|
|
@ -23,10 +22,6 @@ public class StaraResource {
|
||||||
@Channel("stara")
|
@Channel("stara")
|
||||||
Emitter<StaraData> emitter;
|
Emitter<StaraData> emitter;
|
||||||
|
|
||||||
|
|
||||||
@Channel("aver")
|
|
||||||
Multi<StaraData> quotes;
|
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
mp.messaging.outgoing.quote-requests.connector=smallrye-rabbitmq
|
mp.messaging.outgoing.stara.connector=smallrye-rabbitmq
|
||||||
mp.messaging.outgoing.quote-requests.exchange.name=quote-requests
|
mp.messaging.outgoing.stara.exchange.name=stara
|
||||||
mp.messaging.incoming.aver.connector=smallrye-rabbitmq
|
mp.messaging.incoming.aver.connector=smallrye-rabbitmq
|
||||||
Loading…
Reference in a new issue