Skip to content

Commit

Permalink
🔥 feat: 添加mq
Browse files Browse the repository at this point in the history
  • Loading branch information
cokie committed Jan 22, 2024
1 parent fd1db9c commit 2dcb5c5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.micro.server.robot.infra.event.dto.RobotDTO;
import io.micro.server.robot.infra.event.sdk.RobotConstant;
import io.vertx.core.json.JsonObject;
import jakarta.enterprise.context.ApplicationScoped;
import org.eclipse.microprofile.reactive.messaging.Incoming;
import org.eclipse.microprofile.reactive.messaging.Message;
Expand All @@ -12,8 +13,9 @@
public class RobotCustomer {

@Incoming(RobotConstant.Queue.ROBOT_LOGIN_SUCCESS)
public CompletionStage<Void> robotLoginSuccess(Message<RobotDTO> msg) {
RobotDTO robot = msg.getPayload();
public CompletionStage<Void> robotLoginSuccess(Message<JsonObject> msg) {
JsonObject jsonObject = msg.getPayload();
RobotDTO robot = jsonObject.mapTo(RobotDTO.class);
System.out.println("==========");
System.out.println(robot.getId());
System.out.println("==========");
Expand Down
16 changes: 1 addition & 15 deletions tokisaki-starter/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,4 @@ quarkus:
rabbitmq-host: localhost
rabbitmq-port: 5672
rabbitmq-username: tokisaki
rabbitmq-password: 123456
mp:
messaging:
incoming:
robot-login-success:
connector: smallrye-rabbitmq
routing-keys: robot.login.success
queue:
name: robot-login-success
outgoing:
robot-login:
connector: smallrye-rabbitmq
default-roting-key: robot.login.*
exchange:
name: robot-login
rabbitmq-password: 123456
15 changes: 14 additions & 1 deletion tokisaki-starter/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,17 @@ mp:
jwt:
verify:
publickey:
location: publicKey.pem
location: publicKey.pem
messaging:
incoming:
robot-login-success:
connector: smallrye-rabbitmq
routing-keys: robot.login.success
queue:
name: queue.robot.login.success
exchange:
name: exchange.robot.login
outgoing:
robot-login:
exchange:
name: exchange.robot.login

0 comments on commit 2dcb5c5

Please sign in to comment.