Compare commits
No commits in common. "524ca47f1625517c79fb4be2bc36aa74d52d9a32" and "41b144a3b9652874460283b3e0c69de4a199315f" have entirely different histories.
524ca47f16
...
41b144a3b9
9 changed files with 203 additions and 7 deletions
|
|
@ -0,0 +1,60 @@
|
|||
# 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;
|
||||
|
||||
@Scheduled(cron = "{cron.expr}")
|
||||
void cronJobCreateActor() {
|
||||
void cronJobWithExpressionInConfig() {
|
||||
AkkaData akkaData = new AkkaData();
|
||||
UUID uuid = UUID.randomUUID();
|
||||
akkaData.setOrgnr(uuid.toString());
|
||||
emitter.send(akkaData);
|
||||
System.out.println("Emitted that actor was created");
|
||||
System.out.println("Emitted that actor was updated");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
# 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,5 +1,6 @@
|
|||
package se.saasta.rabbitmq.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -7,9 +8,18 @@ import java.util.List;
|
|||
@RegisterForReflection
|
||||
public class StaraData {
|
||||
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
private long amount;
|
||||
private List<String> orgnr;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public long getAmount() {
|
||||
return amount;
|
||||
|
|
@ -30,7 +40,8 @@ public class StaraData {
|
|||
@Override
|
||||
public String toString() {
|
||||
return "StaraData{" +
|
||||
"amount=" + amount +
|
||||
"id=" + id +
|
||||
", amount=" + amount +
|
||||
", orgnr=" + orgnr +
|
||||
'}';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class StaraProcessor {
|
|||
@Incoming("stara")
|
||||
public void process(JsonObject quoteRequest) throws InterruptedException {
|
||||
StaraData data = quoteRequest.mapTo(StaraData.class);
|
||||
System.out.println("Received data from Stara: " + data.toString());
|
||||
System.out.println("RECEIVED DATA WOOP WOOP: " + data.toString());
|
||||
|
||||
service.persistStaraData(data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,4 +5,7 @@ mp.messaging.incoming.stara.exchange.name=stara
|
|||
mp.messaging.incoming.akka.connector=smallrye-rabbitmq
|
||||
mp.messaging.incoming.akka.queue.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
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
# 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,6 +1,7 @@
|
|||
package se.saasta.rabbitmq.producer;
|
||||
|
||||
|
||||
import io.smallrye.mutiny.Multi;
|
||||
import jakarta.ws.rs.Consumes;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
|
|
@ -18,10 +19,14 @@ import java.util.UUID;
|
|||
|
||||
@Path("/stara")
|
||||
public class StaraResource {
|
||||
|
||||
|
||||
@Channel("stara")
|
||||
Emitter<StaraData> emitter;
|
||||
|
||||
|
||||
@Channel("aver")
|
||||
Multi<StaraData> quotes;
|
||||
|
||||
@POST
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
mp.messaging.outgoing.stara.connector=smallrye-rabbitmq
|
||||
mp.messaging.outgoing.stara.exchange.name=stara
|
||||
mp.messaging.outgoing.quote-requests.connector=smallrye-rabbitmq
|
||||
mp.messaging.outgoing.quote-requests.exchange.name=quote-requests
|
||||
mp.messaging.incoming.aver.connector=smallrye-rabbitmq
|
||||
Loading…
Reference in a new issue