mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
bugfix
This commit is contained in:
@@ -25,13 +25,12 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.digest.HmacAlgorithms;
|
||||
import org.apache.commons.codec.digest.HmacUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.amqp.support.AmqpHeaders;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.messaging.handler.annotation.Headers;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -73,8 +72,14 @@ public class PmsListener {
|
||||
key = "pms.*")
|
||||
})
|
||||
@Transactional
|
||||
public void handlePmsMessage(String body, @Headers Map<String, Object> headers) {
|
||||
public void handlePmsMessage(Message message) {
|
||||
|
||||
var body = new String(message.getBody(), StandardCharsets.UTF_8);
|
||||
|
||||
Map<String, Object> headers = message.getMessageProperties().getHeaders();
|
||||
|
||||
|
||||
|
||||
Object key = headers.get("appKey");
|
||||
|
||||
if (key == null) {
|
||||
@@ -120,8 +125,8 @@ public class PmsListener {
|
||||
logEntity.setOrganizationId(dataCollector.getOrganizationId());
|
||||
logEntity.setDataCollector(dataCollector);
|
||||
|
||||
Object rk = headers.get(AmqpHeaders.RECEIVED_ROUTING_KEY);
|
||||
|
||||
Object rk =message.getMessageProperties().getReceivedRoutingKey();
|
||||
|
||||
logEntity.setLogTime(LocalDateTime.now());
|
||||
logEntity.setType(rk.toString());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user