-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
659df3d
commit 0f7f303
Showing
8 changed files
with
82 additions
and
61 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
31 changes: 0 additions & 31 deletions
31
...-mq-rocketmq/src/main/java/org/hongxi/whatsmars/mq/rocketmq/boot/ConsumerApplication.java
This file was deleted.
Oops, something went wrong.
36 changes: 10 additions & 26 deletions
36
...smars-mq-rocketmq/src/main/java/org/hongxi/whatsmars/mq/rocketmq/boot/OrderPaidEvent.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 |
---|---|---|
@@ -1,33 +1,17 @@ | ||
package org.hongxi.whatsmars.mq.rocketmq.boot; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
import java.math.BigDecimal; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Data | ||
public class OrderPaidEvent implements Serializable { | ||
private String orderId; | ||
|
||
private BigDecimal paidMoney; | ||
|
||
public OrderPaidEvent() {} | ||
|
||
public OrderPaidEvent(String orderId, BigDecimal paidMoney) { | ||
this.orderId = orderId; | ||
this.paidMoney = paidMoney; | ||
} | ||
|
||
public String getOrderId() { | ||
return orderId; | ||
} | ||
|
||
public void setOrderId(String orderId) { | ||
this.orderId = orderId; | ||
} | ||
|
||
public BigDecimal getPaidMoney() { | ||
return paidMoney; | ||
} | ||
|
||
public void setPaidMoney(BigDecimal paidMoney) { | ||
this.paidMoney = paidMoney; | ||
} | ||
} | ||
private String orderId; | ||
private BigDecimal paidMoney; | ||
} |
13 changes: 13 additions & 0 deletions
13
...tmq/src/main/java/org/hongxi/whatsmars/mq/rocketmq/boot/consumer/ConsumerApplication.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,13 @@ | ||
package org.hongxi.whatsmars.mq.rocketmq.boot.consumer; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class ConsumerApplication{ | ||
|
||
public static void main(String[] args){ | ||
SpringApplication.run(ConsumerApplication.class, args); | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
...-mq-rocketmq/src/main/java/org/hongxi/whatsmars/mq/rocketmq/boot/consumer/MyConsumer.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 org.hongxi.whatsmars.mq.rocketmq.boot.consumer; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.rocketmq.spring.starter.annotation.RocketMQMessageListener; | ||
import org.apache.rocketmq.spring.starter.core.RocketMQListener; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Slf4j | ||
@Service | ||
@RocketMQMessageListener(topic = "test-topic-1", consumerGroup = "my-consumer_test-topic-1") | ||
public class MyConsumer implements RocketMQListener<String> { | ||
public void onMessage(String message) { | ||
log.info("received message: " + message); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...mq-rocketmq/src/main/java/org/hongxi/whatsmars/mq/rocketmq/boot/consumer/MyConsumer2.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,16 @@ | ||
package org.hongxi.whatsmars.mq.rocketmq.boot.consumer; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.rocketmq.spring.starter.annotation.RocketMQMessageListener; | ||
import org.apache.rocketmq.spring.starter.core.RocketMQListener; | ||
import org.hongxi.whatsmars.mq.rocketmq.boot.OrderPaidEvent; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Slf4j | ||
@Service | ||
@RocketMQMessageListener(topic = "test-topic-2", consumerGroup = "my-consumer_test-topic-2") | ||
public class MyConsumer2 implements RocketMQListener<OrderPaidEvent> { | ||
public void onMessage(OrderPaidEvent orderPaidEvent) { | ||
log.info("received orderPaidEvent: " + orderPaidEvent); | ||
} | ||
} |
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